Received: by 2002:ab2:6f44:0:b0:1fd:c486:4f03 with SMTP id l4csp89064lqq; Wed, 12 Jun 2024 18:08:57 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCU9+5AESM+Sl6Rw3sTvB23mwjdOm4TC/KLw7VYtJm1qI+8VdSYSp9Ke00gRBRqf3OgYcs5+j1kBbFGGn9l+QN147YiCXMSzLIoIE/Svqg== X-Google-Smtp-Source: AGHT+IE8i800uZ7j9Hyjdc3vC1SmokHbLSBv6/YzEaD78bzLKaq5LZiW3j6OeYHrEXJsw3H5zp77 X-Received: by 2002:a05:6871:521e:b0:24c:4c82:4f15 with SMTP id 586e51a60fabf-25514c4fc96mr4074998fac.24.1718240936890; Wed, 12 Jun 2024 18:08:56 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1718240936; cv=pass; d=google.com; s=arc-20160816; b=bERpiWsvR/StqHoo1DpxJkWArgJSHGAqtc8mY3QFFduY9Y0qCHqK3q1HKOSCnHTl1F rglAU9fRgPZEVO0jvlKxhJfgqVQmav0oWBL3dBMwf5ow13/1SC+S0ypNTOJIw5+H/Zzi XbsV+peuKxFMW0VB1iGQuPPR0u6vxVVQW6HLPIKwqiYotQgFia3vPcST0Oug8ZKNIs2P L+vHpjxN6toQZ/UFva9gqZJZSH6disiVGb6gV8+ebrhlJJRZ6ljyhKYz49+OyK7SsnBf uOGEuoZvYgsB7ax+B8Uk4akzp6hYVA0kNeGFMzMtOdH2yoYSQGEYsKkunObtQYdWxr3p Trww== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to:subject :user-agent:mime-version:list-unsubscribe:list-subscribe:list-id :precedence:date:message-id:dkim-signature; bh=frrlRZLq7WnZ116ncXcEtLFOrq8M38OfqlEQUKfVJM0=; fh=raoH/8vC3caffN69k18aDsXRfy8LJyw/p4UcJVqHnPw=; b=CRwm1qYK5lUvn2LsNOWRjxS02mgj4rOfHcEREMRXOPWJ4dVujtcMbUmvEsQK6Chvx1 QNRblwp/20iOb8VYXU7BmUVmCJh8+VIn+TapjJiU5q7zZl22OVWarbv1aH3hIoKTw09x by0a7RCJ99uYd5w4lrSu4MZVDgpqOMumrFWro7DQaAJoNe4lq1riZ7P6CaNGT5YkZ/E5 NaHHJ/DIdbTA+AKXtAgac+buvLBSDmTGX3Yl+kG1diYGwHEDP4VturFNYDW0cL6X73Gm fXNrEHvQR+/6YEbVnHb+0je+pLefUuNtbtXN+CAumxQEsgNMqx6zPoN7XUryPz2tcO41 pA4A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux.alibaba.com header.s=default header.b="CavwT/PL"; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-212426-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d2e1a72fcca58-705cc9663cdsi319300b3a.124.2024.06.12.18.08.56 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 12 Jun 2024 18:08:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-212426-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; dkim=pass header.i=@linux.alibaba.com header.s=default header.b="CavwT/PL"; arc=pass (i=1 spf=pass spfdomain=linux.alibaba.com dkim=pass dkdomain=linux.alibaba.com dmarc=pass fromdomain=linux.alibaba.com); spf=pass (google.com: domain of linux-kernel+bounces-212426-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-212426-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.alibaba.com 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 6CD1928382B for ; Thu, 13 Jun 2024 01:08:56 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 1D8F0B669; Thu, 13 Jun 2024 01:08:52 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b="CavwT/PL" Received: from out30-118.freemail.mail.aliyun.com (out30-118.freemail.mail.aliyun.com [115.124.30.118]) (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 CD19E8F62 for ; Thu, 13 Jun 2024 01:08:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=115.124.30.118 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718240931; cv=none; b=EcSRRGthPunD3a6w1yYTFVdkgxCVWJ+UDQoGLYTxBB/bItu7Zuf9CafcpRwChhen+5ZRlgYmAs7nhm5wdQsWKpIUXEmhK9GKlDtrI/eHxd3Fn9Ak3eh/KOArqOXDKs3cRblUdAP1/QcKxC91broGaVq0p+4pGyOoxf6ABfb8i10= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1718240931; c=relaxed/simple; bh=vQy2E1LRcS1YLhFfzyvBITScg58VETb76RUverloGLg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=S6l557A3judLFyxFJ9yu8TLzdnbg9akJjf1myU5Htjv0WToiihxIsQPxrebsZVAhGS0CMrL7yk/C2aaQb22V3rq0giOWIb42UurAWxY43H/wXvusfqXdy8uovQdpo35Zu0sVVGhMRdBjXDeEyXez8EhVWPOO1QOzkSgo4Z2rDTI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com; spf=pass smtp.mailfrom=linux.alibaba.com; dkim=pass (1024-bit key) header.d=linux.alibaba.com header.i=@linux.alibaba.com header.b=CavwT/PL; arc=none smtp.client-ip=115.124.30.118 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.alibaba.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.alibaba.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.alibaba.com; s=default; t=1718240920; h=Message-ID:Date:MIME-Version:Subject:To:From:Content-Type; bh=frrlRZLq7WnZ116ncXcEtLFOrq8M38OfqlEQUKfVJM0=; b=CavwT/PL0HSehRlaxyo9xds9ChWff+1VXVPiZpH1DjlJmsQyAhUPYIQkAkLuGgJ+3zxE8imakQx4r235A01iR0sCKV3CPtWoKnzmf9k8zQGpLXF+zEriWHkjq0/YBjPlkREfyrXnEk66mPyENf8HhlVhDp1YnjPM0RptWV9wnTw= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R461e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067109;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=15;SR=0;TI=SMTPD_---0W8M6-yY_1718240918; Received: from 30.97.56.57(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0W8M6-yY_1718240918) by smtp.aliyun-inc.com; Thu, 13 Jun 2024 09:08:39 +0800 Message-ID: Date: Thu, 13 Jun 2024 09:08:37 +0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v5 6/6] mm: shmem: add mTHP counters for anonymous shmem To: Lance Yang Cc: akpm@linux-foundation.org, hughd@google.com, willy@infradead.org, david@redhat.com, wangkefeng.wang@huawei.com, ying.huang@intel.com, 21cnbao@gmail.com, ryan.roberts@arm.com, shy828301@gmail.com, ziy@nvidia.com, da.gomez@samsung.com, p.raghav@samsung.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <4fd9e467d49ae4a747e428bcd821c7d13125ae67.1718090413.git.baolin.wang@linux.alibaba.com> From: Baolin Wang In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit On 2024/6/12 22:18, Lance Yang wrote: > On Tue, Jun 11, 2024 at 6:11 PM Baolin Wang > wrote: >> >> Add mTHP counters for anonymous shmem. >> >> Signed-off-by: Baolin Wang > > LGTM. Feel free to add: > Reviewed-by: Lance Yang Thanks. > > Just a friendly reminder: We also need to update the documentation > for the counters in transhuge.rst. Indeed. Andrew, could you help to fold following changes into this patch? Thanks. diff --git a/Documentation/admin-guide/mm/transhuge.rst b/Documentation/admin-guide/mm/transhuge.rst index e7232b46fe14..8f6ffbfc4b16 100644 --- a/Documentation/admin-guide/mm/transhuge.rst +++ b/Documentation/admin-guide/mm/transhuge.rst @@ -501,6 +501,19 @@ swpout_fallback Usually because failed to allocate some continuous swap space for the huge page. +file_alloc + is incremented every time a file huge page is successfully + allocated. + +file_fallback + is incremented if a file huge page is attempted to be allocated + but fails and instead falls back to using small pages. + +file_fallback_charge + is incremented if a file huge page cannot be charged and instead + falls back to using small pages even though the allocation was + successful. + As the system ages, allocating huge pages may be expensive as the system uses memory compaction to copy data around memory to free a huge page for use. There are some counters in ``/proc/vmstat`` to help