Received: by 2002:a05:7412:8d09:b0:fa:4c10:6cad with SMTP id bj9csp485805rdb; Tue, 16 Jan 2024 06:40:16 -0800 (PST) X-Google-Smtp-Source: AGHT+IE7cUN4PWMXbekJOhDzMW3R13cVTx2T/XXE0qrgd3FDC9vDnpY6yJKd3NPHSwt2RoYa37JF X-Received: by 2002:a17:903:11cc:b0:1d4:2330:85a3 with SMTP id q12-20020a17090311cc00b001d4233085a3mr4806051plh.20.1705416016049; Tue, 16 Jan 2024 06:40:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1705416016; cv=none; d=google.com; s=arc-20160816; b=gI5AxP3hQXdQM75165DWya5FQNAYUGEJoD6+MqJuuWpZcYy6KQJ8uj8E0ciiwV85iJ LFgrwHXOm2EZ35jEuRvYNxITiTj5FWjA8d43b0mCOaE+dGycl3cK4Oa1benHTF2wbRGi tvY2VCM6m9Ytj2y+1wIRNT40KeoKUuj3GkGIXxqrvjJF/juITYhAmXy6w6tfpnevmhFT KWJ0xBiKXfIxVOY2n+lchlxh1/4K2aFIM5av5Nzn0h8FITakj23Nfv4XQmDAVe7M5e89 lNpw+/bDLn9yK4sGK9dVV8E+xmvqc8nOi4zmIT4A4096TGkoywjMTedBEmy9QmIlYoI5 Nw1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date; bh=u8ZBoN4i9pquJontIH8Ob0m3C8sohOjcU2C1Hp028mc=; fh=lm9UUDKJJsHrGPxxN5HV194DSRoq1LpAt4AtKAULtYQ=; b=hZWF+XaWbXlXOIxk5T1o+C1WgmwuSvCVgpdhmXq6i/vgIFYoORzxsBli4MGsUKCkVs JVOTOPhfR8rSTMmKGx/ZPoZqbNS28smnOb569j0LO8jLIWSMo8CEdNBO+Z9cpoBxKtjO Vrb3CpCYhrSbyB8FjgUDbh3Gr9ossUHwRS1gQx0WT2ENWgEyzSBQptDWL+bRQDXM1P/J OnVwoZc5yyRkN9dnyL10psja+4TVr4PuReyc5zT43JALSCFif4NG9Afy1I18WD3iheBZ IeqQixkXK9P1uHJn8VziuzSNXHYuy6pxLO6w7FXULy3KarxVZ49CCTLUTObPPOR5nTFN wriQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27469-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27469-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id e11-20020a170902ed8b00b001d5ad9a8e4bsi1944157plj.489.2024.01.16.06.40.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 16 Jan 2024 06:40:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-27469-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-27469-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-27469-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id B37B0284906 for ; Tue, 16 Jan 2024 14:40:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 320911BDEC; Tue, 16 Jan 2024 14:40:08 +0000 (UTC) Received: from outbound-smtp01.blacknight.com (outbound-smtp01.blacknight.com [81.17.249.7]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 024E31B941 for ; Tue, 16 Jan 2024 14:40:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=techsingularity.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=techsingularity.net Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp01.blacknight.com (Postfix) with ESMTPS id 5E8D550147 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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20240115093437.87814-3-vernhao@tencent.com> 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