Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp3913604rdg; Wed, 18 Oct 2023 09:22:37 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHB39wOgDEc3ay9pCdL5eho3FpHkEMnqny+YILQuCIZUZU2QThlEBxgAmo1+YKL2PmQZAh/ X-Received: by 2002:a17:903:25c4:b0:1c4:4a4d:cc6 with SMTP id jc4-20020a17090325c400b001c44a4d0cc6mr6569494plb.19.1697646157450; Wed, 18 Oct 2023 09:22:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697646157; cv=none; d=google.com; s=arc-20160816; b=tQyDXGR5sSvpnU6vIL+BAA/QtZ6ZBjVWTA2eRwIbAzq/HGvSALarBTT/9Asae/7oPU uXVelHFtKHFi9XhsAgS7K6ehja5RpmWqXlN+O/X20G/Cu+7XPFgwUf/d/2K+/Jwc3/0g YW6lE4DbMMoyr1i2N98XuRgG5BGHLTFob4mZ4SbEWZDxmIkBGlfB9RM6DOc4z3gQANjv AIQglzzXHlk7i69QStAYKN1bGnelFLuKtx4PzRjA8PDrzVzCO/BqfuqHhx+7AUjrILHW bRLCfyfCNH1EbZLX278m9V/uA+X4aChHQ6VB2lpnJBt9gBhysJb4tbyDvral7+tTFd1f OvZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=1ESBoSu0Q2kOoNHH1TTBfnX4/YG198ciywvQbN8v9rE=; fh=jfR20WYMgw/vpXQgdotbm6NAUhAmJsddpKY69E2csls=; b=buecao5Xyk+3yC9l1D5Rj9IoVFuX8IZusvxnzGcTwF4yHFcKYeawu4Dse80sI0oA4K R/8IL0Nnnvc0C4BBVKZS6G5k8CQft8t04vx3izSiWBTQk+nvwfK4DJX87V5ErWGrMd7b 2A3IjELnKk8lk7twWsZIaAmobfbLxrsoem9g/o+KzepNc9NZRRdiBbaLqG/SuldrRTa4 qa07+Ped5j+b9p4WUsAPX/ysUKxkh3DLIffpz/VQQncvNzx71Uy3EbjtmuAd3jdKu9jG OPn8Z7lQ2jcPZ7tuTiAniw9fso7wIDXspeMFUGB3UVcxyEJRwZQGb5k/3qRRbRUylMAA KkFg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qAkKjpQY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id k9-20020a170902c40900b001bf1d1d99b0si176831plk.568.2023.10.18.09.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Oct 2023 09:22:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=qAkKjpQY; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 178DC80D88CF; Wed, 18 Oct 2023 09:22:35 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230148AbjJRQW3 (ORCPT + 99 others); Wed, 18 Oct 2023 12:22:29 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48254 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229900AbjJRQW1 (ORCPT ); Wed, 18 Oct 2023 12:22:27 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B43019F for ; Wed, 18 Oct 2023 09:22:25 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-419b53acc11so296651cf.0 for ; Wed, 18 Oct 2023 09:22:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1697646145; x=1698250945; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=1ESBoSu0Q2kOoNHH1TTBfnX4/YG198ciywvQbN8v9rE=; b=qAkKjpQYe9q7oGFfKOnW7ZwiMksJrbGIpxRFd6Anm6Vb23Y6QBXxgGhdlkhfRNZRMO qDgJ3XYNbPJqav4D/Q+XDYO5hSCzU5SNv4MYpLtyHEjdsCQhMFVguzQ66ikmIiK/d12O vvyJXFqqJXxfElT7vW5s8b1gcORAaTmZe8caGIYq/oI4d84ds5w8Wfj1/WqC8iRaECUj qZPgUv8MBkS83XmS+oChcmjyTdF0pNkR20hOYqxUu6giqPePxyvyIP3Ic/vqngEjOEuS pGcVDaxEIGmqLmwQPc+z7eMLtGEXheIoSDz7/fCTvb1H/eUYh+BeedpyniaHVNJd1tQU sajA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697646145; x=1698250945; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=1ESBoSu0Q2kOoNHH1TTBfnX4/YG198ciywvQbN8v9rE=; b=Q+/s/hQiPD8TSlVIhHy/4JzHnM07wOzVpn7vpikWyFGvodEJB9NcDk1oDU2cFSK1F0 KiW2r/a+4AqjTErOvrGCYs4zNuCjV/UsuEB7ddk7xQiKvwV+oln/fnDe7WNGikQtr2fP GYSm4+ByeUmU4Z0DmFyh2Ukaoyb5G9DQQolG0d1uW9ynjexVtR4vWNBaR+GqYdf2BVzM kSOA9B4BHtv4k4kN3EmtJttcCQETZQsZ+yV7RpeDdrZIVl61FxGgH65RYe2gTgE516NR 2oA8PM9D2qxbH7EveXg5ZE3x6DDR/bLF0LZy7M/ESHMU4rQOlHq33UcmJTC+bsPbMfV7 OTcg== X-Gm-Message-State: AOJu0YwzRpfyrXWuTjJ2gnzXQ8rIVhp6RUw3tdYtrIn2d48MB2U0I5QF 26O0VUj6XgSR9v67zS/ZhNz97RRNe3H+CRdf1noAIrZbrli9rJTh6mu18w== X-Received: by 2002:a05:622a:7711:b0:41c:375b:81a3 with SMTP id ki17-20020a05622a771100b0041c375b81a3mr321200qtb.18.1697646144607; Wed, 18 Oct 2023 09:22:24 -0700 (PDT) MIME-Version: 1.0 References: <20231018082104.3918770-1-link@vivo.com> <20231018082104.3918770-3-link@vivo.com> In-Reply-To: <20231018082104.3918770-3-link@vivo.com> From: Yu Zhao Date: Wed, 18 Oct 2023 10:21:47 -0600 Message-ID: Subject: Re: [PATCH 2/2] mm: multi-gen lru: fix stat count To: Huan Yang Cc: Steven Rostedt , Masami Hiramatsu , Andrew Morton , Suren Baghdasaryan , Vlastimil Babka , linux-kernel@vger.kernel.org, linux-trace-kernel@vger.kernel.org, linux-mm@kvack.org, bpf@vger.kernel.org, opensource.kernel@vivo.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 18 Oct 2023 09:22:35 -0700 (PDT) On Wed, Oct 18, 2023 at 2:22=E2=80=AFAM Huan Yang wrote: > > For multi-gen lru reclaim in evict_folios, like shrink_inactive_list, > gather folios which isolate to reclaim, and invoke shirnk_folio_list. > > But, when complete shrink, it not gather shrink reclaim stat into sc, > we can't get info like nr_dirty\congested in reclaim, and then > control writeback, dirty number and mark as LRUVEC_CONGESTED, or > just bpf trace shrink and get correct sc stat. > > This patch fix this by simple copy code from shrink_inactive_list when > end of shrink list. MGLRU doesn't try to write back dirt file pages in the reclaim path -- it filters them out in sort_folio() and leaves them to the page writeback. (The page writeback is a dedicated component for this purpose). So there is nothing to fix.