lkml.org 
[lkml]   [2020]   [Sep]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC 2/5] mm, page_alloc: calculate pageset high and batch once per zone
From
Date
On 07.09.20 18:36, Vlastimil Babka wrote:
> We currently call pageset_set_high_and_batch() for each possible cpu,
> which repeats the same calculations of high and batch values.
>
> Instead call it once per zone, and it applies the calculated values
> to all per-cpu pagesets of the zone.
>
> This also allows removing zone_pageset_init() and __zone_pcp_update() wrappers.
>
> No functional change.
>
> Signed-off-by: Vlastimil Babka <vbabka@suse.cz>
> ---
> mm/page_alloc.c | 40 +++++++++++++++++-----------------------
> 1 file changed, 17 insertions(+), 23 deletions(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index 0b516208afda..f669a251f654 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -6236,12 +6236,13 @@ static void setup_pageset(struct per_cpu_pageset *p)
> pageset_update(&p->pcp, 0, 1);
> }
>
> -static void pageset_set_high_and_batch(struct zone *zone,
> - struct per_cpu_pageset *p)
> +static void zone_set_pageset_high_and_batch(struct zone *zone)
> {
> unsigned long new_high;
> unsigned long new_batch;
> int fraction = READ_ONCE(percpu_pagelist_fraction);
> + int cpu;
> + struct per_cpu_pageset *p;

I would use reverse Christmas tree layout. (same applies to patch #1,
you could put both unsigned long variables into a single line)

[...]

LGTM

Reviewed-by: David Hildenbrand <david@redhat.com>

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2020-09-10 12:58    [W:0.289 / U:7.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site