Received: by 2002:a05:7412:8521:b0:e2:908c:2ebd with SMTP id t33csp2327390rdf; Mon, 6 Nov 2023 10:41:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IEfs60OqCM0QsPZSsZpoZFI98fHLtWIgI1g1gbeDDLNaW2Jw5GyaV4cuNsva6DWlv/uUJOc X-Received: by 2002:a05:6358:5e0c:b0:168:e898:fb7d with SMTP id q12-20020a0563585e0c00b00168e898fb7dmr23373418rwn.28.1699296104875; Mon, 06 Nov 2023 10:41:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1699296104; cv=none; d=google.com; s=arc-20160816; b=ox4Ss01PahDa5LaAa9X9gTatDqYHQsWP+1CDGSh0uBHlU1h2v3Y3fBQR50qg/W7K9g bZsUcQubKyUBjsMMcRMNb7plyPuELyuvjcVXGu/dc1Dnbu7pmoG+nvpkIM9y+ZOHcmf8 lRUi8Yw4b8e+UoF2zkh6dwO6a0HLwgVkffmtYKCfST8DYEnBiLBXoFtFieqtz8s4Hx7o pMj03ZbaehwBGxOnAPbd1735m9yH0VM5vcwI84/pt0PKfE5UX9llclvkST6sOdsiWsCr Ol1o8hHgJpiFBH0UJno9ec05iNY9JyXKNuxxELFNThFKjoR8tGpFMTF99QXKGX3S4Yh+ meFw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Dj9olaS8tchtbZaJb1ziL4FGLBSwu14W+MSJxqRho24=; fh=TlcQPDcRmBQtSqLefYzv9jJsm8YrQJHfqRULpwl1dQ4=; b=uFiChNoyCvwWMKlxnCuwIxDwwscSractW1pd2E7IZ6fr8rFius1oQ2vxNezeTcJbZ5 zoy3RgYoGxaS++I9xfBVyLRsPMEIFHwoaagKGX3nN0+7xJkmm7DLlsTCwm6lBuqmDUJa lrIBZtzCpVKOJ2spUrDFem/HrpkyNJQplluII4UH1VROXpE1DnXe01eO7SD/sFceGRLk UL/kAduItQxprvqBwzMaQpg1vPMkBPU4Tzz+aNqY6aOS473puC2o+QEO89FJcyL3KyGc /LPLuqHm6MQ7awfCScKcskydupxLC42PBCPNmoKDIcAblJtbswh1gei2SaT0YGZOVMN2 uBtw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="HWht/2qo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [23.128.96.38]) by mx.google.com with ESMTPS id cn5-20020a056a020a8500b005859aa3da1esi298384pgb.492.2023.11.06.10.41.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 06 Nov 2023 10:41:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) client-ip=23.128.96.38; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="HWht/2qo"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.38 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 2CC1880C3444; Mon, 6 Nov 2023 10:41:08 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232004AbjKFSky (ORCPT + 99 others); Mon, 6 Nov 2023 13:40:54 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231773AbjKFSkw (ORCPT ); Mon, 6 Nov 2023 13:40:52 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 43847A2 for ; Mon, 6 Nov 2023 10:40:50 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ADBD2C433C8; Mon, 6 Nov 2023 18:40:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1699296049; bh=ySS1W0Ki+weixhaKVOMuwHjGI1PUiM9vnD8heeyo3GY=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=HWht/2qopG8QEr/1Hu1hJ7JcorRlrr1oT74fBpBNJYoP7EWqYeRLdDPeOgZdRfrEH PmtYOM58qJxzMIAgdO7I/i/k4HbHKZ9Rcv5mvdeTT6WMjAG5znKlxYMdG0qCYw6uuh Pxb+EG37USSEuQkUz7xsV2K2i2+pomTJgOWKbjh8= Date: Mon, 6 Nov 2023 10:40:49 -0800 From: Andrew Morton To: Zhiguo Jiang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, opensource.kernel@vivo.com Subject: Re: [PATCH] mm:vmscan: fix return negative unneed to detect VM_EXEC Message-Id: <20231106104049.1ed5ba7976f0c0633fb729f5@linux-foundation.org> In-Reply-To: <20231025154432.314-1-justinjiang@vivo.com> References: <20231025154432.314-1-justinjiang@vivo.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.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 (fry.vger.email [0.0.0.0]); Mon, 06 Nov 2023 10:41:08 -0800 (PST) On Wed, 25 Oct 2023 23:44:32 +0800 Zhiguo Jiang wrote: > The reason that folio_referenced() returns negative is because > rwc.contended is 1, vm_flags is 0 at this time and so there is > no need to detect VM_EXEC. And only when referenced > 0, pra->vm_flags > will be filled with vma->vm_flags in folio_referenced_one(). > > ... > > --- a/mm/vmscan.c > +++ b/mm/vmscan.c > @@ -2095,7 +2095,7 @@ static void shrink_active_list(unsigned long nr_to_scan, > > /* Referenced or rmap lock contention: rotate */ > if (folio_referenced(folio, 0, sc->target_mem_cgroup, > - &vm_flags) != 0) { > + &vm_flags) > 0) { > /* > * Identify referenced, file-backed active folios and > * give them one more trip around the active list. So I suspect this email did not make it through the linux-mm server. I can't find it in my archive or at https://lore.kernel.org/linux-mm/. So please resend? Prior to doing so, please update the changelog to describe the before- and after- userspace visible effects of the change. Thanks.