From nobody Mon Feb 9 11:32:02 2026 Received: from out-179.mta0.migadu.com (out-179.mta0.migadu.com [91.218.175.179]) (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 7ABE8335096 for ; Tue, 28 Oct 2025 14:02:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=91.218.175.179 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761660139; cv=none; b=RVkqY+W/8YhJ/hAWOPh2XO6Bt4Uk9rX0aWGv0YiECr4/BNOjr3XA6HR6DwKaFREqzB5l7ur69NlK0d/7WmQgylvMHHSuRRDbOt7WZ5z0ymXyhfCrUPfvAuNL3EJxpxiNX1xAS7po1O7exi8Tnt373x09c2blqEow6IBcBOOIMIM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1761660139; c=relaxed/simple; bh=+f4QWLoNuo4B3Dp63Eyapx1W20imhRiyMKbc1mEZdDA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=A1kmlXiQrx8zfuUFJ8yJAADFmvWSHHi7jvFelrIejVJuYzusTrgQmh23LKD742CuBQ6RR1feU7bf1TY5pGM/ae9/PnZfcG+ujfXnM63hE+7/L8RLUoZp2eM1GDlI4Io9dNGCg8V4xUMJOxWQWNgySk0aVQ9YMzogkc+wpgwsH6Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b=YrvJpFSm; arc=none smtp.client-ip=91.218.175.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux.dev header.i=@linux.dev header.b="YrvJpFSm" X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1761660135; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HjHMsvNc6Xx00FaU40JWEli8RMLF1vJXLo7+WwnW8IE=; b=YrvJpFSm06X23CK+cQFmSOcRfTt3cT97EdWGct98ZAmZZsodG45MMmxuPeK6f+vymiDmMa R3Bl8CbCbZywc5+NmbhK1NFu3mg+nXz5b9feFPfwMUUHOAUs7vlqExUk/gZ0d38ndEwYRT WijBbtVbYAfPAgyXV/Eq5gyaov1eihg= From: Qi Zheng To: hannes@cmpxchg.org, hughd@google.com, mhocko@suse.com, roman.gushchin@linux.dev, shakeel.butt@linux.dev, muchun.song@linux.dev, david@redhat.com, lorenzo.stoakes@oracle.com, ziy@nvidia.com, harry.yoo@oracle.com, imran.f.khan@oracle.com, kamalesh.babulal@oracle.com, axelrasmussen@google.com, yuanchu@google.com, weixugc@google.com, akpm@linux-foundation.org Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, Muchun Song , Qi Zheng Subject: [PATCH v1 02/26] mm: workingset: use folio_lruvec() in workingset_refault() Date: Tue, 28 Oct 2025 21:58:15 +0800 Message-ID: <02536beaa78aeaafcaec40d4fca42ccbbd9f8643.1761658310.git.zhengqi.arch@bytedance.com> In-Reply-To: References: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Migadu-Flow: FLOW_OUT Content-Type: text/plain; charset="utf-8" From: Muchun Song Use folio_lruvec() to simplify the code. Signed-off-by: Muchun Song Acked-by: Johannes Weiner Signed-off-by: Qi Zheng Reviewed-by: Harry Yoo --- mm/workingset.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index 68a76a91111f4..8cad8ee6dec6a 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -534,8 +534,6 @@ bool workingset_test_recent(void *shadow, bool file, bo= ol *workingset, void workingset_refault(struct folio *folio, void *shadow) { bool file =3D folio_is_file_lru(folio); - struct pglist_data *pgdat; - struct mem_cgroup *memcg; struct lruvec *lruvec; bool workingset; long nr; @@ -557,10 +555,7 @@ void workingset_refault(struct folio *folio, void *sha= dow) * locked to guarantee folio_memcg() stability throughout. */ nr =3D folio_nr_pages(folio); - memcg =3D folio_memcg(folio); - pgdat =3D folio_pgdat(folio); - lruvec =3D mem_cgroup_lruvec(memcg, pgdat); - + lruvec =3D folio_lruvec(folio); mod_lruvec_state(lruvec, WORKINGSET_REFAULT_BASE + file, nr); =20 if (!workingset_test_recent(shadow, file, &workingset, true)) --=20 2.20.1