linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Vlastimil Babka <vbabka@suse.cz>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Michal Hocko <mhocko@kernel.org>,
	Pavel Tatashin <pasha.tatashin@soleen.com>,
	Oscar Salvador <osalvador@suse.de>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	Michal Hocko <mhocko@suse.com>
Subject: Re: [PATCH v3 7/7] mm, page_alloc: disable pcplists during memory offline
Date: Thu, 12 Nov 2020 17:09:07 +0100	[thread overview]
Message-ID: <36fbd86a-dd1b-70eb-9372-7523b65d1e72@redhat.com> (raw)
In-Reply-To: <527480ef-ed72-e1c1-52a0-1c5b0113df45@suse.cz>

On 12.11.20 16:18, Vlastimil Babka wrote:
> On 11/11/20 6:58 PM, David Hildenbrand wrote:
>> On 11.11.20 10:28, Vlastimil Babka wrote:
>>> -		/*
>>> -		 * per-cpu pages are drained after start_isolate_page_range, but
>>> -		 * if there are still pages that are not free, make sure that we
>>> -		 * drain again, because when we isolated range we might have
>>> -		 * raced with another thread that was adding pages to pcp list.
>>> -		 *
>>> -		 * Forward progress should be still guaranteed because
>>> -		 * pages on the pcp list can only belong to MOVABLE_ZONE
>>> -		 * because has_unmovable_pages explicitly checks for
>>> -		 * PageBuddy on freed pages on other zones.
>>> -		 */
>>>    		ret = test_pages_isolated(start_pfn, end_pfn, MEMORY_OFFLINE);
>>> -		if (ret)
>>> -			drain_all_pages(zone);
>>> +
>>
>> Why two empty lines before the "} while (ret);" ? (unless I'm confused
>> while looking at this diff)
>>
> 
> No there's just a single emply line after "ret = test_pages_isolated..."
> Before there was none, which looked ok with the extra identation of the
> now-removed "drain_all_pages(zone);"
> 
>>> +void __zone_set_pageset_high_and_batch(struct zone *zone, unsigned long high,
>>> +		unsigned long batch)
>>> +{
>>> +	struct per_cpu_pageset *p;
>>> +	int cpu;
>>> +
>>> +	for_each_possible_cpu(cpu) {
>>> +		p = per_cpu_ptr(zone->pageset, cpu);
>>> +		pageset_update(&p->pcp, high, batch);
>>> +	}
>>> +}
>>> +
>>>    /*
>>>     * Calculate and set new high and batch values for all per-cpu pagesets of a
>>>     * zone, based on the zone's size and the percpu_pagelist_fraction sysctl.
>>> @@ -6315,8 +6338,6 @@ static void pageset_init(struct per_cpu_pageset *p)
>>>    static void zone_set_pageset_high_and_batch(struct zone *zone)
>>>    {
>>>    	unsigned long new_high, new_batch;
>>> -	struct per_cpu_pageset *p;
>>> -	int cpu;
>>>    
>>>    	if (percpu_pagelist_fraction) {
>>>    		new_high = zone_managed_pages(zone) / percpu_pagelist_fraction;
>>> @@ -6336,10 +6357,7 @@ static void zone_set_pageset_high_and_batch(struct zone *zone)
>>>    	zone->pageset_high = new_high;
>>>    	zone->pageset_batch = new_batch;
>>>    
>>> -	for_each_possible_cpu(cpu) {
>>> -		p = per_cpu_ptr(zone->pageset, cpu);
>>> -		pageset_update(&p->pcp, new_high, new_batch);
>>> -	}
>>> +	__zone_set_pageset_high_and_batch(zone, new_high, new_batch);
>>>    }
>>
>> These two hunks look like an unrelated cleanup, or am I missing something?
> 
> It's extracting part of functionality to __zone_set_pageset_high_and_batch()
> that's now called also from zone_pcp_enable() and zone_pcp_disable() - to only
> adjust the per-cpu zone->pageset values without the usual calculation.
> 
>> Thanks for looking into this!
> 
> Thanks for review. Here's updated version that adds more detailed comment about
> force_all_cpus parameter to __drain_all_pages() header, hopefully that clarifies
> your concerns.


LGTM!

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


-- 
Thanks,

David / dhildenb


  reply	other threads:[~2020-11-12 16:09 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-11  9:28 [PATCH v3 0/7] disable pcplists during memory offline Vlastimil Babka
2020-11-11  9:28 ` [PATCH v3 1/7] mm, page_alloc: clean up pageset high and batch update Vlastimil Babka
2020-11-11  9:55   ` Pankaj Gupta
2020-11-11  9:28 ` [PATCH v3 2/7] mm, page_alloc: calculate pageset high and batch once per zone Vlastimil Babka
2020-11-11 10:19   ` Pankaj Gupta
2020-11-11  9:28 ` [PATCH v3 3/7] mm, page_alloc: remove setup_pageset() Vlastimil Babka
2020-11-11 10:23   ` Pankaj Gupta
2020-11-11  9:28 ` [PATCH v3 4/7] mm, page_alloc: simplify pageset_update() Vlastimil Babka
2020-11-11  9:28 ` [PATCH v3 5/7] mm, page_alloc: cache pageset high and batch in struct zone Vlastimil Babka
2020-11-12 16:26   ` David Hildenbrand
2020-11-11  9:28 ` [PATCH v3 6/7] mm, page_alloc: move draining pcplists to page isolation users Vlastimil Babka
2020-11-11  9:28 ` [PATCH v3 7/7] mm, page_alloc: disable pcplists during memory offline Vlastimil Babka
2020-11-11 17:58   ` David Hildenbrand
2020-11-12 15:18     ` Vlastimil Babka
2020-11-12 16:09       ` David Hildenbrand [this message]
2020-11-11 17:59   ` David Hildenbrand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=36fbd86a-dd1b-70eb-9372-7523b65d1e72@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=mhocko@suse.com \
    --cc=osalvador@suse.de \
    --cc=pasha.tatashin@soleen.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).