Re: [PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-04 Thread Tejun Heo
Hello, On Tue, Oct 03, 2017 at 06:29:49PM -0400, Nicolas Pitre wrote: > Subject: [PATCH] percpu: don't forget to free the temporary struct > pcpu_alloc_info > > Unlike the SMP case, the !SMP case does not free the memory for struct > pcpu_alloc_info allocated in setup_per_cpu_areas(). And to gi

Re: [PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-03 Thread Nicolas Pitre
On Tue, 3 Oct 2017, Dennis Zhou wrote: > Hi Tejun, > > On Tue, Oct 03, 2017 at 03:36:42PM -0700, Tejun Heo wrote: > > > Subject: [PATCH] percpu: don't forget to free the temporary struct > > > pcpu_alloc_info > > > > So, IIRC, the error path is either boot fail or some serious bug in > > arch c

Re: [PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-03 Thread Dennis Zhou
Hi Tejun, On Tue, Oct 03, 2017 at 03:36:42PM -0700, Tejun Heo wrote: > > Subject: [PATCH] percpu: don't forget to free the temporary struct > > pcpu_alloc_info > > So, IIRC, the error path is either boot fail or some serious bug in > arch code. It really doesn't matter whether we free a page or

Re: [PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-03 Thread Tejun Heo
Hello, On Tue, Oct 03, 2017 at 06:29:49PM -0400, Nicolas Pitre wrote: > I'm not sure i understand that code fully, but maybe the following patch > could be a better fit: > > - >8 > Subject: [PATCH] percpu: don't forget to free the temporary struct > pcpu_alloc_info So, IIRC, the error path

Re: [PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-03 Thread Nicolas Pitre
On Tue, 3 Oct 2017, Tejun Heo wrote: > On Tue, Oct 03, 2017 at 04:57:44PM -0400, Nicolas Pitre wrote: > > This can be much smaller than a page on very small memory systems. > > Always rounding up the size to a page is wasteful in that case, and > > required alignment is smaller than the memblock

Re: [PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-03 Thread Tejun Heo
On Tue, Oct 03, 2017 at 04:57:44PM -0400, Nicolas Pitre wrote: > This can be much smaller than a page on very small memory systems. > Always rounding up the size to a page is wasteful in that case, and > required alignment is smaller than the memblock default. Let's round > things up to a page s

[PATCH] mm/percpu.c: use smarter memory allocation for struct pcpu_alloc_info

2017-10-03 Thread Nicolas Pitre
This can be much smaller than a page on very small memory systems. Always rounding up the size to a page is wasteful in that case, and required alignment is smaller than the memblock default. Let's round things up to a page size only when the actual size is >= page size, and then it makes sense