Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp1876123rwl; Thu, 30 Mar 2023 02:46:12 -0700 (PDT) X-Google-Smtp-Source: AKy350ZYJJI/PWNu8R6pE3gL65ApGrsaFulbfqwyW18fVzsgLKI5gDMh9LcB/lTwuEpIAadFqWaA X-Received: by 2002:a17:906:207:b0:933:23c4:820b with SMTP id 7-20020a170906020700b0093323c4820bmr1336516ejd.4.1680169572153; Thu, 30 Mar 2023 02:46:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680169572; cv=none; d=google.com; s=arc-20160816; b=QP1GYsH2XIC3Wl/Ro7vTq6RoRQhc7eR/qRYjBaG8SYfrkbmqke7m5p9M2hcjf46ZoF ijx8mrJncD/aVVAXmxCELP1yb37gA2UEI8ciHWbF9B5maF4cjV3gkxqhVjj4urjYS66y Nh9LVQ0njfZggy3fpnYAK8obMmeo/+mkzaYLw0mtoUyZZk9psvgeCz01B6p49EHhBjEr 1yeXEhyV7HJ17EMswjOthFvuaG348jtuuZQSZq3vhSkC2o0K1UAfgtNpLX7Nq/ybkkx4 GR+sUr930K2AUExzu1/5SSjE6VMBLS6iD4x7a37gLXuIi5GG9S27x5UC0CBJ9of9Vvs9 1tGw== 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=8k+ftPu1pOQhWJUqmpZoNXnka9ZSxidu9TmOjrsgsRc=; b=x5HePgGudP9n0MZ6RRq6ZVyv06ilQVg22dRprkLiHEBRiQ47qV5R6CUSr1fFbTNXD4 FFHC6qkmgiDGBl5UyQpNWNzTGc0qMeJQi5m8P2pRKkF5b53TxZ4wnqn7/NLIdqeOoyms EV+RWq1U1tv4Q4oZI2IXwe3yJpIHECmwyCc4idVOLnr7M6d4QNq0dvGtrlitG5Uf4q2O srTB+i3nfuU57jKmkBK32ta1hCw5poGYo8sBk/HFuU0dQ1i4wtH4BcmzdyQqiNXvWb0F /hF4w7cuNCU0txT8IlWMVUrBdMv2t6wlfynuiAA2SBfGrQ5jQwFPW0/+D8Zwu7ofeyIJ Xa0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=ImBZjcN6; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id fy31-20020a1709069f1f00b009327a2315a7si890498ejc.470.2023.03.30.02.45.47; Thu, 30 Mar 2023 02:46:12 -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=@gmail.com header.s=20210112 header.b=ImBZjcN6; 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=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229933AbjC3JmX (ORCPT + 99 others); Thu, 30 Mar 2023 05:42:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39474 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229585AbjC3JmU (ORCPT ); Thu, 30 Mar 2023 05:42:20 -0400 Received: from mail-lf1-x12a.google.com (mail-lf1-x12a.google.com [IPv6:2a00:1450:4864:20::12a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EF4756E93 for ; Thu, 30 Mar 2023 02:42:18 -0700 (PDT) Received: by mail-lf1-x12a.google.com with SMTP id x17so23754284lfu.5 for ; Thu, 30 Mar 2023 02:42:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1680169337; 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=8k+ftPu1pOQhWJUqmpZoNXnka9ZSxidu9TmOjrsgsRc=; b=ImBZjcN6EHm/FQr3czBlAuWIJeVX+PlaicLsHzO61GZjBUXjieonAJsgRnFybWa2Sb tTxYFWfb2gllA7JO2j26JzZo4eJcepeWT2a8ab7uDhn5JGCXJo/ki/AASSeS6ho9KJ4Q y3HjCd9cS4iUpgnD1yIzv0QfV2lpRS2nrRQN5C/6hfScWU4BCfjIC+ge3hQ9GkPujLJq wyW7CxoUZrEYpSqpnRvJkLD8Ac7r7j4Wqz/2FHdvO88T1WJDZAwMdGa7ZFJHzViybs5b l4WNMWfM2uW9QCMIZRCV6JnZQ4Srk04esGEO8lKebnNlM07bhZNSakF0TPWP7BcZTSkh ehVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1680169337; 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=8k+ftPu1pOQhWJUqmpZoNXnka9ZSxidu9TmOjrsgsRc=; b=seLeVrTQsoDCPyscIUD8HNXHwZX1UnPV8/LCVQ9c3S4FuOsV7N0OlgSU8OMHdp3jBn qodvJ8zEHRDHj3JlZT3Br8Fm61kJuwhsx+UWwzK1j3Yr9dm2KoDrOaBj/7zPySF9BxQ7 0NONzx/CP4bGlRZr01hoTwbXKXNClgbChdWikKSfTEJogMi+yf3tnIz36u/6MCp0uKay a7F4BIJOlSnPFz9b6OThRqsmDAHWMejyd6SJk6J3QCd/m855v2OVhC5QBojKUON6Po74 ZDFWN59iq9nB6W5yapAj74rcxaEOfxrcNABEIu+yj34Lzo7kFsqBRSQdQSruUbSqkvNx w3GQ== X-Gm-Message-State: AAQBX9eWNCUah+ndzYjXqHmfN7JAp4QnQIImiWxrKlAWmaelMUFvqYcI FFbLnbnR7aapm1qUhDcdGBfEV+7kxdCsBTRVAZrrr5fu X-Received: by 2002:ac2:44d9:0:b0:4d5:ca42:e43b with SMTP id d25-20020ac244d9000000b004d5ca42e43bmr6463457lfm.4.1680169337074; Thu, 30 Mar 2023 02:42:17 -0700 (PDT) MIME-Version: 1.0 References: <1680086855-7989-1-git-send-email-zhaoyang.huang@unisoc.com> In-Reply-To: From: Zhaoyang Huang Date: Thu, 30 Mar 2023 17:41:55 +0800 Message-ID: Subject: Re: [PATCH] mm: mark folio as workingset in lru_deactivate_fn To: Johannes Weiner Cc: "zhaoyang.huang" , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-0.2 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS autolearn=unavailable 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 On Thu, Mar 30, 2023 at 5:32=E2=80=AFPM Johannes Weiner wrote: > > On Thu, Mar 30, 2023 at 09:38:48AM +0800, Zhaoyang Huang wrote: > > On Wed, Mar 29, 2023 at 10:55=E2=80=AFPM Johannes Weiner wrote: > > > > > > On Wed, Mar 29, 2023 at 06:47:35PM +0800, zhaoyang.huang wrote: > > > > From: Zhaoyang Huang > > > > > > > > folio will skip of being set as workingset in lru_deactivate_fn. > > > > > > Can you please elaborate why that's undesirable? What's the problem > > > you're fixing? > > If I am correct, folio will skip being set as workingset when moving > > from active lru to inactive lru, which is performed on every folio in > > shrink_active_list during normal reclaim. > > shrink_active_list directly calls folio_set_workingset(). The function > you're editing is used for things like MADV_COLD and truncate(). Yes. > > It sounds like there is just a misunderstanding of the code, not an > actual problem. Isn't that a problem? As my understanding, MADV_COLD could be deemed as a stimulation of normal reclaiming which turbo the folio towards eviction, while the page moving by it should be also delt in the same way(PG_active has been cleaned)