From nobody Tue Nov 26 10:48:57 2024 Received: from mail-yw1-f202.google.com (mail-yw1-f202.google.com [209.85.128.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8A6381BDA9C for ; Sat, 19 Oct 2024 01:29:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.202 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729301388; cv=none; b=Yj5xTDxS8SiHzFWPF6llOrZ3ujwAQs4mVUDN4kSTLh9u4nSF2CoCMvoBdXYFvwIsowmEkNeNJwAxuSP5b+BNv3OS5m29Vvjz+F7SEN7zfH1QF9yNhejUi/fdNb8cvape9OnPOnyvn2HKlt83ndf24V60WhE6vVVJ0Dk2+KSZcAQ= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729301388; c=relaxed/simple; bh=ADHj64695AnmWs6scDXXAuyNjPNjewRXryZ8+dKDUIo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=YegSYNwEfjCAQ+KqRGmuUUt1HCMu3kFWvzTOmp5Q1Sa1TwKl0GjhZn6F0s1ENDg9AFQufMqVyoHZ4kYAMuZTkGW7/Wg4hEEWD1qGOfEKfjjE0j2ssAgRKA+SFjaq9XS7cRhcr26hwOLlgt7sdvxAvcAuPpvAKOuwWGvOFth8cxQ= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jthoughton.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=viXTgd/+; arc=none smtp.client-ip=209.85.128.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jthoughton.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="viXTgd/+" Received: by mail-yw1-f202.google.com with SMTP id 00721157ae682-6e1fbe2a6b1so48671107b3.2 for ; Fri, 18 Oct 2024 18:29:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1729301385; x=1729906185; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=JWmoU09y+6wa+3R3ifZVkoogK5Ofgf3reUuHP39SGJ0=; b=viXTgd/+78WBIA+cBXcXXn9PPKzGgZPL3VXpi9qdNKMmmXitaVomB0T4MCr9+IEzGC vP4IDaPubm2fW4tWyAQyuPctcYAbdWz0aCMaOXBPR5vGob8/keahmg7F1sbDrBYUBfu8 5xMqa29W5f8VjBAdTdvh4vGMisq63G45GMCPeOn5x2qxrA6W/Q+3RJXCHHS/CE7r+oBu Co4AgCDiZy8tPkSukpb3LxbZKBdB/v0EIxEhQNNklVjrLdzF/v3SE1FnJtp0mqjNxmCo lf/q/TuZ65fHNjXFUDo3HdaAzq3l1kfB1lNXmA6Zco7jMOMKvCAdi0cgYI08ET5ZTKx5 WMdQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729301385; x=1729906185; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=JWmoU09y+6wa+3R3ifZVkoogK5Ofgf3reUuHP39SGJ0=; b=ZvvZkmukycUCNwCF84C0IMTlpf9zjUjxibhqIqXBDwm98QYkyXhby1k/jYwO/vl9PQ BUFoxltWG1bp8HwOTWtFK/ESySejL11obNbya3kxHIifxsYrVXZhxiDbDiDjZfPrjk2J 12zPqI82uxV+YO2o9gCcGAz6aFCOdp3llRuQ8dz7e/9B0JYcWmBcoL/CeUPwmrj6GPY8 0uiuFPn9WbwcQLj45uO0WSFAUejwi9HJrpTrn4X2rRrieSYGHhndJ2KFJ96RpPbbgVcR UNj3pv25+vLUS12zDwR6+GIR3nuUnYIktum4Te0iGfGwMM/nxCv84hs1fFRNzTucwLNH vN2w== X-Forwarded-Encrypted: i=1; AJvYcCW27JLYO2SkhWaEZaUtHmGVrNsHXoSAc0yCIi/M8KGnbw9Dl+zMxiHgiPCFE76PF8dh5j8qoZygd3mWD9s=@vger.kernel.org X-Gm-Message-State: AOJu0YzUXbohH7lEIBGpi960+XUGKVgdr6e1gELks7CpTxQFZYcx9cD/ hn885+TSBtwaNZ7X+bsQibPxVJM7BqTyWZDqYqBTDnhSvRLAvjU2sWi33P/1OBoqskSUeOJSazL SBTMSqvabO7NMr5VD2A== X-Google-Smtp-Source: AGHT+IE7mxydzjHIcaCtSw9GRjaWSidW3zTmTU0yiTMTLG+FkvhjpHmaauVlHv0Tv7yfhEo/zPT4VQCUKP70YtII X-Received: from jthoughton.c.googlers.com ([fda3:e722:ac3:cc00:13d:fb22:ac12:a84b]) (user=jthoughton job=sendgmr) by 2002:a05:690c:2e90:b0:6e3:1627:e866 with SMTP id 00721157ae682-6e5bfbd836bmr424387b3.3.1729301385447; Fri, 18 Oct 2024 18:29:45 -0700 (PDT) Date: Sat, 19 Oct 2024 01:29:38 +0000 In-Reply-To: <20241019012940.3656292-1-jthoughton@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241019012940.3656292-1-jthoughton@google.com> X-Mailer: git-send-email 2.47.0.105.g07ac214952-goog Message-ID: <20241019012940.3656292-2-jthoughton@google.com> Subject: [PATCH 1/2] mm: multi-gen LRU: remove MM_LEAF_OLD and MM_NONLEAF_TOTAL stats From: James Houghton To: Andrew Morton Cc: Sean Christopherson , Paolo Bonzini , David Matlack , David Rientjes , James Houghton , Oliver Upton , David Stevens , Yu Zhao , Wei Xu , Axel Rasmussen , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Yu Zhao The removed stats, MM_LEAF_OLD and MM_NONLEAF_TOTAL, are not very helpful and become more complicated to properly compute when adding test/clear_young() notifiers in MGLRU's mm walk. Signed-off-by: Yu Zhao Signed-off-by: James Houghton --- include/linux/mmzone.h | 2 -- mm/vmscan.c | 14 +++++--------- 2 files changed, 5 insertions(+), 11 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 96dea31fb211..691c635d8d1f 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -460,9 +460,7 @@ struct lru_gen_folio { =20 enum { MM_LEAF_TOTAL, /* total leaf entries */ - MM_LEAF_OLD, /* old leaf entries */ MM_LEAF_YOUNG, /* young leaf entries */ - MM_NONLEAF_TOTAL, /* total non-leaf entries */ MM_NONLEAF_FOUND, /* non-leaf entries found in Bloom filters */ MM_NONLEAF_ADDED, /* non-leaf entries added to Bloom filters */ NR_MM_STATS diff --git a/mm/vmscan.c b/mm/vmscan.c index 2d0486189804..60669f8bba46 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3405,7 +3405,6 @@ static bool walk_pte_range(pmd_t *pmd, unsigned long = start, unsigned long end, continue; =20 if (!pte_young(ptent)) { - walk->mm_stats[MM_LEAF_OLD]++; continue; } =20 @@ -3558,7 +3557,6 @@ static void walk_pmd_range(pud_t *pud, unsigned long = start, unsigned long end, walk->mm_stats[MM_LEAF_TOTAL]++; =20 if (!pmd_young(val)) { - walk->mm_stats[MM_LEAF_OLD]++; continue; } =20 @@ -3570,8 +3568,6 @@ static void walk_pmd_range(pud_t *pud, unsigned long = start, unsigned long end, continue; } =20 - walk->mm_stats[MM_NONLEAF_TOTAL]++; - if (!walk->force_scan && should_clear_pmd_young()) { if (!pmd_young(val)) continue; @@ -5262,11 +5258,11 @@ static void lru_gen_seq_show_full(struct seq_file *= m, struct lruvec *lruvec, for (tier =3D 0; tier < MAX_NR_TIERS; tier++) { seq_printf(m, " %10d", tier); for (type =3D 0; type < ANON_AND_FILE; type++) { - const char *s =3D " "; + const char *s =3D "xxx"; unsigned long n[3] =3D {}; =20 if (seq =3D=3D max_seq) { - s =3D "RT "; + s =3D "RTx"; n[0] =3D READ_ONCE(lrugen->avg_refaulted[type][tier]); n[1] =3D READ_ONCE(lrugen->avg_total[type][tier]); } else if (seq =3D=3D min_seq[type] || NR_HIST_GENS > 1) { @@ -5288,14 +5284,14 @@ static void lru_gen_seq_show_full(struct seq_file *= m, struct lruvec *lruvec, =20 seq_puts(m, " "); for (i =3D 0; i < NR_MM_STATS; i++) { - const char *s =3D " "; + const char *s =3D "xxxx"; unsigned long n =3D 0; =20 if (seq =3D=3D max_seq && NR_HIST_GENS =3D=3D 1) { - s =3D "LOYNFA"; + s =3D "TYFA"; n =3D READ_ONCE(mm_state->stats[hist][i]); } else if (seq !=3D max_seq && NR_HIST_GENS > 1) { - s =3D "loynfa"; + s =3D "tyfa"; n =3D READ_ONCE(mm_state->stats[hist][i]); } =20 --=20 2.47.0.105.g07ac214952-goog