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 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id DCC9FC3DA7F for ; Mon, 12 Aug 2024 04:37:58 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 61A156B008A; Mon, 12 Aug 2024 00:37:58 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5C9EE6B008C; Mon, 12 Aug 2024 00:37:58 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4B9AA6B0092; Mon, 12 Aug 2024 00:37:58 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 2D0EA6B008A for ; Mon, 12 Aug 2024 00:37:58 -0400 (EDT) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id B9562A0376 for ; Mon, 12 Aug 2024 04:37:57 +0000 (UTC) X-FDA: 82442335794.01.8E6FCA0 Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by imf15.hostedemail.com (Postfix) with ESMTP id 02609A001A for ; Mon, 12 Aug 2024 04:37:55 +0000 (UTC) Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=GQAQP51j; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf15.hostedemail.com: domain of ssengar@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=ssengar@linux.microsoft.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723437425; a=rsa-sha256; cv=none; b=juezWM9CklrKRhZN+x8TmVNi/PwvZRhhg6ktDHNrMDLfR6BtSEt157kGa1GfOyscHr+vag 73MeuGMO12+LqyZg/FTL/x833HMPfzSL6RrjS2pzVkRSz20GYyRPmOeVwG2DVNjAnwzZ/k j5YwUcAfu2mTyG0fFdA3Ub4nGRcT4QA= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux.microsoft.com header.s=default header.b=GQAQP51j; dmarc=pass (policy=none) header.from=linux.microsoft.com; spf=pass (imf15.hostedemail.com: domain of ssengar@linux.microsoft.com designates 13.77.154.182 as permitted sender) smtp.mailfrom=ssengar@linux.microsoft.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723437425; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=DCVsmLc/y5IKUr9kjksb3wZsyvxdPdU6UCqCMlrYuxc=; b=eyyx81ycA2tmXyvrQkZyrcnpW7MUIGWiTgq/TKt2AjdHpEDzdylFjSroUl/5XOy4uC7tst pNj2EsaoNIjvS+ukYb56qZosLt7vVc3uCRGIAmTDVRsb8u2pQ6nzvU7+8otuSJw2/NRx8H n2NHWyjJVpA58jbjEliDlaS+Hnprmhk= Received: by linux.microsoft.com (Postfix, from userid 1127) id 91D3920B7165; Sun, 11 Aug 2024 21:37:54 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 91D3920B7165 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1723437474; bh=DCVsmLc/y5IKUr9kjksb3wZsyvxdPdU6UCqCMlrYuxc=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=GQAQP51jzsSrUS00Io0tPvi/0Eu0iA5FpsPmMtqDGZpQ3I1RxYjbrTop54aIgagJw hQkt82qGJbneauj6jmtDNcfB6Zf95bdVr8ym6qtg9EhNkwi++hZkxGNciS91k5GvG4 f2xS3gSwzEZnHTTLGhNcEZnk1jm3wsKJ0W0bLV6M= Date: Sun, 11 Aug 2024 21:37:54 -0700 From: Saurabh Singh Sengar To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, ssengar@microsoft.com, wei.liu@kernel.org Subject: Re: [PATCH] mm/vmstat: Defer the refresh_zone_stat_thresholds after all CPUs bringup Message-ID: <20240812043754.GA7619@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1720169301-21002-1-git-send-email-ssengar@linux.microsoft.com> <20240705135911.4a6e38379ae95c3fc6bbe7e2@linux-foundation.org> <20240709045750.GA32083@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <20240810000404.b08cb06ebbba7e0de9bb8c72@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20240810000404.b08cb06ebbba7e0de9bb8c72@linux-foundation.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Rspamd-Queue-Id: 02609A001A X-Rspam-User: X-Rspamd-Server: rspam05 X-Stat-Signature: syrjsztwewn1cfmw5uq451bn4hp5f7gk X-HE-Tag: 1723437475-260854 X-HE-Meta: U2FsdGVkX185RbvfJ89ABWcQcjGGmTor9iLOGCTjWdyzjY6zqfT0nV2Up82ljqkDpeKqe/G0iXJRI+oPFM/lsfgd2DAxUECWzNMnSGea37eGj3V7U2fwKT+TwWYCURSa9Tg4ORKlcq27TIXG3IClK2ztc/vkr0tOOeIrD+G9ZqKYzdcHTPYUn3dJITyYk7xk1m1KNiLqTanfk4AWYVvUIXQm1KP2/6sfIVHSRq1O0/LFxqo/fy82ewAADCjR1Lf9gq89Ne/b7XryqIO8uDjKQ5RV7+e706I/HseHajnVVzytVvjBawyvRogWBohQbvUs/u2t4X7r/M6TUEBo9bsi4QqDBP8qhvtvIBZdRJ2Q3hh0bKWYvY9fNvdazziOWpaUDcaMciERb1SAc/Tf7PdnGmf52IuvvupKw3N086riap7Zf5WJXpdEYV5sqH3G0JRXmgWrXMm2bOHYB26k9axwO1g4I7GU+6xByS88oM3IVJmT1aXvPIG/8blypnDir4FrSlXV5kQnptT4DV6jr7U1rYh/JgJ07NN0/u4nwfMWo0iP4lOFdhrxrEallNsqQxljU2m3E7gyl/C+hOGBbSD40cISZdjmwIT0KIjwGmpWfSw7uhJMomYx/4EyOBtBH9Hpn8CjkcSzpYkhi+VAVlwr1qxmrcOl1lQSfFJF+7ZeY5Y3goeCQSq+RkjB5Psg7WZylsdjnO+IF63+vNxUi4b2cunczwS9UeYbdLqFCLqt6aOZsD1BRqL/GqNfFOCRkMgtHsEDFlBZPteaPUH2uOQeu3BfAhK+POaZhCIkm+xMmJeVEizI1f8pK5yMWsD0lm/6AokJDJZyKpV5ZiwICkfzlcftcEwEX1m2nxSJdzKVCsk9LE05nk5guTj1nmF0MoI8T9+GHh0lqFXdCZzIrkwtsa+OAl7CCthuQVNrhFBUO5dZfokvYXw0BiyU0wtcucjThaCSYAaA7bi9c2MU5+0 T0EDHj1q EL0lgH0DLcAzEVCrXtTpR/IgbWGlmfcKaqvSF34+WGvwRm2z+y9QE983UYSJ1fIIgX2lD0bDE/L5iGoh5ftStNuJ93R05EV7PDnPy0nTCqLDKzpaTMKKloYn0wy+PfbtzXPZ0n9jgyxC5GTX/8HugfTPvP98fKB/c/6NXHZEgVOVCf558fHdSY1UtuFCThhxRNfuS/yyAyIOYB6bxywE/z1PvWUY55XULGo87VMuA9dNrX0Zn2iBQu+eZdA== 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: List-Subscribe: List-Unsubscribe: On Sat, Aug 10, 2024 at 12:04:04AM -0700, Andrew Morton wrote: > On Mon, 8 Jul 2024 21:57:50 -0700 Saurabh Singh Sengar wrote: > > > > > No NUMA = 1024*2*1*512 = 1,048,576 : Here refresh_zone_stat_thresholds > > > > takes around 224 ms total for all the CPUs in the system under test. > > > > 16 NUMA = 1024*2*16*512 = 16,777,216 : Here refresh_zone_stat_thresholds > > > > takes around 4.5 seconds total for all the CPUs in the system under test. > > > > > > Did you measure the overall before-and-after times? IOW, how much of > > > that 4.5s do we reclaim? > > > > This entire gain is accounted in over all boot processi time. Most of the Linux > > kernel boot process is sequential and doesn't take advantage of SMP. > > Again, if you were able to measure 4.5s without the patch then you are > able to measure how long this delay is with the patch. Please share > that number. If I understand your question correctly, you're asking about the total time taken by refresh_zone_stat_threshold for all its executions before and after the fix. Without this patch, refresh_zone_stat_threshold was being called 1024 times. After applying the patch, it is called only once, which is same as the last iteration of the earlier 1024 calls. Further testing with this patch, I observed a 4.5-second improvement in the overall boot timing due to this fix, which is same as the total time taken by refresh_zone_stat_thresholds without thie patch, leading me to reasonably conclude that refresh_zone_stat_threshold now takes a negligible amount of time (likely just a few milliseconds). If you would like precise timing details on single refresh_zone_stat_threshold execution, please let me know, and I can conduct the tests again and provide the results in few days. - Saurabh