From patchwork Mon May 22 11:20:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "T.J. Alumbaugh" X-Patchwork-Id: 97324 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1383052vqo; Mon, 22 May 2023 04:46:22 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ42uu3eBYRFKWe8gA32QoACJqM8r8YhN+Hzjf5aEHrjGx3rrV8L2B+hZnGK1vDZ+82n1ZaV X-Received: by 2002:a05:6a00:14c4:b0:646:2e83:6b2e with SMTP id w4-20020a056a0014c400b006462e836b2emr13089192pfu.31.1684755981743; Mon, 22 May 2023 04:46:21 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684755981; cv=none; d=google.com; s=arc-20160816; b=nw6XRe8sLTbKb7dYLVcj1pocd+vA5pQ1GcCt2REA7tjpsQM2lC6XeVzvduuzOxh7by e2QR0RTvAJWGFMahYp2hO8MtBGAKV/SD1jxl6KIeuYpFTic1H/s2/BB//SPBnQtS1dYw uUDZwZxwCyesM5VVKCCVimutUrm5hWTK5KIzDHuPy2dYumqdwtrZj2r758pdKcO67air BC8w3aE2DEUw15rqKaxDzOpvELXlzhM/7lz1p3Sni5RQnOp1sVZ1jBgch4BBO+gJGeKB 4QpYFdaMxlV6hz8owcE9IszKVGe5gIaK1FE9Og0yRbr/epzCWRMVh60NKgZ8XoesvgP3 C1+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:mime-version:date :dkim-signature; bh=tjbotIl6dteDpFw7M2HIwfdcqW8YhSXjziuk6U7H4Oo=; b=lLSPSaMKRjwg65Q6lzdoPKDtUZ+zHBrw7vjPjSqlFUtNxD/a3ufRXj7sWNT011J+Hi g5QdN72uq1DSXYvOv+cn9WrsHdwwndUzTKuXNxL/r9fw4+QX4Cu5a5uw6uZqsN6v9PAO IIhMutVQDvWZFacbYnaFOXMSf36RK68XTIbuS8yNRnJe7NyNVOI5nKDjQLQ3f67gBLl8 mOdF3rkVPhP838by4ksnOxzLV08mdZaSuWtvKqDPUY8cP9QpPkhXqzLiXV38Y9pZav5c 0ZNGs5EyQGxEndMrqL4FTMBk56cl1xUHsEhyNrjONqwSWFUezMev8U6vWzOmq+KEye6R TuFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=chESpP8R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id h126-20020a636c84000000b0051bb433f5d3si4713081pgc.862.2023.05.22.04.46.05; Mon, 22 May 2023 04:46:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=chESpP8R; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233316AbjEVLYn (ORCPT + 99 others); Mon, 22 May 2023 07:24:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38130 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233353AbjEVLY1 (ORCPT ); Mon, 22 May 2023 07:24:27 -0400 Received: from mail-il1-x149.google.com (mail-il1-x149.google.com [IPv6:2607:f8b0:4864:20::149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E161F1FDC for ; Mon, 22 May 2023 04:21:12 -0700 (PDT) Received: by mail-il1-x149.google.com with SMTP id e9e14a558f8ab-3381796d685so93611615ab.1 for ; Mon, 22 May 2023 04:21:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684754472; x=1687346472; h=cc:to:from:subject:message-id:mime-version:date:from:to:cc:subject :date:message-id:reply-to; bh=tjbotIl6dteDpFw7M2HIwfdcqW8YhSXjziuk6U7H4Oo=; b=chESpP8RhTjBYYVdguowYuRgIznzG4M2UF9I7tFZtlG8zb2E0krTaM/+YPGrU8lWr7 l/ys2WLnJQP7hnutQyiv7RNRbbcPcCKWKSYiG5hc0J0QT7WfehDUyCSIFZbvY6XzplnK kxMCdv2IBYm4MP4HlRbMs9m1RwRcMyy2i5IrR8FpwbTiEGvFv5gb7Jr4uzHdURDpMXPq lPDRcdGUF3kRVoBf/nZGEJdAB+wBQltqNBDiTKDRwz1tJqIrABPqDnDY4h9pUGo4VXHw ZqM5JpkVP0R1tDNbnzeIIV3YCvOaNhpBgQTK6mvck7LioQUhlY6FyFvE5tc/7k6XnuKM JDuQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684754472; x=1687346472; h=cc:to:from:subject:message-id:mime-version:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=tjbotIl6dteDpFw7M2HIwfdcqW8YhSXjziuk6U7H4Oo=; b=Q9e12nwxrXzRHs9ZGXzI7VTZdl+P3R8vpEcymuEy4tJ1U9NHfRq3DYR0lRxAbRN4dy E7KHB0rsUDNJm3H+/RhexDE22uThfBr2Y3ACrbxtb0EVDw79wlvCOpoH+nKBM47JqBPR 6VE9gec2zwQ5Vnd5zuSZVbshWAtO5Vc40HIEWDXsraagi6cpg56ECvV9P1tXlhvAjIw5 pYpXqL4NjHdGW7Q9X3YqmFRnKjpSKsolHRYgoQlJrJgP0GgdzIMa0yxjSXNIKH9WLO5O B6u7xYBBU03wn3cfGpoWZJZjSG6FryQppTWVHdwWmSQySZWVH1WtqWzTJh4SHjVR45B/ LbpQ== X-Gm-Message-State: AC+VfDzWeUX1ZUyD1V1mwxJuwGeTTNHC6EKuFKenpOzyVecAuWjBnBf2 v7dlvHGVwFgetEybNYc+5JI77/8lIF1oNA== X-Received: from talumbau.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:90d]) (user=talumbau job=sendgmr) by 2002:a92:cb44:0:b0:335:479a:8eaa with SMTP id f4-20020a92cb44000000b00335479a8eaamr6111039ilq.6.1684754471949; Mon, 22 May 2023 04:21:11 -0700 (PDT) Date: Mon, 22 May 2023 11:20:55 +0000 Mime-Version: 1.0 Message-ID: <20230522112058.2965866-1-talumbau@google.com> Subject: [PATCH mm-unstable 1/4] mm: multi-gen LRU: use macro for bitmap From: "T.J. Alumbaugh" To: Andrew Morton Cc: Yuanchu Xie , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mm@google.com, "T.J. Alumbaugh" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766594688106742268?= X-GMAIL-MSGID: =?utf-8?q?1766594688106742268?= Use DECLARE_BITMAP macro when possible. Signed-off-by: T.J. Alumbaugh Reviewed-by: David Hildenbrand Reviewed-by: Yuanchu Xie --- mm/vmscan.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index 4637f6462e9c..cf18873a36b9 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4144,7 +4144,7 @@ static void walk_pmd_range(pud_t *pud, unsigned long start, unsigned long end, unsigned long next; unsigned long addr; struct vm_area_struct *vma; - unsigned long bitmap[BITS_TO_LONGS(MIN_LRU_BATCH)]; + DECLARE_BITMAP(bitmap, MIN_LRU_BATCH); unsigned long first = -1; struct lru_gen_mm_walk *walk = args->private; From patchwork Mon May 22 11:20:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "T.J. Alumbaugh" X-Patchwork-Id: 97321 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1376586vqo; Mon, 22 May 2023 04:33:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4dx2V6H9XICoKF6uGaEXMCo+RRFZWE/0XcjRj48QR7FCdU6DCKE0PNhKiBMcIDryWynPU7 X-Received: by 2002:a05:6a00:2d90:b0:64d:2487:5b3c with SMTP id fb16-20020a056a002d9000b0064d24875b3cmr13658637pfb.29.1684755231782; Mon, 22 May 2023 04:33:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684755231; cv=none; d=google.com; s=arc-20160816; b=VYW3hekqjIQ1EBZRS3P1n80NtvJ+x2Hd5suZi7ML2DeAeElYxY0O8DI2jlzSYIUJL/ YWosUROE9PSgHrANt0RF7VUnD9zdVoRswbE+ExLXs0sZPMwQCDtj2MXmwD9/wo2mY6yX Um+sJTY6Oeoqylv8d9MLWGcwc8q2uVi31Zfp/6kH7Hgpn90N6MagvtDHBHXdklkR3QVz Eaones9wM+07943KmS6+BNy5H7bvYV/Jy+9sV6KmmU1ponaI7MtOLu3xfvudhTRzZLWQ IBqofk9fofEUKfhIKuLlCgbNjuMDwfB3dxIGegyVLVH/6UigBkEN3mNvKNXw868MQ5oU RxqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=o+eiSCYBIOLnXleM2cPLS0kmVbYB4sF65U+Csvbg0Lg=; b=tLxasMCm37l6AgdUUMYlalSMUfFg3yb1H58MQqtfPdSNMGHujARC4nm/a2y+uVPhl5 Nzda76LH5xtALpJc3tZ2B+wAk8rPR/zRJIDGMLpG0ZplgrkgD4WwhZTpBGouPUcJtsTE SvVLP78mfif2nF0Ai/JiGybPoDABoYESH4yDcCglRV0t8CAJVQRO6YUC2C4yUMqoXAyG /kfQqcbkHVpPzj8sr7cGF/ltnMDXXPeKakD6bN+xsU50pSHyrrRLkaUeYKm3u6pi5lUX mTJFPgIxMT/Y0j91M4Ks+pdOcYSYve+bRAcZaQVMJOCvuB54G8vsMF8kCQyps+1msogX P7ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=C9EG5Wbh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b141-20020a621b93000000b0064762d151fcsi4553842pfb.183.2023.05.22.04.33.39; Mon, 22 May 2023 04:33:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=C9EG5Wbh; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232730AbjEVLZ2 (ORCPT + 99 others); Mon, 22 May 2023 07:25:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38192 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233322AbjEVLY3 (ORCPT ); Mon, 22 May 2023 07:24:29 -0400 Received: from mail-il1-x149.google.com (mail-il1-x149.google.com [IPv6:2607:f8b0:4864:20::149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7390D1FE5 for ; Mon, 22 May 2023 04:21:17 -0700 (PDT) Received: by mail-il1-x149.google.com with SMTP id e9e14a558f8ab-3379306f979so44383325ab.2 for ; Mon, 22 May 2023 04:21:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684754473; x=1687346473; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=o+eiSCYBIOLnXleM2cPLS0kmVbYB4sF65U+Csvbg0Lg=; b=C9EG5Wbh8NAca3HjpjmAkkfiJOSWePs85XQ0SpLIeqp8Y36SY1afe0SjxeJrOVPo6f rSTwoLESGNR9S18BZs0XrVxCYBqlhtSsvsgR2iojCBGnj54TMjYktW5nrViLzni0xpfL tpHduilcVggl7fPEhrjrec8kFcN7FgXLx/UQvnavGFY3ToTtVRLe8AuaepJNGO46Xg3W PKmykBBAg2AmrTeW/xVoMYteYDYOJK3FGm+N6bAky/KArU7NP7tyEyOOlhPbM/CDmkkw LJm5ghP/vmQqL+HKiYE2ccHd75NzsmQ8g1/MPJePiH2Y7A0qOXy9H2rvvWXwRBzzaq6i gJHg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684754473; x=1687346473; 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=o+eiSCYBIOLnXleM2cPLS0kmVbYB4sF65U+Csvbg0Lg=; b=i8sUGI+VroEHn3LYDDeCykR9G2yPZ9ZGkUUrUlb+8Nl8pD2EEufeVeGXBgTw4ArlTn lRCNRFKz7FxOL5z5gr6CUAWqenBlfjCjW1EgFWK7n1tHOUjOVawUdASsQwaaQnWO1rRb Ex14fkVTFmnEcJzlt6sHRfCgpaNEY48ZAUGqUoL8C4aIJpZ9+vZWCgafzeSESlZ7GRlM 38RZy9nY0iW5d0jmnVtnO2eO13YDElUOitlWSPK5SQpuL3OWu3tLNDLSRSA4KYDBVKNh PvIpQW6VHauBuEUky1aDbm+NOa9ypoXS33sxM2RHu2qfuMpahptOQSJtjUEWJCQrQOnw MtSw== X-Gm-Message-State: AC+VfDxS6ENp2V1QKJFKI4P+Uy2RrIoDOM9lGpWCXl47VFKWqtPzdNoQ wFHz8V9T5L+B/IuQrFuOXs/26+ko6EHU6Q== X-Received: from talumbau.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:90d]) (user=talumbau job=sendgmr) by 2002:a92:de0c:0:b0:335:de72:23c7 with SMTP id x12-20020a92de0c000000b00335de7223c7mr5716366ilm.5.1684754473156; Mon, 22 May 2023 04:21:13 -0700 (PDT) Date: Mon, 22 May 2023 11:20:56 +0000 In-Reply-To: <20230522112058.2965866-1-talumbau@google.com> Mime-Version: 1.0 References: <20230522112058.2965866-1-talumbau@google.com> Message-ID: <20230522112058.2965866-2-talumbau@google.com> Subject: [PATCH mm-unstable 2/4] mm: multi-gen LRU: cleanup lru_gen_soft_reclaim() From: "T.J. Alumbaugh" To: Andrew Morton Cc: Yuanchu Xie , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mm@google.com, "T.J. Alumbaugh" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766593902299286978?= X-GMAIL-MSGID: =?utf-8?q?1766593902299286978?= lru_gen_soft_reclaim() gets the lruvec from the memcg and node ID to keep a cleaner interface on the caller side. Signed-off-by: T.J. Alumbaugh Reviewed-by: Yuanchu Xie --- include/linux/mmzone.h | 4 ++-- mm/memcontrol.c | 2 +- mm/vmscan.c | 4 +++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h index 3a68326c9989..5a7ada0413da 100644 --- a/include/linux/mmzone.h +++ b/include/linux/mmzone.h @@ -534,7 +534,7 @@ void lru_gen_exit_memcg(struct mem_cgroup *memcg); void lru_gen_online_memcg(struct mem_cgroup *memcg); void lru_gen_offline_memcg(struct mem_cgroup *memcg); void lru_gen_release_memcg(struct mem_cgroup *memcg); -void lru_gen_soft_reclaim(struct lruvec *lruvec); +void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid); #else /* !CONFIG_MEMCG */ @@ -585,7 +585,7 @@ static inline void lru_gen_release_memcg(struct mem_cgroup *memcg) { } -static inline void lru_gen_soft_reclaim(struct lruvec *lruvec) +static inline void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid) { } diff --git a/mm/memcontrol.c b/mm/memcontrol.c index d31fb1e2cb33..738ba18f3a0c 100644 --- a/mm/memcontrol.c +++ b/mm/memcontrol.c @@ -485,7 +485,7 @@ static void mem_cgroup_update_tree(struct mem_cgroup *memcg, int nid) if (lru_gen_enabled()) { if (soft_limit_excess(memcg)) - lru_gen_soft_reclaim(&memcg->nodeinfo[nid]->lruvec); + lru_gen_soft_reclaim(memcg, nid); return; } diff --git a/mm/vmscan.c b/mm/vmscan.c index cf18873a36b9..e088db138f5f 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -4846,8 +4846,10 @@ void lru_gen_release_memcg(struct mem_cgroup *memcg) } } -void lru_gen_soft_reclaim(struct lruvec *lruvec) +void lru_gen_soft_reclaim(struct mem_cgroup *memcg, int nid) { + struct lruvec *lruvec = get_lruvec(memcg, nid); + /* see the comment on MEMCG_NR_GENS */ if (lru_gen_memcg_seg(lruvec) != MEMCG_LRU_HEAD) lru_gen_rotate_memcg(lruvec, MEMCG_LRU_HEAD); From patchwork Mon May 22 11:20:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "T.J. Alumbaugh" X-Patchwork-Id: 97322 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1381300vqo; Mon, 22 May 2023 04:42:52 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6k4FZBTX1nvuBpWD93sNbSy6ftEf/ezXfQ/B1kWJrQBKsnElJRPOeXEJJu+BYguBfiZY4c X-Received: by 2002:a05:6a20:7485:b0:102:3f67:dbe1 with SMTP id p5-20020a056a20748500b001023f67dbe1mr11470188pzd.4.1684755772418; Mon, 22 May 2023 04:42:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684755772; cv=none; d=google.com; s=arc-20160816; b=WZ1MbN6kfmBuDnw3di+dS7GzEL8h3sSSQXVZnrHPlEqQhQCDCTWiojpoNC0G4LXNtz m/jLb4Gjcdpk8Jslh6Bzc9GLPRNPtjzvLmu+fQzvaZQogxdn8mySG5wlJKGghehx0Bbg k5QUKvL/vvCfNeKQ2dCoBbuZk9kNzgxnTwCmE/Upn9zl3zK3PLFFeUikC0WCccHfwPCW p7GSyNy00IAVOli1uI4VXifZ+g5Ic3Zt0mz3wHHjrek9QtL+SznW8Nfe87pfvX58ijTZ YTfnqSNR74SUzyPdlcrvhSZem9CIPDB1N1rjoX+ML92sqjJmPHZkCLBk5FnVq/HSie2O 98IA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=kdK6cg22OO4qOyQXs9xKaUltuTOUFz6FCWZwVxCh2Hw=; b=MeMtkP41KnxW5/Cjd+UFMgB36d4F4h8SkZtZMNExdBlRyjgmR+hlVBJrCl5oQgvdHB fYwj8V271d4AZQqXcQ7WzVsbG8jEFW+Mj+lfytKnVoRAYr7/TtiRBWcGZ8IDILOjGuPv swg/zbzaN9kTDmPq00xAe6hvTKmTHLHnAmB0PTke46v2nn4h6+hwEP7sPjcV0mD/mCIq R0jePBlBOpq+KbBgP8u7NCZv+wO6qagAFLI01hrkshDqG5p5gjtpdELIEJtnZEGbte6M rAyaffHVGAwYs4SNmG6VXKGCCXcXmulxh3K2z8LJR/ZYSRGhLdttlGgn3QLubsP6Cgjp 7ykg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=qWkhlrfi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id 71-20020a63004a000000b00528519a4371si4637278pga.516.2023.05.22.04.42.37; Mon, 22 May 2023 04:42:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=qWkhlrfi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233148AbjEVLZi (ORCPT + 99 others); Mon, 22 May 2023 07:25:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230378AbjEVLYb (ORCPT ); Mon, 22 May 2023 07:24:31 -0400 Received: from mail-yb1-xb49.google.com (mail-yb1-xb49.google.com [IPv6:2607:f8b0:4864:20::b49]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80D25E7B for ; Mon, 22 May 2023 04:21:19 -0700 (PDT) Received: by mail-yb1-xb49.google.com with SMTP id 3f1490d57ef6-ba2b9ecfadaso11578270276.2 for ; Mon, 22 May 2023 04:21:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684754474; x=1687346474; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=kdK6cg22OO4qOyQXs9xKaUltuTOUFz6FCWZwVxCh2Hw=; b=qWkhlrfibgnL4RhQHj7B1l6RBrzRaJLlA4S+q3+9iSaHf1FoZjrbjIeox0pMD4akA6 baQ7YGto4El4LBM0QVJP4cql3S/UP2QCxjMxcH7zZ5WU2ZmYY0a2LN1Q9hftLvUgx6xY uXUXdOY22m4wBBpuN+E+S8/WR8wVUIBuOpCWW0NW5nnfixtNx9Op2M4J0Eea727f7z1S sf3g9TCIQtAIo4Vtb/9RoX4qfTdUkuWDMiPRz3BajpDxdF5yZCBeE2pRNa/l/Mg0f+eq /DBmBGIyvEk0YXmD4u8BuGDulx27iox/80TqcG8JU2bBdNBSanhjgzZa8EFs7/ImsyhS /GFA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684754474; x=1687346474; 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=kdK6cg22OO4qOyQXs9xKaUltuTOUFz6FCWZwVxCh2Hw=; b=BIX6zw6jkcb84Ng5Dcdeh/bV0y6kX/xQVpANRGTVnrC1NfbDbyp3pRnlY5D4knzGy1 zlIhMIQTFujYUDeQKk6kUcwvnSF6O6RdhkGdieWRNPzyxme++l7VeW7yrX4qIGGh3kNZ lrnKQO/glQz3sBxTunHwaew9ZQKliWO8R2QftUwUdkKQyilFjS92iJPCLT6bVrkRAfgU Lb+hOEiQjIrD27Lk/nlK8zThEEEVoH3TgCdD4PGxlafQmi/LbJ7FXCp4KO9h8AHOzm2y HYtIpobCw6P7ENwqbHdW9SDaweAt0YiQICmXbPvF5VVi0S3Z81eXkJzXmwr/XircPKhp Bhsw== X-Gm-Message-State: AC+VfDy38xZdrQ3wZ8bCl6AYTucds4XpNhX23inIqHbgS6kEMcZU7qlj 0ytpBXbZJK8X719KL/kZ0IQ1lxkX8Au83g== X-Received: from talumbau.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:90d]) (user=talumbau job=sendgmr) by 2002:a05:6902:56b:b0:ba8:91c2:268a with SMTP id a11-20020a056902056b00b00ba891c2268amr6184995ybt.0.1684754474384; Mon, 22 May 2023 04:21:14 -0700 (PDT) Date: Mon, 22 May 2023 11:20:57 +0000 In-Reply-To: <20230522112058.2965866-1-talumbau@google.com> Mime-Version: 1.0 References: <20230522112058.2965866-1-talumbau@google.com> Message-ID: <20230522112058.2965866-3-talumbau@google.com> Subject: [PATCH mm-unstable 3/4] mm: multi-gen LRU: add helpers in page table walks From: "T.J. Alumbaugh" To: Andrew Morton Cc: Yuanchu Xie , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mm@google.com, "T.J. Alumbaugh" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766594468360653305?= X-GMAIL-MSGID: =?utf-8?q?1766594468360653305?= Add helpers to page table walking code: - Clarifies intent via name "should_walk_mmu" and "should_clear_pmd_young" - Avoids repeating same logic in two places Signed-off-by: T.J. Alumbaugh Reviewed-by: Yuanchu Xie --- mm/vmscan.c | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/mm/vmscan.c b/mm/vmscan.c index e088db138f5f..ad0f589d32e6 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -3234,6 +3234,16 @@ DEFINE_STATIC_KEY_ARRAY_FALSE(lru_gen_caps, NR_LRU_GEN_CAPS); #define get_cap(cap) static_branch_unlikely(&lru_gen_caps[cap]) #endif +static bool should_walk_mmu(void) +{ + return arch_has_hw_pte_young() && get_cap(LRU_GEN_MM_WALK); +} + +static bool should_clear_pmd_young(void) +{ + return arch_has_hw_nonleaf_pmd_young() && get_cap(LRU_GEN_NONLEAF_YOUNG); +} + /****************************************************************************** * shorthand helpers ******************************************************************************/ @@ -4098,7 +4108,7 @@ static void walk_pmd_range_locked(pud_t *pud, unsigned long addr, struct vm_area goto next; if (!pmd_trans_huge(pmd[i])) { - if (arch_has_hw_nonleaf_pmd_young() && get_cap(LRU_GEN_NONLEAF_YOUNG)) + if (should_clear_pmd_young()) pmdp_test_and_clear_young(vma, addr, pmd + i); goto next; } @@ -4191,7 +4201,7 @@ static void walk_pmd_range(pud_t *pud, unsigned long start, unsigned long end, #endif walk->mm_stats[MM_NONLEAF_TOTAL]++; - if (arch_has_hw_nonleaf_pmd_young() && get_cap(LRU_GEN_NONLEAF_YOUNG)) { + if (should_clear_pmd_young()) { if (!pmd_young(val)) continue; @@ -4493,7 +4503,7 @@ static bool try_to_inc_max_seq(struct lruvec *lruvec, unsigned long max_seq, * handful of PTEs. Spreading the work out over a period of time usually * is less efficient, but it avoids bursty page faults. */ - if (!arch_has_hw_pte_young() || !get_cap(LRU_GEN_MM_WALK)) { + if (!should_walk_mmu()) { success = iterate_mm_list_nowalk(lruvec, max_seq); goto done; } @@ -5730,10 +5740,10 @@ static ssize_t enabled_show(struct kobject *kobj, struct kobj_attribute *attr, c if (get_cap(LRU_GEN_CORE)) caps |= BIT(LRU_GEN_CORE); - if (arch_has_hw_pte_young() && get_cap(LRU_GEN_MM_WALK)) + if (should_walk_mmu()) caps |= BIT(LRU_GEN_MM_WALK); - if (arch_has_hw_nonleaf_pmd_young() && get_cap(LRU_GEN_NONLEAF_YOUNG)) + if (should_clear_pmd_young()) caps |= BIT(LRU_GEN_NONLEAF_YOUNG); return sysfs_emit(buf, "0x%04x\n", caps); From patchwork Mon May 22 11:20:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "T.J. Alumbaugh" X-Patchwork-Id: 97327 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp1385671vqo; Mon, 22 May 2023 04:51:28 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5BpdGYjn5GDUDRFZjz9ag48k6HIdJrJZ8+eHMql8Ekju4b0wlsav4S3aij47u/CsHHhd3m X-Received: by 2002:a05:6a00:2e01:b0:64d:3fb3:9ed9 with SMTP id fc1-20020a056a002e0100b0064d3fb39ed9mr11992050pfb.23.1684756288240; Mon, 22 May 2023 04:51:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1684756288; cv=none; d=google.com; s=arc-20160816; b=WQehHc+ajnmdHjhPpP5Hhujq0ONfCgLfql7tR3MkWFEXpauCB5iRbXNEAK98sBczDD a6HofH8jrMEtO9P6RjzKY/eVkZ2cWduD19HvUKTOeEBk+KR196eJ65Zqy8/cIGvgtbJ6 rHUhICTN8SR7ytNjQT9SlOrD/yvCd3xnR1c7SCIqnZHc0+LgoKrHmM3CvLtJsGIRJhlR gY/FOLuHG56djZAPQh9qdnRPjqRmR8OpuDf+KQXUKF9rYtS0Idx1ljl9R3VJqHYkE9xM nAE73gdUKrRpToALg1sLhG7Uqtc4ysPfv1oUR+n61QiMUAxPMINk+7TyXoJRS++ZIq1E th8A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:dkim-signature; bh=cIw0V38F7EAw1HDE4zn4HtkfS4SFwenBLbiqkZiF2tk=; b=vkcXTaA8wcVnGyiqd0mnqi1YCdhlPG0IjJaQ5zyAhxb9+DKW2efZyCIolCmYIXO8JF g9GW1Tx2adkMumFD6RFbAR29KhJjDoVfX1V0wpC0k2unBhfbKB39zje4qmlop2m7XrAv Wh8VLoBHpDqqfGLSt6WZI1yUTE7OpeCsmTMrd9WTBpT9Z/PhfE3aqG8MJrUmuW75EOZC cS9+/i5S9+j99wJrd+ltWPUrhYyP2+vq/ZnM0/ek6UNPeAvbIfpfb9qdlMEVNZCoKQGD 2TU+WbizEAoqOoHu9BLOLek01mJSGAefgoWV5f2XvS8GiJufqU67cggLo+f8Qw5er7u0 LJpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6rDOmfXO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z28-20020aa79f9c000000b00625e7f9b859si3111540pfr.339.2023.05.22.04.51.13; Mon, 22 May 2023 04:51:28 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20221208 header.b=6rDOmfXO; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232900AbjEVLZb (ORCPT + 99 others); Mon, 22 May 2023 07:25:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38258 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232775AbjEVLYc (ORCPT ); Mon, 22 May 2023 07:24:32 -0400 Received: from mail-yw1-x1149.google.com (mail-yw1-x1149.google.com [IPv6:2607:f8b0:4864:20::1149]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D8D01FE6 for ; Mon, 22 May 2023 04:21:21 -0700 (PDT) Received: by mail-yw1-x1149.google.com with SMTP id 00721157ae682-564fb1018bcso21153957b3.0 for ; Mon, 22 May 2023 04:21:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20221208; t=1684754475; x=1687346475; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=cIw0V38F7EAw1HDE4zn4HtkfS4SFwenBLbiqkZiF2tk=; b=6rDOmfXOGOL1GW8BHq1lsmAkzsCgxjIn29uj6ZLID+SRaLqHrhM5DOXLA1DCB4iRhy a6Sk9ssRLW1lIRe1a08AwxJ0BAccFa/CgrcwVovKZQUfGQmd6jJ0qQPWDFU52nTje6Ve 1q24H2eJS6v/mPNZCYJE19c+FSpEKqVmHIn36QwkuInYq6A35uygUpQ6n7qaQFOqi+vd GFbbq8j/7Gls9AgbMdbyd1j1SVhiG2e54nQdxqL740BwFA6P/sWV6/odg2s/pJ3Q699D 5fHgG36i7bIXayaCDGk3RAO3su0zKcjC2JqYEecZCpk/VU295hRYwRTPKyfriu/y5jff zXAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1684754475; x=1687346475; 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=cIw0V38F7EAw1HDE4zn4HtkfS4SFwenBLbiqkZiF2tk=; b=Md1jMwKvCOto2kXFvI411BQlWXlNhTR5Li2pnJOHWD8XUlfuTB9cbOVKI8Dw2Trm0v wI5h8oV5+VFs5YhP7zO30apuaNpJZpP5O6Hj0YLUv2HvgEVH7cgsEyhcvTwEjFMPJDZx UY+rxeMCntC5pqR2NOSbMhZx1esywbbD91iqlaODoFM3M6+7Rf938E8l1GKJZ1u3Frc5 p3pHR2J6XeyNOsccOdPtAgjn6NfkFeJk7Apfw7A6K6Q3InV98rrlBzVvkL9of8IacHye wSXKl35R5iptGciE7FtH2Hvhuy6jOXkEPThVtkasWlCxuLV9c7XE4fojM0NqqCXKc9W8 q5xQ== X-Gm-Message-State: AC+VfDzCUXG+DDQv4L7Gj+xqHm9H6SPGv6DohSOWsPyATKJV9HOWdDsP XqW8as8xm3ax/VVdM1rbzlX0y2JHzbazRA== X-Received: from talumbau.c.googlers.com ([fda3:e722:ac3:cc00:2b:ff92:c0a8:90d]) (user=talumbau job=sendgmr) by 2002:a81:dc01:0:b0:561:c98b:8e8e with SMTP id h1-20020a81dc01000000b00561c98b8e8emr6749837ywj.10.1684754475539; Mon, 22 May 2023 04:21:15 -0700 (PDT) Date: Mon, 22 May 2023 11:20:58 +0000 In-Reply-To: <20230522112058.2965866-1-talumbau@google.com> Mime-Version: 1.0 References: <20230522112058.2965866-1-talumbau@google.com> Message-ID: <20230522112058.2965866-4-talumbau@google.com> Subject: [PATCH mm-unstable 4/4] mm: multi-gen LRU: cleanup lru_gen_test_recent() From: "T.J. Alumbaugh" To: Andrew Morton Cc: Yuanchu Xie , Yu Zhao , linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-mm@google.com, "T.J. Alumbaugh" X-Spam-Status: No, score=-9.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1766595009494383106?= X-GMAIL-MSGID: =?utf-8?q?1766595009494383106?= Avoid passing memcg* and pglist_data* to lru_gen_test_recent() since we only use the lruvec anyway. Signed-off-by: T.J. Alumbaugh Reviewed-by: Yuanchu Xie --- mm/workingset.c | 46 ++++++++++++++++------------------------------ 1 file changed, 16 insertions(+), 30 deletions(-) diff --git a/mm/workingset.c b/mm/workingset.c index 90ae785d4c9c..5796e927e6d7 100644 --- a/mm/workingset.c +++ b/mm/workingset.c @@ -257,59 +257,46 @@ static void *lru_gen_eviction(struct folio *folio) /* * Tests if the shadow entry is for a folio that was recently evicted. - * Fills in @memcgid, @pglist_data, @token, @workingset with the values - * unpacked from shadow. + * Fills in @lruvec, @token, @workingset with the values unpacked from shadow. */ -static bool lru_gen_test_recent(void *shadow, bool file, int *memcgid, - struct pglist_data **pgdat, unsigned long *token, bool *workingset) +static bool lru_gen_test_recent(void *shadow, bool file, struct lruvec **lruvec, + unsigned long *token, bool *workingset) { - struct mem_cgroup *eviction_memcg; - struct lruvec *lruvec; - struct lru_gen_folio *lrugen; + int memcg_id; unsigned long min_seq; + struct mem_cgroup *memcg; + struct pglist_data *pgdat; - unpack_shadow(shadow, memcgid, pgdat, token, workingset); - eviction_memcg = mem_cgroup_from_id(*memcgid); + unpack_shadow(shadow, &memcg_id, &pgdat, token, workingset); - lruvec = mem_cgroup_lruvec(eviction_memcg, *pgdat); - lrugen = &lruvec->lrugen; + memcg = mem_cgroup_from_id(memcg_id); + *lruvec = mem_cgroup_lruvec(memcg, pgdat); - min_seq = READ_ONCE(lrugen->min_seq[file]); + min_seq = READ_ONCE((*lruvec)->lrugen.min_seq[file]); return (*token >> LRU_REFS_WIDTH) == (min_seq & (EVICTION_MASK >> LRU_REFS_WIDTH)); } static void lru_gen_refault(struct folio *folio, void *shadow) { int hist, tier, refs; - int memcg_id; bool workingset; unsigned long token; - unsigned long min_seq; struct lruvec *lruvec; struct lru_gen_folio *lrugen; - struct mem_cgroup *memcg; - struct pglist_data *pgdat; int type = folio_is_file_lru(folio); int delta = folio_nr_pages(folio); rcu_read_lock(); - if (!lru_gen_test_recent(shadow, type, &memcg_id, &pgdat, &token, - &workingset)) + if (!lru_gen_test_recent(shadow, type, &lruvec, &token, &workingset)) goto unlock; - memcg = folio_memcg_rcu(folio); - if (memcg_id != mem_cgroup_id(memcg)) + if (lruvec != folio_lruvec(folio)) goto unlock; - if (pgdat != folio_pgdat(folio)) - goto unlock; - - lruvec = mem_cgroup_lruvec(memcg, pgdat); lrugen = &lruvec->lrugen; - min_seq = READ_ONCE(lrugen->min_seq[type]); - hist = lru_hist_from_seq(min_seq); + hist = lru_hist_from_seq(READ_ONCE(lrugen->min_seq[type])); /* see the comment in folio_lru_refs() */ refs = (token & (BIT(LRU_REFS_WIDTH) - 1)) + workingset; tier = lru_tier_from_refs(refs); @@ -339,8 +326,8 @@ static void *lru_gen_eviction(struct folio *folio) return NULL; } -static bool lru_gen_test_recent(void *shadow, bool file, int *memcgid, - struct pglist_data **pgdat, unsigned long *token, bool *workingset) +static bool lru_gen_test_recent(void *shadow, bool file, struct lruvec **lruvec, + unsigned long *token, bool *workingset) { return false; } @@ -435,8 +422,7 @@ bool workingset_test_recent(void *shadow, bool file, bool *workingset) unsigned long eviction; if (lru_gen_enabled()) - return lru_gen_test_recent(shadow, file, &memcgid, &pgdat, &eviction, - workingset); + return lru_gen_test_recent(shadow, file, &eviction_lruvec, &eviction, workingset); unpack_shadow(shadow, &memcgid, &pgdat, &eviction, workingset); eviction <<= bucket_order;