Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1383670pxa; Sun, 2 Aug 2020 05:58:49 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyiZF7Q++J2dR9Dsdys+0+A7P1/NAP6ohrGw3KpV8SxReMx79jlF2l7FIPc8kW2EATN7jBe X-Received: by 2002:a05:6402:1591:: with SMTP id c17mr11482652edv.111.1596373128914; Sun, 02 Aug 2020 05:58:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596373128; cv=none; d=google.com; s=arc-20160816; b=EzutbIn+ndCauac7AaZ2ZQk9bZmw77othol5VWM/GuW+aMOz4ZBgmz269RhAWB0nVS 1V4oL3S05t0ruq7El5fqmu6RUCCU9YqL+dNT542Q8sBZBYHG/7ParDTBQ7h2FWfo1nLV t2KH+Mi6cSsUcXHnGrHtPepr4O5TS+iuBH9e3DafbfdibtE1IBlSIczZtdrwPMW6r9rN ddA4tQGRuh2GYKZvII5Y3XClgddiXgsZezXNZeiI1W2lxX6Y+lhqQOM0pCIEK7Nsub5s aV73DQci/Evn+w09LmJVE3d72G4mpjGFS1eku+cTmezrIJ72gJ3O0nrijlV9bRXEuYFm Zx6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dmarc-filter:dkim-signature; bh=vqFI7c3dNZv0B1DGOiIOgm5q/aIuLzWPrYQcR71+t7k=; b=CDkpx3BMTp91JXSmFEUOINCtxmlhmTS4ioYy4hC6DSNgX9BawWR0YO9ATFfSk++Vtp qsi8e48YDgGDz9vRm65F+PtAe6bItIJptt+49oSZyFUsLglpuiUT8VWQV48K2P2s0zzE cToDhc6gT8ZpUXjMnpsfCurDbrASJC05vp/fwQeK+/DbqeRl3HEtNQ9NuG3yxDpaLXeY hMk2xHI3ghOjapd7pfYsGfyFt+C+v01K3JvZRqMcBaK6F9ZHCAnCPavB0er0rvWFyi/6 oVtl4y5uHEQ6do7pnjsWN0CuRAzSr5HAhsvNXHubn3Dlh0wojlzPrSVkaTgA/d/WiHMl znCw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=NG0Rp+3+; 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 ce15si9429193edb.201.2020.08.02.05.58.24; Sun, 02 Aug 2020 05:58:48 -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; dkim=fail header.i=@mg.codeaurora.org header.s=smtp header.b=NG0Rp+3+; 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 S1728254AbgHBMz5 (ORCPT + 99 others); Sun, 2 Aug 2020 08:55:57 -0400 Received: from m43-7.mailgun.net ([69.72.43.7]:12412 "EHLO m43-7.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728020AbgHBMz5 (ORCPT ); Sun, 2 Aug 2020 08:55:57 -0400 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1596372956; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=vqFI7c3dNZv0B1DGOiIOgm5q/aIuLzWPrYQcR71+t7k=; b=NG0Rp+3+hvOHPH3U//5xCRtxNHu77sXyyHQFTyBaWDEVTMi2aQLSUdaZSs0QSyBOCzanx3Ch YLUE007YtF5fj+pGWu5ZoybZ9NHJLBKlic91siiAU3852DCeBjhxqTXlnCCd9F98YqXh4gUa KhGJlbnVfBvwr1ub5wwzfkSDNfo= X-Mailgun-Sending-Ip: 69.72.43.7 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n01.prod.us-west-2.postgun.com with SMTP id 5f26b7d8eb556d49a6103267 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Sun, 02 Aug 2020 12:55:52 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 76D57C433CB; Sun, 2 Aug 2020 12:55:52 +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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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