From: Michal Hocko <mhocko@kernel.org>
To: David Hildenbrand <david@redhat.com>
Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org,
Andrew Morton <akpm@linux-foundation.org>,
Alexander Duyck <alexander.h.duyck@linux.intel.com>,
Dan Williams <dan.j.williams@intel.com>,
Dave Hansen <dave.hansen@linux.intel.com>,
Kees Cook <keescook@chromium.org>,
Mel Gorman <mgorman@techsingularity.net>
Subject: Re: [PATCH v1 2/3] mm/memory_hotplug: don't shuffle complete zone when onlining memory
Date: Tue, 16 Jun 2020 14:50:51 +0200 [thread overview]
Message-ID: <20200616125051.GH9499@dhcp22.suse.cz> (raw)
In-Reply-To: <20200616115213.13109-3-david@redhat.com>
On Tue 16-06-20 13:52:12, David Hildenbrand wrote:
> Commit e900a918b098 ("mm: shuffle initial free memory to improve
> memory-side-cache utilization") introduced shuffling of free pages
> during system boot and whenever we online memory blocks.
>
> However, whenever we online memory blocks, all pages that will be
> exposed to the buddy end up getting freed via __free_one_page(). In the
> general case, we free these pages in MAX_ORDER - 1 chunks, which
> corresponds to the shuffle order.
>
> Inside __free_one_page(), we will already shuffle the newly onlined pages
> using "to_tail = shuffle_pick_tail();". Drop explicit zone shuffling on
> memory hotplug.
>
> Note: When hotplugging a DIMM, each memory block (e.g., 128MB .. 2G on
> x86-64) will get onlined individually, resulting in a shuffle_zone() for
> every memory block getting onlined.
>
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: Alexander Duyck <alexander.h.duyck@linux.intel.com>
> Cc: Dan Williams <dan.j.williams@intel.com>
> Cc: Michal Hocko <mhocko@suse.com>
> Cc: Dave Hansen <dave.hansen@linux.intel.com>
> Cc: Kees Cook <keescook@chromium.org>
> Cc: Mel Gorman <mgorman@techsingularity.net>
> Signed-off-by: David Hildenbrand <david@redhat.com>
Acked-by: Michal Hocko <mhocko@suse.com>
> ---
> mm/memory_hotplug.c | 3 ---
> mm/shuffle.c | 2 +-
> mm/shuffle.h | 12 ------------
> 3 files changed, 1 insertion(+), 16 deletions(-)
>
> diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c
> index 9b34e03e730a4..845a517649c71 100644
> --- a/mm/memory_hotplug.c
> +++ b/mm/memory_hotplug.c
> @@ -40,7 +40,6 @@
> #include <asm/tlbflush.h>
>
> #include "internal.h"
> -#include "shuffle.h"
>
> /*
> * online_page_callback contains pointer to current page onlining function.
> @@ -822,8 +821,6 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages,
> zone->zone_pgdat->node_present_pages += onlined_pages;
> pgdat_resize_unlock(zone->zone_pgdat, &flags);
>
> - shuffle_zone(zone);
> -
> node_states_set_node(nid, &arg);
> if (need_zonelists_rebuild)
> build_all_zonelists(NULL);
> diff --git a/mm/shuffle.c b/mm/shuffle.c
> index dd13ab851b3ee..609c26aa57db0 100644
> --- a/mm/shuffle.c
> +++ b/mm/shuffle.c
> @@ -180,7 +180,7 @@ void __meminit __shuffle_free_memory(pg_data_t *pgdat)
> struct zone *z;
>
> for (z = pgdat->node_zones; z < pgdat->node_zones + MAX_NR_ZONES; z++)
> - shuffle_zone(z);
> + __shuffle_zone(z);
> }
>
> bool shuffle_pick_tail(void)
> diff --git a/mm/shuffle.h b/mm/shuffle.h
> index 4d79f03b6658f..657e2b9ec38dd 100644
> --- a/mm/shuffle.h
> +++ b/mm/shuffle.h
> @@ -30,14 +30,6 @@ static inline void shuffle_free_memory(pg_data_t *pgdat)
> __shuffle_free_memory(pgdat);
> }
>
> -extern void __shuffle_zone(struct zone *z);
> -static inline void shuffle_zone(struct zone *z)
> -{
> - if (!static_branch_unlikely(&page_alloc_shuffle_key))
> - return;
> - __shuffle_zone(z);
> -}
> -
> static inline bool is_shuffle_order(int order)
> {
> if (!static_branch_unlikely(&page_alloc_shuffle_key))
> @@ -54,10 +46,6 @@ static inline void shuffle_free_memory(pg_data_t *pgdat)
> {
> }
>
> -static inline void shuffle_zone(struct zone *z)
> -{
> -}
> -
> static inline void page_alloc_shuffle(enum mm_shuffle_ctl ctl)
> {
> }
> --
> 2.26.2
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2020-06-16 12:50 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-06-16 11:52 [PATCH v1 0/3] mm/shuffle: fix and cleanips David Hildenbrand
2020-06-16 11:52 ` [PATCH v1 1/3] mm/shuffle: don't move pages between zones and don't read garbage memmaps David Hildenbrand
2020-06-16 12:43 ` Michal Hocko
2020-06-16 11:52 ` [PATCH v1 2/3] mm/memory_hotplug: don't shuffle complete zone when onlining memory David Hildenbrand
2020-06-16 12:50 ` Michal Hocko [this message]
2020-06-16 17:00 ` Dan Williams
2020-06-16 17:03 ` Dan Williams
2020-06-16 18:24 ` David Hildenbrand
2020-06-17 6:48 ` Michal Hocko
2020-06-17 18:13 ` Dan Williams
2020-06-16 11:52 ` [PATCH v1 3/3] mm/shuffle: remove dynamic reconfiguration David Hildenbrand
2020-06-16 12:41 ` Michal Hocko
2020-06-16 13:45 ` David Hildenbrand
2020-06-16 16:59 ` Dan Williams
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=20200616125051.GH9499@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=alexander.h.duyck@linux.intel.com \
--cc=dan.j.williams@intel.com \
--cc=dave.hansen@linux.intel.com \
--cc=david@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@techsingularity.net \
/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