Received: by 2002:ab2:7855:0:b0:1f9:5764:f03e with SMTP id m21csp170601lqp; Wed, 22 May 2024 00:18:14 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXVQPINFyTO6VnBcv0s7+8h5NvTVxg6b1HnyNhuLl2cbnW3gW0ct5UXSEz294sO/876hUM36TLrtidRrqu6hskRO1OIETl5ZLMfVCDGFw== X-Google-Smtp-Source: AGHT+IGoiJFTgj8m16InLSJCqQZlL38MEjzVVqnEScr9qrdh/GKqi4ixRHx7XsT3eQ9DbRIDXhch X-Received: by 2002:a50:9345:0:b0:575:a0c:4b8c with SMTP id 4fb4d7f45d1cf-57832c57d20mr737644a12.38.1716362294048; Wed, 22 May 2024 00:18:14 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716362294; cv=pass; d=google.com; s=arc-20160816; b=nv50TD/U9TjDVh6+eMW84Ajduhp4oi3hPCypA6NzCfnrdJQfnyT7CnQZ/BHXazz1P1 P8SZY4IjIys8x7+j+hPq30Etp3/kL1yCnB6DyS0QPuCIQbIUPO4LixMTu0of/9RiY2I1 Qw4vnaDhlS6dSQC7iv+ybkKR2hHTTUf9kas/BkdHBgI7wk2I0HJ+2m9FeFP+fMoic8Lq QBnDLu/qaKk/r5vL/YI1yBAJwMUyYihp94/OcsLVfnlZjWBRv5cK7g/fT8M4KBKCnDFW iRhSVUaloC9zUktTfgyF/m6FvrxyW0zM0OPa6627IhbCXXV4D+X/46/a8vbVRuLrV1rS ekgA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :user-agent:message-id:date:references:in-reply-to:subject:cc:to :from:dkim-signature; bh=dipBx7/Eghd3ToBxdScRhudTQd+a55G4dg758eSwG1A=; fh=PiCUwXkAgZLcK9Ebfpg+vNE4HdfDcrCx32z26aLJMRU=; b=UZPHv13jj1ElYppUUEPqa3YNJVQLcOJJpjNsYWmCd/kt8KSwY8uoZ3O2VOmDUrh947 pwYBb4bccNehrYueN4MOU/ExvozZho5OJ8X/cdTo432ax9FlG+r44nVTQcdcjyvGddy5 JgRD9DSIMlifaiavEddVwBqPJZFF0HFmMCN0EFUKs5JAhCWKp4kjFJB4/oFe1Kexq+/g 3DrfDVwgjHc7AzT/yWpFXgVnwiSSP7sEqC/PeQLYrrbOESp81Efp8+gGGSptcvbI27o4 bFyaapA+tTAtvmL/TANlExxWnUHnM5UAuAiMvYd/CZuQQ7Jb9+GhG5e/vVFKZx1xtdZ/ x28g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="goy//SBk"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-185847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id 4fb4d7f45d1cf-5733c36e35bsi15160588a12.554.2024.05.22.00.18.13 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 22 May 2024 00:18:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-185847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="goy//SBk"; arc=pass (i=1 spf=pass spfdomain=intel.com dkim=pass dkdomain=intel.com dmarc=pass fromdomain=intel.com); spf=pass (google.com: domain of linux-kernel+bounces-185847-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-185847-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.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 am.mirrors.kernel.org (Postfix) with ESMTPS id 987081F2257D for ; Wed, 22 May 2024 07:18:13 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 2D6D27A702; Wed, 22 May 2024 07:18:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b="goy//SBk" Received: from mgamail.intel.com (mgamail.intel.com [198.175.65.14]) (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 B959474C14 for ; Wed, 22 May 2024 07:18:01 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=198.175.65.14 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716362283; cv=none; b=mIJa0dFHLMJ+lrX65F8MN9KrEAR1WhfHQsuTc3y2E5XG6ZkFVWo6sHMFYxuNqk1+uj56v+4/pZA25WQTDgrhj3obIFQ2D0XbdOgSnqaTNHK18/jgLoclge9T0tu82Mj0JigWpWSkjhv9G7zh6XeLAZganqvQbE1YbD7Du+DGxzM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716362283; c=relaxed/simple; bh=r3l/ggpM98iN9cvyHo4cv5BChwmtMqwhd9kq2chKAZo=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=CodvzssvlXPhJngdEVQwtsRGkpB1R8VTrXs2XTerR8oo4boKevcr04R3VN3hfUXKfX/k8c8VUeJoAUHrjhzsJsVRWMc7o0dcSvMklhy8R3fNYx2kDwJR8tqgtGG2ds1u7uAKlyfLFBj8k9n5hlzq/6SiLWjRTaruJh4JuE4EBa0= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com; spf=pass smtp.mailfrom=intel.com; dkim=pass (2048-bit key) header.d=intel.com header.i=@intel.com header.b=goy//SBk; arc=none smtp.client-ip=198.175.65.14 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=intel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=intel.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1716362282; x=1747898282; h=from:to:cc:subject:in-reply-to:references:date: message-id:mime-version; bh=r3l/ggpM98iN9cvyHo4cv5BChwmtMqwhd9kq2chKAZo=; b=goy//SBkWpV30loaD0W+M0HURv1Gn7rDCpXptl8TDDFzqe3nyw8wh6fa EGE0HCqvDgDwwRgMRbciV+6JxLvFAcWD+AlEjD61H9kj59W0pzDCky6+C 45uwVQYi2oqpHWQxV7wbv4aGxrk00Gh7pmrJRwlCi/fm37JbtQhwGOzVg 6PAPD2u3SZ8x4ObABRFjrbXO4jnj/JBmjMMOYiwkdU9T8zpj9KQJjEZOB cuULSfvjam6kVDZ2otBdjE3PRB/nE4e341N0wO6lE9eg2/MnWlIEfrr9P bSZOpYAOWUaNG5088TT/HSbq6FkdmfyDadBgymS3sCW1CXWtSoN/MCeI2 g==; X-CSE-ConnectionGUID: 2AUF7EuwRde7ni92lr6lmw== X-CSE-MsgGUID: nCk03wFJSg6I4zsUHvmRcA== X-IronPort-AV: E=McAfee;i="6600,9927,11079"; a="16423319" X-IronPort-AV: E=Sophos;i="6.08,179,1712646000"; d="scan'208";a="16423319" Received: from orviesa007.jf.intel.com ([10.64.159.147]) by orvoesa106.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 00:18:01 -0700 X-CSE-ConnectionGUID: x4GNIGASR5GBST9anVjgAA== X-CSE-MsgGUID: H/fnTJoAQx+f85lBEKbvqw== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="6.08,179,1712646000"; d="scan'208";a="33783486" Received: from unknown (HELO yhuang6-desk2.ccr.corp.intel.com) ([10.238.208.55]) by orviesa007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 22 May 2024 00:17:57 -0700 From: "Huang, Ying" To: Baolin Wang Cc: akpm@linux-foundation.org, hughd@google.com, , , , , , , , <21cnbao@gmail.com>, , , , , Subject: Re: [RFC PATCH 1/8] mm: fix shmem swapout statistic In-Reply-To: (Baolin Wang's message of "Tue, 21 May 2024 19:03:11 +0800") References: Date: Wed, 22 May 2024 15:16:05 +0800 Message-ID: <87le42b9l6.fsf@yhuang6-desk2.ccr.corp.intel.com> User-Agent: Gnus/5.13 (Gnus v5.13) 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=ascii Baolin Wang writes: > As we know, shmem not only supports the sharing of anonymous pages, but also > the RAM-based temporary filesystem. Therefore, shmem swapouts should not be > marked as anonymous swapout statistics. Fix it by adding folio_test_anon(). > > Fixes: d0f048ac39f6 ("mm: add per-order mTHP anon_swpout and anon_swpout_fallback counters") > Signed-off-by: Baolin Wang > --- > mm/page_io.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/mm/page_io.c b/mm/page_io.c > index 46c603dddf04..b181b81f39e3 100644 > --- a/mm/page_io.c > +++ b/mm/page_io.c > @@ -217,7 +217,9 @@ static inline void count_swpout_vm_event(struct folio *folio) > count_memcg_folio_events(folio, THP_SWPOUT, 1); > count_vm_event(THP_SWPOUT); > } > - count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT); > + > + if (folio_test_anon(folio)) > + count_mthp_stat(folio_order(folio), MTHP_STAT_ANON_SWPOUT); Do we need to distinguish anonymous swapout and non-anonymous swapout? IMHO, we don't. Just like we have done for small folio and THP. If so, how about fix this in another direction? That is, remove "ANON" from mTHP swapout statistics? > #endif > count_vm_events(PSWPOUT, folio_nr_pages(folio)); > } -- Best Regards, Huang, Ying