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 A86E4C5B557 for ; Wed, 28 Aug 2024 15:44:00 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3B8E96B007B; Wed, 28 Aug 2024 11:44:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 369076B0082; Wed, 28 Aug 2024 11:44:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 230B36B0083; Wed, 28 Aug 2024 11:44:00 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 044FC6B007B for ; Wed, 28 Aug 2024 11:43:59 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 6D55040141 for ; Wed, 28 Aug 2024 15:43:59 +0000 (UTC) X-FDA: 82502074998.13.E53C3F2 Received: from gentwo.org (gentwo.org [62.72.0.81]) by imf03.hostedemail.com (Postfix) with ESMTP id AB1642001F for ; Wed, 28 Aug 2024 15:43:56 +0000 (UTC) Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=gentwo.org header.s=default header.b=bEcO7Uxx; spf=pass (imf03.hostedemail.com: domain of cl@gentwo.org designates 62.72.0.81 as permitted sender) smtp.mailfrom=cl@gentwo.org; dmarc=pass (policy=reject) header.from=gentwo.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1724859750; 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=fas9e//8YUysjJ6QTlLOuy5QRUkz4Jw/f5nnHeYYPSI=; b=F7MP2FYqxPAa3GLiYDrrvAbyjzrEekIj13waMVmgVpHleuF54rPaja334hWeLm7p//Evff 0m4uFhseqrWy2nLjjUiyRxVHcNMqAMWbuUfN54ZzyLTPdJ+aGE56t0smLsdc8XfK5EHdKg lhaMDkXIM3olqufJ3iAJCJfQhs5iQWY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1724859750; a=rsa-sha256; cv=none; b=IfZ4nTjE9itPiZi6vn7mA8lRW9Dlq2mNpCUR905MigmiAvLC83JHuaS8sIBvBXgBMG79Yn b9kJfYAqEi2KQpFIOSRO/0yhWJ55v4hFEBHZ7vBGkCUgZRWITkyfU5gXLgUAe7b1fjDa/v mIqXt4rcQj6saANDhPIHoUfFqvQ5Sio= ARC-Authentication-Results: i=1; imf03.hostedemail.com; dkim=pass header.d=gentwo.org header.s=default header.b=bEcO7Uxx; spf=pass (imf03.hostedemail.com: domain of cl@gentwo.org designates 62.72.0.81 as permitted sender) smtp.mailfrom=cl@gentwo.org; dmarc=pass (policy=reject) header.from=gentwo.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gentwo.org; s=default; t=1724859835; bh=FHYVY+k7BssHtfBfIYbDq+uSTsGT0+DH65PfsZIPS2I=; h=Date:From:To:cc:Subject:In-Reply-To:References:From; b=bEcO7Uxx1CMcFxUAXHbV9TEQzQDfq2Dxi6iwfi4T2n+wSU3+q2glpG+5Fw9sYnI6q Lv3XqiuGtcHnLzRKTD7aQG0u8mO6czpZm+KA61v1JztZQd5cdIAin0C/4vwJOYZURO BakTh/rpqI2GCkQhjBOu0qceS74O1pNAbfMYPFWE= Received: by gentwo.org (Postfix, from userid 1003) id 8084B404BD; Wed, 28 Aug 2024 08:43:55 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 7F76C404BA; Wed, 28 Aug 2024 08:43:55 -0700 (PDT) Date: Wed, 28 Aug 2024 08:43:55 -0700 (PDT) From: "Christoph Lameter (Ampere)" To: Saurabh Singh Sengar cc: Andrew Morton , 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 In-Reply-To: <20240828053737.GA22322@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> Message-ID: <8dcf25e3-1acd-f629-cea0-bfeebf06e7a5@gentwo.org> References: <1720169301-21002-1-git-send-email-ssengar@linux.microsoft.com> <20240705135911.4a6e38379ae95c3fc6bbe7e2@linux-foundation.org> <20240709045750.GA32083@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <5a18105c-8e6f-39fa-370f-2d839d9ab843@gentwo.org> <20240828053737.GA22322@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-Rspamd-Queue-Id: AB1642001F X-Stat-Signature: 166y1nn4mejzx7xgg6aa5btne3f8scbp X-Rspamd-Server: rspam09 X-Rspam-User: X-HE-Tag: 1724859836-674937 X-HE-Meta: U2FsdGVkX19mogERRgumOTcHPpt7hqh1zjfGFI5p7KDZKjQjTs5AaX/bDC5sLgwG1A+DH7F/rFpgHESKxfOG5tpd79yJClznOsdgpeNR+D2geob1ewIjHJueLkVpbwrCNsT8rkLbHBlQOpUTguZ2e8wYAVFQd9EM0NhA9Lx9gK7g/EStLdW9vWXq94/MRRuOTRkT5+wfJ4Qz4kHWnpFL3N9RPfncmEntzI/nPr7W0IOCgPEJmnf61yJ0+lXOcz1cpZSCiwBwy7HoRiGyhdwsyV+YqY0FBoEQAiPPx6ck8K2PhRI/i23FS23fF1SlP9D+X5zw3T6DsHBuJ013KkOGnmPbMlPyS2C3N0qV6ximvKP5qZHb3Xxx90C701Ceou0x+kii5ScYVHKHKzEB36nfgeJLIdBkLn1e2hHaLoAfYeaygcCT4szEIsaZiDGn3P9iQt7CHQG8mFLoXYqs33KLZyOMaNgvBfZV3B7ms6heVxJnzOghIG8qRifg0JW7xK4R4IOWZog/+mtGMzCTmks4i47gfuGy0peWuhI9tIn6rOoKKzxCEy6NqEl2IrsU0zqL2eM9t0/l1FaIlS4QbrtaKEYVnkJy+RUH5hc4ZpxqSg7NwG9P/rZO9Pt4o2YJ9cDQhmQd1tCND/lBnMG1MTqgj9toKQBRZBdSlEWYR3Q6SJvMn9DA4w1GJG8cI2SUz5AxG5yOBTbr6EV3g7+jpppiiDj18l5vXb1m3LwNhJl+b5TWqGZRc41ogLuJqi0mzVqxOxLq6htVvg6D5+zr1PzTJL1WtQaeAuCJVOc248WVceFsnNzP9E2pJ/W5ytxkuZih1N/Q7YkhUrz+J5V5eWjYXms102IARC97vRkSiSktEVEqAC38LSBtsxB5lHaTGEB0VwwVVMrHkoZ6hFYs33KPz4BC5R8U5NY6ziwQ6nCHjJt+azaO2Cwz6Cj3iUlOkaJt/netBB4JCsFXfbatVzX MDy3UrHX TYWN9lwtxDWtAdpgXjv0V3lMNvI3mlO0bM6jNvzFYHo3oei3/UE/rooHuGDolwkTRFBlDVOrkfdqV70ikYRWSkbH9iusalMTMnTOtdMctKUR1ign29PGDqRaFX98B+Uk0NuA12Ny8zmBTTSNavDL5AlQbdQzgisjXHc2XtKa1IFPz6Ejc7YiDhVXfMES1qqvCyRxyOuNg5lugIY3WF2EefUkAd21k319iqCJ+SHZt42V/n6DiL5yd9myZug== 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 Tue, 27 Aug 2024, Saurabh Singh Sengar wrote: > Thank you for your review. I would like to gain a better understanding of how > to measure contention. Could you please inform me if there is any recommended > method for doing so? > > In my testing, this patch has resulted in a significant improvement in boot time. Good. There was the question by Andrew as to what happens if the threshold is not initialized. I have no specific benchmarks to measure the effect. > > What may be more promising is to make it possible to calculate the > > threshholds per cpu instead of recalculating the thresholds for every zone > > again and again. > > I am happy to explore alternatives, can you please share more details around > this approach. Are you referring to avoiding the repetition of the calculation > below? > > mem = zone_managed_pages(zone) >> (27 - PAGE_SHIFT); The thresholds vary per the zone setup in a NUMA node. So one approach would be to calculate these values for each new NODE once and only update them when memory is brought online or offlines. Then the parameters for each per cpu pcp could be set from the per NODE / zone information when a cpu is brought up. The overhead would be minimal and there would not be a need for the loops. My company has similar amounts of cpus and it would be great to have a clean solution here.