From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.0 required=3.0 tests=INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1F401C433E0 for ; Tue, 16 Jun 2020 12:50:56 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DCB3F208D5 for ; Tue, 16 Jun 2020 12:50:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DCB3F208D5 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 448E46B00A5; Tue, 16 Jun 2020 08:50:55 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FA546B00A6; Tue, 16 Jun 2020 08:50:55 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2E89E6B00A7; Tue, 16 Jun 2020 08:50:55 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 131C46B00A5 for ; Tue, 16 Jun 2020 08:50:55 -0400 (EDT) Received: from smtpin24.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id AFC7C180AD80F for ; Tue, 16 Jun 2020 12:50:54 +0000 (UTC) X-FDA: 76935059628.24.twig68_00159fe26dff Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin24.hostedemail.com (Postfix) with ESMTP id 8C3AA1A4A7 for ; Tue, 16 Jun 2020 12:50:54 +0000 (UTC) X-HE-Tag: twig68_00159fe26dff X-Filterd-Recvd-Size: 5988 Received: from mail-ed1-f67.google.com (mail-ed1-f67.google.com [209.85.208.67]) by imf40.hostedemail.com (Postfix) with ESMTP for ; Tue, 16 Jun 2020 12:50:54 +0000 (UTC) Received: by mail-ed1-f67.google.com with SMTP id w7so14185879edt.1 for ; Tue, 16 Jun 2020 05:50:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=MHe1CSRo+cFsbAyB9G6KcYrIV0y8O1vCQU197CVP04g=; b=aoPkyDfifdAOLlDW7Jv/bjOxkEL7H8oSJz0qQvemYNPxX8HpfxKWlvYzXZH1NlAS7Y A+NzHADEaPH9LS1r9x75rPXuPBQpTVSbSCMDz9vhOLZ7icHFytyNoiVaai+RNbuULE+V h66EgEeXroRRgzUvbK1OTT8pMNktLcsfwx+cxaIVJkz8MCrvztIa+UidAWtJo7/cHEJK GOhm/gnYrfKZVjlzqkebVQ9B6HTw7GMn84NhYY0jjLk1OzzT2OFBV4tgLX7HhfnYiO3l 8xfS9Y2RHk87K+hdQm4IstfxeDsf7VkuE+DvJB9vJhHkIS/u+Dt8ZhLB7lboqT63x+0D 6gxQ== X-Gm-Message-State: AOAM533RCNFRO+wXXhvMQHCtKtUobWm4uFcDYBbD5y7D1OJU2snyEfiA fSfItr17K493BjIh344fcx4= X-Google-Smtp-Source: ABdhPJxI7jCJkiT5VlYVvpsML9c32Ni2o1T5DMST3i+m0DGsAiF5WPIZcJ6rU+hL47+rYN7vV4MgSg== X-Received: by 2002:aa7:c609:: with SMTP id h9mr2273544edq.155.1592311853181; Tue, 16 Jun 2020 05:50:53 -0700 (PDT) Received: from localhost (ip-37-188-174-201.eurotel.cz. [37.188.174.201]) by smtp.gmail.com with ESMTPSA id s2sm2904127edu.39.2020.06.16.05.50.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jun 2020 05:50:52 -0700 (PDT) Date: Tue, 16 Jun 2020 14:50:51 +0200 From: Michal Hocko To: David Hildenbrand Cc: linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Alexander Duyck , Dan Williams , Dave Hansen , Kees Cook , Mel Gorman Subject: Re: [PATCH v1 2/3] mm/memory_hotplug: don't shuffle complete zone when onlining memory Message-ID: <20200616125051.GH9499@dhcp22.suse.cz> References: <20200616115213.13109-1-david@redhat.com> <20200616115213.13109-3-david@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200616115213.13109-3-david@redhat.com> X-Rspamd-Queue-Id: 8C3AA1A4A7 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam04 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 > Cc: Alexander Duyck > Cc: Dan Williams > Cc: Michal Hocko > Cc: Dave Hansen > Cc: Kees Cook > Cc: Mel Gorman > Signed-off-by: David Hildenbrand Acked-by: Michal Hocko > --- > 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 > > #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