Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Li Zefan
On 2013/6/13 10:38, Kent Overstreet wrote: > On Thu, Jun 13, 2013 at 10:36:40AM +0800, Li Zefan wrote: >> On 2013/6/13 5:03, Tejun Heo wrote: >>> There's no point in using kmalloc() and list_del() instead of the >>> clearing variants for trivial stuff. We can live dangerously >>> elsewhere. Use k

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Tejun Heo
On Wed, Jun 12, 2013 at 07:56:23PM -0700, Tejun Heo wrote: > poison. Maybe it was something which got stuck in my brain from > before the git history or I'm just hallucinating. Anyways, yeap, Just checked 2.4. It didn't poison then. Somehow I never got that out of my brain all these years. #f

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Tejun Heo
On Wed, Jun 12, 2013 at 07:52:02PM -0700, Kent Overstreet wrote: > On Wed, Jun 12, 2013 at 07:48:59PM -0700, Tejun Heo wrote: > > On Wed, Jun 12, 2013 at 07:43:10PM -0700, Kent Overstreet wrote: > > > list_del() does do poisoning - and list debugging is cheaper to enable > > > than full slab debugg

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Kent Overstreet
On Wed, Jun 12, 2013 at 07:48:59PM -0700, Tejun Heo wrote: > On Wed, Jun 12, 2013 at 07:43:10PM -0700, Kent Overstreet wrote: > > list_del() does do poisoning - and list debugging is cheaper to enable > > than full slab debugging. > > Ah, right, now we have DEBUG_LIST. Completely forgot about tha

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Tejun Heo
On Wed, Jun 12, 2013 at 07:43:10PM -0700, Kent Overstreet wrote: > list_del() does do poisoning - and list debugging is cheaper to enable > than full slab debugging. Ah, right, now we have DEBUG_LIST. Completely forgot about that. I don't think the cost difference matters that much as long as th

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Kent Overstreet
On Wed, Jun 12, 2013 at 07:41:15PM -0700, Tejun Heo wrote: > Hello, > > On Wed, Jun 12, 2013 at 7:38 PM, Kent Overstreet > wrote: > > IMO, list_del() is preferred when the object shouldn't be reused (i.e. > > it gets taken off a list and then it's freed). list_del_init() could > > hide bugs. >

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Tejun Heo
Hello, On Wed, Jun 12, 2013 at 7:38 PM, Kent Overstreet wrote: > IMO, list_del() is preferred when the object shouldn't be reused (i.e. > it gets taken off a list and then it's freed). list_del_init() could > hide bugs. Nah... use-after-frees are detected much more reliably by poisoning anyway.

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Tejun Heo
Hello, On Wed, Jun 12, 2013 at 7:36 PM, Li Zefan wrote: > Do you mean we prefer list_del_init() than list_del() in general? Then Yes. > in which cases do we prefer list_del()? Nowadays, I don't think we ever prefer list_del(). Maybe if it can be shown that the extra init part is noticeably exp

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Kent Overstreet
On Thu, Jun 13, 2013 at 10:36:40AM +0800, Li Zefan wrote: > On 2013/6/13 5:03, Tejun Heo wrote: > > There's no point in using kmalloc() and list_del() instead of the > > clearing variants for trivial stuff. We can live dangerously > > elsewhere. Use kzalloc() and list_del_init() instead and drop

Re: [PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Li Zefan
On 2013/6/13 5:03, Tejun Heo wrote: > There's no point in using kmalloc() and list_del() instead of the > clearing variants for trivial stuff. We can live dangerously > elsewhere. Use kzalloc() and list_del_init() instead and drop 0 > inits. > Do you mean we prefer list_del_init() than list_del

[PATCH 04/11] cgroup: use kzalloc() and list_del_init()

2013-06-12 Thread Tejun Heo
There's no point in using kmalloc() and list_del() instead of the clearing variants for trivial stuff. We can live dangerously elsewhere. Use kzalloc() and list_del_init() instead and drop 0 inits. While at it, do trivial code reorganization in cgroup_file_open(). This patch doesn't introduce a