From: Vlastimil Babka <firstname.lastname@example.org> To: email@example.com Cc: firstname.lastname@example.org, Michal Hocko <email@example.com>, Pavel Tatashin <firstname.lastname@example.org>, David Hildenbrand <email@example.com>, Oscar Salvador <firstname.lastname@example.org>, Joonsoo Kim <email@example.com>, Vlastimil Babka <firstname.lastname@example.org> Subject: [PATCH v2 0/7] disable pcplists during memory offline Date: Thu, 8 Oct 2020 13:41:54 +0200 [thread overview] Message-ID: <email@example.com> (raw) Changes since v1 : - add acks/reviews (thanks David and Michal) - drop "mm, page_alloc: make per_cpu_pageset accessible only after init" as that's orthogonal and needs more consideration - squash "mm, page_alloc: drain all pcplists during memory offline" into the last patch, and move new zone_pcp_* functions into mm/page_alloc. As such, the new 'force all cpus' param of __drain_all_pages() is never exported outside page_alloc.c so I didn't add a new wrapper function to hide the bool - keep pcp_batch_high_lock a mutex as offline_pages is synchronized anyway, as suggested by Michal. Thus we don't need atomic variable and sync around it, and patch is much smaller. If alloc_contic_range() wants to use the new functionality and keep parallelism, we can add that on top. As per the discussions   this is an attempt to implement David's suggestion that page isolation should disable pcplists to avoid races with page freeing in progress. This is done without extra checks in fast paths, as explained in Patch 9. The repeated draining done by  is then no longer needed. Previous version (RFC) is at . The RFC tried to hide pcplists disabling/enabling into page isolation, but it wasn't completely possible, as memory offline does not unisolation. Michal suggested an explicit API in  so that's the current implementation and it seems indeed nicer. Once we accept that page isolation users need to do explicit actions around it depending on the needed guarantees, we can also IMHO accept that the current pcplist draining can be also done by the callers, which is more effective. After all, there are only two users of page isolation. So patch 6 does effectively the same thing as Pavel proposed in , and patch 7 implement stronger guarantees only for memory offline. If CMA decides to opt-in to the stronger guarantee, it can be added later. Patches 1-5 are preparatory cleanups for pcplist disabling. Patchset was briefly tested in QEMU so that memory online/offline works, but I haven't done a stress test that would prove the race fixed by  is eliminated. Note that patch 7 could be avoided if we instead adjusted page freeing in shown in , but I believe the current implementation of disabling pcplists is not too much complex, so I would prefer this instead of adding new checks and longer irq-disabled section into page freeing hotpaths.  https://firstname.lastname@example.org/  https://email@example.com/  https://firstname.lastname@example.org/  https://lore.kernel.org/linux-mm/20200909113647.GG7348@dhcp22.suse.cz/  https://email@example.com/  https://firstname.lastname@example.org/  https://email@example.com/ Vlastimil Babka (7): mm, page_alloc: clean up pageset high and batch update mm, page_alloc: calculate pageset high and batch once per zone mm, page_alloc: remove setup_pageset() mm, page_alloc: simplify pageset_update() mm, page_alloc: cache pageset high and batch in struct zone mm, page_alloc: move draining pcplists to page isolation users mm, page_alloc: disable pcplists during memory offline include/linux/mmzone.h | 6 ++ mm/internal.h | 2 + mm/memory_hotplug.c | 27 +++--- mm/page_alloc.c | 198 ++++++++++++++++++++++++----------------- mm/page_isolation.c | 10 +-- 5 files changed, 143 insertions(+), 100 deletions(-) -- 2.28.0
next reply other threads:[~2020-10-08 11:42 UTC|newest] Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-10-08 11:41 Vlastimil Babka [this message] 2020-10-08 11:41 ` [PATCH v2 1/7] mm, page_alloc: clean up pageset high and batch update Vlastimil Babka 2020-10-25 14:17 ` Mike Rapoport 2020-10-08 11:41 ` [PATCH v2 2/7] mm, page_alloc: calculate pageset high and batch once per zone Vlastimil Babka 2020-10-08 11:41 ` [PATCH v2 3/7] mm, page_alloc: remove setup_pageset() Vlastimil Babka 2020-10-08 12:23 ` Michal Hocko 2020-10-08 12:56 ` Vlastimil Babka 2020-10-08 13:03 ` Michal Hocko 2020-10-22 12:34 ` Oscar Salvador 2020-10-08 11:41 ` [PATCH v2 4/7] mm, page_alloc: simplify pageset_update() Vlastimil Babka 2020-10-22 12:39 ` Oscar Salvador 2020-10-08 11:41 ` [PATCH v2 5/7] mm, page_alloc: cache pageset high and batch in struct zone Vlastimil Babka 2020-10-08 12:31 ` Michal Hocko 2020-10-08 17:55 ` Vlastimil Babka 2020-10-22 12:42 ` Oscar Salvador 2020-10-08 11:42 ` [PATCH v2 6/7] mm, page_alloc: move draining pcplists to page isolation users Vlastimil Babka 2020-10-22 12:44 ` Oscar Salvador 2020-10-08 11:42 ` [PATCH v2 7/7] mm, page_alloc: disable pcplists during memory offline Vlastimil Babka 2020-10-08 12:45 ` Michal Hocko 2020-10-08 17:46 ` Vlastimil Babka 2020-10-22 12:52 ` Oscar Salvador
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 \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: [PATCH v2 0/7] disable pcplists during memory offline' \ /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
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).