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=-10.0 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 6CD5CC433DF for ; Mon, 3 Aug 2020 15:46:26 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 3CF6720781 for ; Mon, 3 Aug 2020 15:46:26 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3CF6720781 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D418E8D010D; Mon, 3 Aug 2020 11:46:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CCACE8D0081; Mon, 3 Aug 2020 11:46:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BBAEC8D010D; Mon, 3 Aug 2020 11:46:26 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0063.hostedemail.com [216.40.44.63]) by kanga.kvack.org (Postfix) with ESMTP id A16EF8D0081 for ; Mon, 3 Aug 2020 11:46:26 -0400 (EDT) Received: from smtpin16.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 5E01B3628 for ; Mon, 3 Aug 2020 15:46:26 +0000 (UTC) X-FDA: 77109684372.16.tiger83_02095f126f9e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin16.hostedemail.com (Postfix) with ESMTP id 07D59100E6903 for ; Mon, 3 Aug 2020 15:46:25 +0000 (UTC) X-HE-Tag: tiger83_02095f126f9e X-Filterd-Recvd-Size: 2822 Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by imf09.hostedemail.com (Postfix) with ESMTP for ; Mon, 3 Aug 2020 15:46:25 +0000 (UTC) X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.221.27]) by mx2.suse.de (Postfix) with ESMTP id BBB63AF21; Mon, 3 Aug 2020 15:46:39 +0000 (UTC) Date: Mon, 3 Aug 2020 17:46:23 +0200 From: Michal Hocko To: Charan Teja Reddy Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, vinmenon@codeaurora.org Subject: Re: [PATCH] mm, memory_hotplug: update pcp lists everytime onlining a memory block Message-ID: <20200803154623.GX5174@dhcp22.suse.cz> References: <1596372896-15336-1-git-send-email-charante@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1596372896-15336-1-git-send-email-charante@codeaurora.org> X-Rspamd-Queue-Id: 07D59100E6903 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Sun 02-08-20 18:24:56, Charan Teja Reddy wrote: > When onlining a first memory block in a zone, pcp lists are not updated > thus pcp struct will have the default setting of ->high = 0,->batch = 1. > This means till the second memory block in a zone(if it have) is onlined > the pcp lists of this zone will not contain any pages because pcp's > ->count is always greater than ->high thus free_pcppages_bulk() is > called to free batch size(=1) pages every time system wants to add a > page to the pcp list through free_unref_page(). To put this in a word, > system is not using benefits offered by the pcp lists when there is a > single onlineable memory block in a zone. Correct this by always > updating the pcp lists when memory block is onlined. Yes this seems like an ancient bug Fixes: 1f522509c77a ("mem-hotplug: avoid multiple zones sharing same boot strapping boot_pageset") Just nobody has noticed because a single block memory zone is really rare. > Signed-off-by: Charan Teja Reddy Acked-by: Michal Hocko Thanks > --- > mm/memory_hotplug.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mm/memory_hotplug.c b/mm/memory_hotplug.c > index dcdf327..7f62d69 100644 > --- a/mm/memory_hotplug.c > +++ b/mm/memory_hotplug.c > @@ -854,8 +854,7 @@ int __ref online_pages(unsigned long pfn, unsigned long nr_pages, > node_states_set_node(nid, &arg); > if (need_zonelists_rebuild) > build_all_zonelists(NULL); > - else > - zone_pcp_update(zone); > + zone_pcp_update(zone); > > init_per_zone_wmark_min(); > > -- > QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a > member of the Code Aurora Forum, hosted by The Linux Foundation > -- Michal Hocko SUSE Labs