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 ECA83C47077 for ; Tue, 16 Jan 2024 14:31:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3998D6B0080; Tue, 16 Jan 2024 09:31:11 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 349826B0082; Tue, 16 Jan 2024 09:31:11 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 237EB6B0083; Tue, 16 Jan 2024 09:31:11 -0500 (EST) 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 11E106B0080 for ; Tue, 16 Jan 2024 09:31:11 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CCC7340A4C for ; Tue, 16 Jan 2024 14:31:10 +0000 (UTC) X-FDA: 81685411500.18.45BD417 Received: from outbound-smtp49.blacknight.com (outbound-smtp49.blacknight.com [46.22.136.233]) by imf10.hostedemail.com (Postfix) with ESMTP id F07CDC002D for ; Tue, 16 Jan 2024 14:31:07 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf10.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.233 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1705415468; 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; bh=u8ZBoN4i9pquJontIH8Ob0m3C8sohOjcU2C1Hp028mc=; b=muAerDNrYqhH53ZG42WtUXGHg1oaJ4sawTYsj/in5J5d9RQJB780cb/b276FHsbWkuqawC f8hSxpGYP8X2BMUVOKWTssaFOe4o7PRmya25ZuxKGeLXyi2WqX+7iXfzulmQ+5GtAJ1Z9L GHTY5UYJnvhymipt8cXOEjtogGnKdTs= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf10.hostedemail.com: domain of mgorman@techsingularity.net designates 46.22.136.233 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1705415468; a=rsa-sha256; cv=none; b=ZkbiE1VB8mM6TPxqUvE95zg9qpnZZPfNXD3p2jA2/s1ODQLJppdFYv/r+ZWdXNSetsTvnm InnLutR+K53nz2e7LCVNvfEVNCBfZMYyYHKFcEK/7JO8W9BWEHFnXw7DpEDoM2NW2hKJ6P bLebJFJaiEpive1KfwcHoakPPj3DjSU= Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp49.blacknight.com (Postfix) with ESMTPS id 5F5A641C03F for ; Tue, 16 Jan 2024 14:31:04 +0000 (GMT) Received: (qmail 3917 invoked from network); 16 Jan 2024 14:31:04 -0000 Received: from unknown (HELO mail.blacknight.com) (mgorman@techsingularity.net@[81.17.254.21]) by 81.17.254.26 with ESMTPA; 16 Jan 2024 14:31:04 -0000 Date: Tue, 16 Jan 2024 14:31:02 +0000 From: Mel Gorman To: Vern Hao Cc: akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Xin Hao Subject: Re: [PATCH RFC v1 2/2] mm, pcp: add more detail info about high order page count Message-ID: <20240116143102.i5e5bm5hslqxfvfr@techsingularity.net> References: <20240115093437.87814-1-vernhao@tencent.com> <20240115093437.87814-3-vernhao@tencent.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20240115093437.87814-3-vernhao@tencent.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6LyDEAtImlAVDr9UEf3hiTo72z Y6HVax4F FMHoX0JDibrGQBWbpxvF59pIe+TF0HFdargCESWqxU3AREDeVSu0c1Lbh46G3MRA+9Ffm6HI9PNuDM4wN5PFrpsP65MY11WJ7n1oveTO20EfzFoFQGtyWzOEPl37uTIJdYlGBaihUWuZhYg8aedd5FPGohLaCmb/dK3D9uVd2kcdhJZkxWoA4dgFlMRUA3IN6y9HiW62rP7008r7z/8qL8Uo/VASIJWNCy2w5 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 Mon, Jan 15, 2024 at 05:34:36PM +0800, Vern Hao wrote: > From: Xin Hao > > With this patch, we can see the distribution of pages of different orders on > each cpu, just like below. > #cat /proc/zoneinfo > .... > cpu: 2 > total_count: 14286 > order0 : 1260 > order1 : 13 > order2 : 42 > order3 : 4 > order4 : 0 > order5 : 0 > order6 : 0 > order7 : 0 > order8 : 0 > order9 : 25 > order10: 0 > order11: 0 > order12: 0 > high: 14541 > batch: 63 > > Signed-off-by: Xin Hao I am not a major fan because increasing the size of a per-cpu structure for debugging purposes incurs a cost for everyone while only a tiny minority may care. There is a mild risk it would break existing parsers of that file although maybe that's not a big deal. However, the same information could be extracted by locking the pcp structures and counting the items per list. It would increase the cost of reading zoneinfo but it's unlikely the file is read at high frequency. If that was a concern, a separate proc file could be used. Finally, the same information likely can be extracted via a systemtap script, a BPF script (if it can get to the right symbols and locking, I didn't check) or via a kernel probe. Even with that information, it's not clear what meaningful action a user can take, so this is a developer-only feature really with a cost incurred for everybody. -- Mel Gorman SUSE Labs