From patchwork Sat Aug 13 08:07:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: CGEL X-Patchwork-Id: 12942701 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 56195C25B08 for ; Sat, 13 Aug 2022 08:09:33 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A14C98E0001; Sat, 13 Aug 2022 04:09:32 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9C4776B0075; Sat, 13 Aug 2022 04:09:32 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88BFA8E0001; Sat, 13 Aug 2022 04:09:32 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 79B896B0073 for ; Sat, 13 Aug 2022 04:09:32 -0400 (EDT) Received: from smtpin29.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 4BCC0120B74 for ; Sat, 13 Aug 2022 08:09:32 +0000 (UTC) X-FDA: 79793844984.29.67FA1CC Received: from mail-pj1-f48.google.com (mail-pj1-f48.google.com [209.85.216.48]) by imf18.hostedemail.com (Postfix) with ESMTP id F039A1C009D for ; Sat, 13 Aug 2022 08:09:31 +0000 (UTC) Received: by mail-pj1-f48.google.com with SMTP id c19-20020a17090ae11300b001f2f94ed5c6so8612336pjz.1 for ; Sat, 13 Aug 2022 01:09:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc; bh=bdMoJB0weVQxk5D+NC587KdcV+uubEp6hO8Wqi+RKc8=; b=Q3UqJhD3V0gEP5HJgLeaoKnBWkkCxIlAnoNsF1EXfAl3MoK6BnTIxJaaWGIqvsxA4I mHNPO9ZjzD7DVFXhJ5A6ZLIGVbfpewuR+HgnaBiS/G/WR9Owu5Hyfb6K2jHhLNiL+hBR 3jrkQ5BVXKtnHwD0K14eOBKU/lyCvKqFWz11arbtE8zVVsni04kY/iAHIKToH7hSIzA3 gLauduyo7ACIF0MsqKgIdnugaBGyE1rK3Oy39lJ7GMijxox8Z0Q8+NujK+GCjBadh0S7 OrP8OtYY7oi1rlEh8J+ke/SaVhJ6bGrTlWNWJvgEDRPbn8Ew65Cn/TTjydyXmLrWz5k4 U5tw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc; bh=bdMoJB0weVQxk5D+NC587KdcV+uubEp6hO8Wqi+RKc8=; b=VKJawaEu0f9F346iobnuOh2pEVPmi4rsN4K6jsJ3XPp/5cltOpyYE4kjNAddqHVvxs Kp9CdknG1EkxExumYOsEE2t/EYGlNz9i8Wz/+CVQk1IjmAydx/Wz2pZX8gTqTFIsLx2C iQ14/G0vf3b/6GRiFreSdcpkFx3G/WvKamiMDdM04wa6ZBJBBcMAm1vyHDHV4wgCidJH 4D+cOXh0tzDRch8IVL733C5bX+JICLEqRdkhnOVflOawgttnK8tGcfEXK0K6oVTJ5v0w OijMBtsPtNR8RzTBAPmbEm6S0AJLDimXMhm6ABqKSFYQb3L7BWoOQ+3oWhQ4gFsAXykH tvFw== X-Gm-Message-State: ACgBeo09eeyEXuHthDaCJ/4fRlukbF4z3dtfeiT+21sufQ6FuCu+gMpT nJLWQ3sIVeAGMXszph9+93U= X-Google-Smtp-Source: AA6agR53zo5hPtKKIqU2D+NEY9ay/ZsmTDKN0wzoIs1CdVh6eNrH2csYhDItPyHEHpyI6RSkV6tVdg== X-Received: by 2002:a17:90b:1c0a:b0:1f3:1848:591c with SMTP id oc10-20020a17090b1c0a00b001f31848591cmr17341078pjb.24.1660378171021; Sat, 13 Aug 2022 01:09:31 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id w190-20020a6262c7000000b0052d417039c2sm2912550pfb.133.2022.08.13.01.09.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 01:09:30 -0700 (PDT) From: cgel.zte@gmail.com X-Google-Original-From: yang.yang29@zte.com.cn To: akpm@linux-foundation.org, iamjoonsoo.kim@lge.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Yang Yang , CGEL ZTE Subject: [PATCH] mm/vmscan: make the annotations of refaults code at the right place Date: Sat, 13 Aug 2022 08:07:58 +0000 Message-Id: <20220813080757.59131-1-yang.yang29@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q3UqJhD3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of cgel.zte@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=cgel.zte@gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660378172; a=rsa-sha256; cv=none; b=CPJkN2ZlFzutD9rugyJCarPr/KRfQpOC7tJU/eQLGhz3/2StJprVr07bC9moqCj7Q4/3/A pJro9jucznSgonB8EY5DGIo0sWJXPueBCbhdXJ26EP2W1au1+uNmLGqmggeOFn9CuZQ7pB cirwMWq7Q3TeBnogYUBREIML9065FRU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660378172; 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-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=bdMoJB0weVQxk5D+NC587KdcV+uubEp6hO8Wqi+RKc8=; b=kF2+jPK1PanvW+1UwWmUB5t+DoTRe1q3WTsIHRRPgY1OlqpS774D/TGorRCz7Ef9L/nBb4 /PhjAFv/Frs6XF+S5taug0HA/Pq8zI2mcW7wGUBmiubRCPrXwdPGAu+K0sLkDY4+Sj3pJL mTWE/Vf1/FThHiw1847ZxPHEMIBmbIg= X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=Q3UqJhD3; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf18.hostedemail.com: domain of cgel.zte@gmail.com designates 209.85.216.48 as permitted sender) smtp.mailfrom=cgel.zte@gmail.com X-Stat-Signature: trkg58c9yjrt87qy5ppk4hzim55b51f8 X-Rspamd-Server: rspam11 X-Rspamd-Queue-Id: F039A1C009D X-HE-Tag: 1660378171-131062 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: From: Yang Yang After patch "mm/workingset: prepare the workingset detection infrastructure for anon LRU", we can handle the refaults of anonymous pages too. So the annotations of refaults should cover both of anonymous pages and file pages. Signed-off-by: Yang Yang Signed-off-by: CGEL ZTE --- mm/vmscan.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 428f8fa60331..bb993b21953d 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3228,6 +3228,11 @@ static void shrink_node(pg_data_t *pgdat, struct scan_control *sc) if (!sc->force_deactivate) { unsigned long refaults; + /* + * When refaults are being observed, it means a new + * workingset is being established. Deactivate to get + * rid of any stale active pages quickly. + */ refaults = lruvec_page_state(target_lruvec, WORKINGSET_ACTIVATE_ANON); if (refaults != target_lruvec->refaults[WORKINGSET_ANON] || @@ -3236,11 +3241,6 @@ static void shrink_node(pg_data_t *pgdat, struct scan_control *sc) else sc->may_deactivate &= ~DEACTIVATE_ANON; - /* - * When refaults are being observed, it means a new - * workingset is being established. Deactivate to get - * rid of any stale active pages quickly. - */ refaults = lruvec_page_state(target_lruvec, WORKINGSET_ACTIVATE_FILE); if (refaults != target_lruvec->refaults[WORKINGSET_FILE] ||