Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-02-04 Thread Vlastimil Babka
On 2/3/21 12:10 PM, Bharata B Rao wrote: > On Wed, Jan 27, 2021 at 12:04:01PM +0100, Vlastimil Babka wrote: >> Yes, but it's tricky to do the retuning safely, e.g. if freelist >> randomization >> is enabled, see [1]. >> >> But as a quick fix for the regression, the heuristic idea could work >> r

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-02-04 Thread Christoph Lameter
On Thu, 4 Feb 2021, Vincent Guittot wrote: > > So what is preferrable here now? Above or other quick fix or reverting > > the original commit? > > I'm fine with whatever the solution as long as we can use keep using > nr_cpu_ids when other values like num_present_cpus, don't reflect > correctly th

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-02-03 Thread Vincent Guittot
On Wed, 3 Feb 2021 at 12:10, Bharata B Rao wrote: > > On Wed, Jan 27, 2021 at 12:04:01PM +0100, Vlastimil Babka wrote: > > On 1/27/21 10:10 AM, Christoph Lameter wrote: > > > On Tue, 26 Jan 2021, Will Deacon wrote: > > > > > >> > Hm, but booting the secondaries is just a software (kernel) action?

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-02-03 Thread Bharata B Rao
On Wed, Jan 27, 2021 at 12:04:01PM +0100, Vlastimil Babka wrote: > On 1/27/21 10:10 AM, Christoph Lameter wrote: > > On Tue, 26 Jan 2021, Will Deacon wrote: > > > >> > Hm, but booting the secondaries is just a software (kernel) action? They > >> > are > >> > already physically there, so it seems

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-28 Thread Mel Gorman
On Thu, Jan 28, 2021 at 02:57:10PM +0100, Michal Hocko wrote: > On Thu 28-01-21 13:45:12, Mel Gorman wrote: > [...] > > So mostly this is down to the number of times SLUB calls into the page > > allocator which only caches order-0 pages on a per-cpu basis. I do have > > a prototype for a high-order

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-28 Thread Michal Hocko
On Thu 28-01-21 13:45:12, Mel Gorman wrote: [...] > So mostly this is down to the number of times SLUB calls into the page > allocator which only caches order-0 pages on a per-cpu basis. I do have > a prototype for a high-order per-cpu allocator but it is very rough -- > high watermarks stop making

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-28 Thread Mel Gorman
On Tue, Jan 26, 2021 at 02:59:18PM +0100, Michal Hocko wrote: > > > This thread shows that this is still somehow related to performance but > > > the real reason is not clear. I believe we should be focusing on the > > > actual reasons for the performance impact than playing with some fancy > > > m

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-27 Thread Vlastimil Babka
On 1/26/21 2:59 PM, Michal Hocko wrote: >> >> On 8 CPUs, I run hackbench with up to 16 groups which means 16*40 >> threads. But I raise up to 256 groups, which means 256*40 threads, on >> the 224 CPUs system. In fact, hackbench -g 1 (with 1 group) doesn't >> regress on the 224 CPUs system. The n

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-27 Thread Vlastimil Babka
On 1/27/21 10:10 AM, Christoph Lameter wrote: > On Tue, 26 Jan 2021, Will Deacon wrote: > >> > Hm, but booting the secondaries is just a software (kernel) action? They >> > are >> > already physically there, so it seems to me as if the cpu_present_mask is >> > not >> > populated correctly on arm

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-27 Thread Will Deacon
On Mon, Jan 25, 2021 at 12:20:14PM +0100, Vlastimil Babka wrote: > On 1/23/21 1:32 PM, Vincent Guittot wrote: > >> PowerPC PowerNV Host: (160 cpus) > >> num_online_cpus 1 num_present_cpus 160 num_possible_cpus 160 nr_cpu_ids 160 > >> > >> PowerPC pseries KVM guest: (-smp 16,maxcpus=160) > >> num_on

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-27 Thread Christoph Lameter
On Tue, 26 Jan 2021, Will Deacon wrote: > > Hm, but booting the secondaries is just a software (kernel) action? They are > > already physically there, so it seems to me as if the cpu_present_mask is > > not > > populated correctly on arm64, and it's just a mirror of cpu_online_mask? > > I think t

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-26 Thread Michal Hocko
On Tue 26-01-21 14:38:14, Vincent Guittot wrote: > On Tue, 26 Jan 2021 at 09:52, Michal Hocko wrote: > > > > On Thu 21-01-21 19:19:21, Vlastimil Babka wrote: > > [...] > > > We could also start questioning the very assumption that number of cpus > > > should > > > affect slab page size in the fir

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-26 Thread Vincent Guittot
On Tue, 26 Jan 2021 at 09:52, Michal Hocko wrote: > > On Thu 21-01-21 19:19:21, Vlastimil Babka wrote: > [...] > > We could also start questioning the very assumption that number of cpus > > should > > affect slab page size in the first place. Should it? After all, each CPU > > will > > have one

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-26 Thread Michal Hocko
On Thu 21-01-21 19:19:21, Vlastimil Babka wrote: [...] > We could also start questioning the very assumption that number of cpus should > affect slab page size in the first place. Should it? After all, each CPU will > have one or more slab pages privately cached, as we discuss in the other > thread

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-25 Thread Vlastimil Babka
On 1/23/21 1:32 PM, Vincent Guittot wrote: >> PowerPC PowerNV Host: (160 cpus) >> num_online_cpus 1 num_present_cpus 160 num_possible_cpus 160 nr_cpu_ids 160 >> >> PowerPC pseries KVM guest: (-smp 16,maxcpus=160) >> num_online_cpus 1 num_present_cpus 16 num_possible_cpus 160 nr_cpu_ids 160 >> >> Th

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-24 Thread Bharata B Rao
On Fri, Jan 22, 2021 at 02:05:47PM +0100, Jann Horn wrote: > On Thu, Jan 21, 2021 at 7:19 PM Vlastimil Babka wrote: > > On 1/21/21 11:01 AM, Christoph Lameter wrote: > > > On Thu, 21 Jan 2021, Bharata B Rao wrote: > > > > > >> > The problem is that calculate_order() is called a number of times > >

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-23 Thread Vincent Guittot
+Adding arch arm64 Maintainers On Sat, 23 Jan 2021 at 06:16, Bharata B Rao wrote: > > On Fri, Jan 22, 2021 at 01:03:57PM +0100, Vlastimil Babka wrote: > > On 1/22/21 9:03 AM, Vincent Guittot wrote: > > > On Thu, 21 Jan 2021 at 19:19, Vlastimil Babka wrote: > > >> > > >> On 1/21/21 11:01 AM, Chri

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Bharata B Rao
On Fri, Jan 22, 2021 at 01:03:57PM +0100, Vlastimil Babka wrote: > On 1/22/21 9:03 AM, Vincent Guittot wrote: > > On Thu, 21 Jan 2021 at 19:19, Vlastimil Babka wrote: > >> > >> On 1/21/21 11:01 AM, Christoph Lameter wrote: > >> > On Thu, 21 Jan 2021, Bharata B Rao wrote: > >> > > >> >> > The probl

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Vlastimil Babka
On 1/22/21 2:05 PM, Jann Horn wrote: > On Thu, Jan 21, 2021 at 7:19 PM Vlastimil Babka wrote: >> On 1/21/21 11:01 AM, Christoph Lameter wrote: >> > On Thu, 21 Jan 2021, Bharata B Rao wrote: >> > >> >> > The problem is that calculate_order() is called a number of times >> >> > before secondaries CP

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Vincent Guittot
On Fri, 22 Jan 2021 at 13:03, Vlastimil Babka wrote: > > On 1/22/21 9:03 AM, Vincent Guittot wrote: > > On Thu, 21 Jan 2021 at 19:19, Vlastimil Babka wrote: > >> > >> On 1/21/21 11:01 AM, Christoph Lameter wrote: > >> > On Thu, 21 Jan 2021, Bharata B Rao wrote: > >> > > >> >> > The problem is tha

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Jann Horn
On Fri, Jan 22, 2021 at 2:05 PM Jann Horn wrote: > On Thu, Jan 21, 2021 at 7:19 PM Vlastimil Babka wrote: > > On 1/21/21 11:01 AM, Christoph Lameter wrote: > > > On Thu, 21 Jan 2021, Bharata B Rao wrote: > > > > > >> > The problem is that calculate_order() is called a number of times > > >> > bef

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Jann Horn
On Thu, Jan 21, 2021 at 7:19 PM Vlastimil Babka wrote: > On 1/21/21 11:01 AM, Christoph Lameter wrote: > > On Thu, 21 Jan 2021, Bharata B Rao wrote: > > > >> > The problem is that calculate_order() is called a number of times > >> > before secondaries CPUs are booted and it returns 1 instead of 22

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Vlastimil Babka
On 1/22/21 9:03 AM, Vincent Guittot wrote: > On Thu, 21 Jan 2021 at 19:19, Vlastimil Babka wrote: >> >> On 1/21/21 11:01 AM, Christoph Lameter wrote: >> > On Thu, 21 Jan 2021, Bharata B Rao wrote: >> > >> >> > The problem is that calculate_order() is called a number of times >> >> > before seconda

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-22 Thread Vincent Guittot
On Thu, 21 Jan 2021 at 19:19, Vlastimil Babka wrote: > > On 1/21/21 11:01 AM, Christoph Lameter wrote: > > On Thu, 21 Jan 2021, Bharata B Rao wrote: > > > >> > The problem is that calculate_order() is called a number of times > >> > before secondaries CPUs are booted and it returns 1 instead of 22

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-21 Thread Vlastimil Babka
On 1/21/21 11:01 AM, Christoph Lameter wrote: > On Thu, 21 Jan 2021, Bharata B Rao wrote: > >> > The problem is that calculate_order() is called a number of times >> > before secondaries CPUs are booted and it returns 1 instead of 224. >> > This makes the use of num_online_cpus() irrelevant for th

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-21 Thread Vincent Guittot
On Thu, 21 Jan 2021 at 11:01, Christoph Lameter wrote: > > On Thu, 21 Jan 2021, Bharata B Rao wrote: > > > > The problem is that calculate_order() is called a number of times > > > before secondaries CPUs are booted and it returns 1 instead of 224. > > > This makes the use of num_online_cpus() irr

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-21 Thread Christoph Lameter
On Thu, 21 Jan 2021, Bharata B Rao wrote: > > The problem is that calculate_order() is called a number of times > > before secondaries CPUs are booted and it returns 1 instead of 224. > > This makes the use of num_online_cpus() irrelevant for those cases > > > > After adding in my command line "sl

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-21 Thread Vincent Guittot
On Thu, 21 Jan 2021 at 06:31, Bharata B Rao wrote: > > On Wed, Jan 20, 2021 at 06:36:31PM +0100, Vincent Guittot wrote: > > Hi, > > > > On Wed, 18 Nov 2020 at 09:28, Bharata B Rao wrote: > > > > > > The page order of the slab that gets chosen for a given slab > > > cache depends on the number of

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-20 Thread Bharata B Rao
On Wed, Jan 20, 2021 at 06:36:31PM +0100, Vincent Guittot wrote: > Hi, > > On Wed, 18 Nov 2020 at 09:28, Bharata B Rao wrote: > > > > The page order of the slab that gets chosen for a given slab > > cache depends on the number of objects that can be fit in the > > slab while meeting other require

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2021-01-20 Thread Vincent Guittot
Hi, On Wed, 18 Nov 2020 at 09:28, Bharata B Rao wrote: > > The page order of the slab that gets chosen for a given slab > cache depends on the number of objects that can be fit in the > slab while meeting other requirements. We start with a value > of minimum objects based on nr_cpu_ids that is d

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2020-11-18 Thread David Rientjes
On Wed, 18 Nov 2020, Roman Gushchin wrote: > On Wed, Nov 18, 2020 at 12:25:38PM +0100, Vlastimil Babka wrote: > > On 11/18/20 9:27 AM, Bharata B Rao wrote: > > > The page order of the slab that gets chosen for a given slab > > > cache depends on the number of objects that can be fit in the > > > s

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2020-11-18 Thread Roman Gushchin
On Wed, Nov 18, 2020 at 12:25:38PM +0100, Vlastimil Babka wrote: > On 11/18/20 9:27 AM, Bharata B Rao wrote: > > The page order of the slab that gets chosen for a given slab > > cache depends on the number of objects that can be fit in the > > slab while meeting other requirements. We start with a

Re: [RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2020-11-18 Thread Vlastimil Babka
On 11/18/20 9:27 AM, Bharata B Rao wrote: The page order of the slab that gets chosen for a given slab cache depends on the number of objects that can be fit in the slab while meeting other requirements. We start with a value of minimum objects based on nr_cpu_ids that is driven by possible numbe

[RFC PATCH v0] mm/slub: Let number of online CPUs determine the slub page order

2020-11-18 Thread Bharata B Rao
The page order of the slab that gets chosen for a given slab cache depends on the number of objects that can be fit in the slab while meeting other requirements. We start with a value of minimum objects based on nr_cpu_ids that is driven by possible number of CPUs and hence could be higher than the