Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp2076851pxa; Mon, 3 Aug 2020 06:59:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx/elnbRyDKsJ/dtm8I5qzhMlz50DgXcZF9dKgkS/wQQfRSN8pa/c9e3X76S/E3/ZCA0q47 X-Received: by 2002:a17:906:2e8d:: with SMTP id o13mr16672223eji.279.1596463174927; Mon, 03 Aug 2020 06:59:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596463174; cv=none; d=google.com; s=arc-20160816; b=TlIx32dzNtRFUeJSR8/m9KT1TUYHFL0gZkXIRRuXqC5oa6qUeEWyBj5O6IFOc+z/Xc jiW+XwFRuajmj+YHyKvxZ0XlkVsIOGW3oXEy/IdOxC4GU8Jkr9Oy1/PkXMYEMVAzIWau z6OcWR+SHrflHDMW4ZJUhZCBKsJHEarg6a0u5laapABZeduhGhYN4/qo0jU4yzg7v8Ni jK+Tz9dcfyiP/VjYW99Ely696YAm6WeRyx9X5WgqGGmsSHEul0Wwf3hYN7l2ickf3nCc sgpZ6xg+HNv1i0hTJgA3+k/ZtXBMTSo8rRWk3sy3o8kgn3I6ys7elE33t64R/Ssz+Qzu SMQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=NEBuqk7A36Rknd4Edu0Lx2aD6Ui+UePfrC/WBj4Fy5o=; b=DW7nWkwLBnpJO3cDZt8lFah/huuK4DJ8I7io5XxO0JInAAUBhBD9vylqNsg6f4L41P woJJezy9j/UN7RYXOdsMjCKtmgF1W/FXi5gytmth6yv2wW95BCwQ27VxGq0ihUuxJMwO UIhVtAFf5gr5cuAqawNPkS2MzHjzMI5g2tRO98sTCWx7jsdaQlEvWT1Sy4AQ8h4iPWCl IFiJCBX9EWyaRdGniNWk/xijHu6NYSFoSXrvEtPAF1mrmhlNcvOdquVO515d7x8Qs/IE rP+YRzFSiD9J+50N2FtbaF0NQ0vMqfr5z9bR3+HgPwPNFEDf1fUL2dAQYn3x+sOUTqjf yNlg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f2si10390599edw.385.2020.08.03.06.59.12; Mon, 03 Aug 2020 06:59:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728141AbgHCNzW (ORCPT + 99 others); Mon, 3 Aug 2020 09:55:22 -0400 Received: from mx2.suse.de ([195.135.220.15]:60912 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726676AbgHCNzW (ORCPT ); Mon, 3 Aug 2020 09:55:22 -0400 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 DA709B5B9; Mon, 3 Aug 2020 13:55:36 +0000 (UTC) Subject: Re: [PATCH] mm, memory_hotplug: update pcp lists everytime onlining a memory block To: Charan Teja Reddy , akpm@linux-foundation.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, vinmenon@codeaurora.org References: <1596372896-15336-1-git-send-email-charante@codeaurora.org> From: Vlastimil Babka Message-ID: Date: Mon, 3 Aug 2020 15:55:21 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <1596372896-15336-1-git-send-email-charante@codeaurora.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/2/20 2:54 PM, 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. > > Signed-off-by: Charan Teja Reddy Makes sense to me. Acked-by: Vlastimil Babka > --- > 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(); > >