From patchwork Sun Aug 2 12:54:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Charan Teja Kalla X-Patchwork-Id: 11696389 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DCE9722 for ; Sun, 2 Aug 2020 12:56:12 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 2B3A3207DF for ; Sun, 2 Aug 2020 12:56:12 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=mg.codeaurora.org header.i=@mg.codeaurora.org header.b="lRY831aB" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2B3A3207DF Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 084978D00B2; Sun, 2 Aug 2020 08:56:11 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 00DD08D00AA; Sun, 2 Aug 2020 08:56:10 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E17858D00B2; Sun, 2 Aug 2020 08:56:10 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0228.hostedemail.com [216.40.44.228]) by kanga.kvack.org (Postfix) with ESMTP id C4FF98D00AA for ; Sun, 2 Aug 2020 08:56:10 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 60AC48248047 for ; Sun, 2 Aug 2020 12:56:10 +0000 (UTC) X-FDA: 77105626500.05.house24_010d58d26f95 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id 3D00A18016850 for ; Sun, 2 Aug 2020 12:56:10 +0000 (UTC) X-Spam-Summary: 1,0,0,59ecb61c415682e2,d41d8cd98f00b204,bounce+d06763.be9e4a-linux-mm=kvack.org@mg.codeaurora.org,,RULES_HIT:41:355:379:541:800:960:966:973:988:989:1260:1345:1437:1534:1541:1711:1730:1747:1777:1792:2194:2196:2199:2200:2393:2540:2559:2562:2693:2895:3138:3139:3140:3141:3142:3352:3865:3866:3867:3870:3871:3872:4321:4385:5007:6119:6120:6261:6653:7901:7903:8603:9010:10004:11026:11218:11232:11658:11914:12297:12438:12517:12519:12555:13069:13156:13161:13228:13229:13311:13357:14040:14096:14181:14384:14394:14721:21080:21451:21627:21972:22119:30012:30054:30070,0,RBL:104.130.122.29:@mg.codeaurora.org:.lbl8.mailshell.net-62.14.0.100 64.201.201.201;04y86byeje8ebaaokzchcnmruouszyc5xzx31ygw8pgjxnrfsw8kfjr4bj9gu9r.c7igtu9zze1p3it4em5tr6hpn66jmgbjpuhy3edp4ft6e6ffjzckngkdr6c89gm.y-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:23,LUA_SUMMARY:none X-HE-Tag: house24_010d58d26f95 X-Filterd-Recvd-Size: 3894 Received: from mail29.static.mailgun.info (mail29.static.mailgun.info [104.130.122.29]) by imf29.hostedemail.com (Postfix) with ESMTP for ; Sun, 2 Aug 2020 12:56:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596372969; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=vqFI7c3dNZv0B1DGOiIOgm5q/aIuLzWPrYQcR71+t7k=; b=lRY831aBoeEIleOuS46Ub9wPI3PfZ2/Qsw2F5bdtB725F2GqD8YneGDNfUHmsg67gNVy2jWF UaFuwWx+zWPS6RHIUn7esQf4WjhE3QS6JIdFmCQY2cMEbjcXZAueAMA0S0F4yJHofCztnUcw JRDQLtP+AIuOmBMRs2ELcxLo8FM= X-Mailgun-Sending-Ip: 104.130.122.29 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n10.prod.us-west-2.postgun.com with SMTP id 5f26b7d9eb556d49a6103336 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 02 Aug 2020 12:55:53 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id B13ADC433CA; Sun, 2 Aug 2020 12:55:53 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=2.0 tests=ALL_TRUSTED,SPF_NONE autolearn=unavailable autolearn_force=no version=3.4.0 Received: from charante-linux.qualcomm.com (unknown [202.46.22.19]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: charante) by smtp.codeaurora.org (Postfix) with ESMTPSA id 4270AC433C6; Sun, 2 Aug 2020 12:55:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 4270AC433C6 Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=none smtp.mailfrom=charante@codeaurora.org From: Charan Teja Reddy To: akpm@linux-foundation.org, linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, vinmenon@codeaurora.org, Charan Teja Reddy Subject: [PATCH] mm, memory_hotplug: update pcp lists everytime onlining a memory block Date: Sun, 2 Aug 2020 18:24:56 +0530 Message-Id: <1596372896-15336-1-git-send-email-charante@codeaurora.org> X-Mailer: git-send-email 1.9.1 X-Rspamd-Queue-Id: 3D00A18016850 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: 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 Reviewed-by: David Hildenbrand Acked-by: Vlastimil Babka Acked-by: Michal Hocko --- 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();