Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp7778885rwl; Fri, 30 Dec 2022 14:40:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXtE3sa/A4rExdMDpXeiPhxQFOxX4oiakE7BisWdXkVqa0GDBfkbjvNcMdvWao0woYyMilC+ X-Received: by 2002:a17:906:e2d3:b0:7c0:deb3:596a with SMTP id gr19-20020a170906e2d300b007c0deb3596amr31207458ejb.70.1672440034527; Fri, 30 Dec 2022 14:40:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672440034; cv=none; d=google.com; s=arc-20160816; b=vZvDNUpqHRRvNiDTgfdj9b0EdrbrtMwi958lXyOIeQY78SUn6BxKu5kxhY3nICXDyc UFcJzm7v2TqTfGuZoFbmGDfjD9eT4Hj2QH2kUYUyzwuc2FS3r6xTM4quJ8Z82JJBiCc7 p0rAsNe6rf0BeAt3jbdyJSYVUbUGq6irYp9fw+P8X4s8jg38M0QAl19iBZxfkvH+4ltA vdc9e5Aj8aSbm/GSoznFv9nmuPg5TLM3fr4IyHDYkWLmMPRoambPOQBF21JRsWtMyRfL gg77Ou7H0f2lvXXaQwdaDJYUN9+GnM9mZK4uH4FfnEWa6SK140WCrC1hQZs1iRwuepgV DGvQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=ojCvjpUwmQcpqlhAqAXahIQg5LmJzJtnHdnov88yJMs=; b=Jo+7ZJNXu1acsan9Dx115ZnlNE3iO/8cg5nV3HM9Wbe+aUz7UrSKRMWuRlJScncmR0 UfK87c+ibeMIG9xNlT44QUOMqX8fGtL/HUigKlI+x60kHGVkK6qWlPGXCvvApJlpIkiQ 4wUziEU5IDnozP00gEB0HmuxALbUd2R2eWlVN7W7V3Vl6Rsvn+hAkrDiHD2rT/C8qnR0 AvTqQVMTQn9jSqNdvH8V3sXM94ad7XUdfpcYE+imHU8fEvywSb27aG+RplT5AWcv7jwa RqR1srHcsCypg9wILNyqVOJTpdLRHeNS4Cng5En69a93IFyRo0cqcQBYWvqkEgZCQqgD yMaQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=ZlXVJI2u; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hv15-20020a17090760cf00b0079800b81747si19286379ejc.735.2022.12.30.14.40.20; Fri, 30 Dec 2022 14:40:34 -0800 (PST) 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=20210112 header.b=ZlXVJI2u; 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 S229758AbiL3V7s (ORCPT + 62 others); Fri, 30 Dec 2022 16:59:48 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229536AbiL3V7q (ORCPT ); Fri, 30 Dec 2022 16:59:46 -0500 Received: from mail-vs1-xe2e.google.com (mail-vs1-xe2e.google.com [IPv6:2607:f8b0:4864:20::e2e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 322611CFE1 for ; Fri, 30 Dec 2022 13:59:45 -0800 (PST) Received: by mail-vs1-xe2e.google.com with SMTP id d185so22509733vsd.0 for ; Fri, 30 Dec 2022 13:59:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=ojCvjpUwmQcpqlhAqAXahIQg5LmJzJtnHdnov88yJMs=; b=ZlXVJI2uLZhNL3WGmXGzQbeJ+Y9BZcsePf40pR3SW0CbR6qoB+Ce9wZvSMjvacx3TK VR5gqxU9e5BtU360p9T8tGR3aNMt1abiiG2Jos2ghZFmXEx9eNiH0NPr7FFwacW5i3f8 xhBbOGNegv3yvGegSG6BZ3za7+mvKWD4+06557JEYa7qjgszntkNt+84dhY/IVM6mvU2 r40JZJrBvzdHysFXwtHNOfp6D6MKTqhP9bdDEegX21uONIX6QXjLNSuMXlchC/xHRCkK 6EgsbOyze+/xSUh7Wz7F+op/f7aIKl09JEg1qD5+llHkHvYUHWTQYEJe/OjXIbaQ1ynR sjVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=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=ojCvjpUwmQcpqlhAqAXahIQg5LmJzJtnHdnov88yJMs=; b=OXe9D5qicTrMh2US4+UAmi5r/zcWUQWHP1Rwk5BQmjWeMm/BsfIUwxSpzUHlNaU0cK uBQxZ6Gq4sKF/+6XmrEz8uAS+2fgKkd9HWi7iKhnDPT0BBakIo02Y2Er1qS0qOyeOEYz HcE5/G/VJm5IBnRPjAOS9RphroBQ6IS3Gfz67AkJI+8QNP2kmT9j5ltnhIblApIGgARt owrYFUzUplBJkaSl37HZ1q16tmVVQJ54mLZ4p9+M6YBSCfkT4dL++K8y62fCSlJSAI4e hBHzzO4ywNnSx+3aHzlfD4PNn8OgOdACIql2YoyrT7ztjd2ZJDJR7yqygWQLbq2GD/hR II/g== X-Gm-Message-State: AFqh2kpto/rH9Q6Yzv362P+3leUIqp35ecocf+TjtxqfUej617kGlsp0 oc5qsjytxDK8SnlasBYMQb37h1QxMw6OsYnAjJ4zAw== X-Received: by 2002:a05:6102:3d9f:b0:3c4:4918:80c with SMTP id h31-20020a0561023d9f00b003c44918080cmr2914595vsv.9.1672437584212; Fri, 30 Dec 2022 13:59:44 -0800 (PST) MIME-Version: 1.0 References: <20221222061341.381903-1-yuanchu@google.com> <20221222104937.795d2a134ac59c8244d9912c@linux-foundation.org> <20221222122937.06b9e9f3765e287b91b14954@linux-foundation.org> In-Reply-To: <20221222122937.06b9e9f3765e287b91b14954@linux-foundation.org> From: Yu Zhao Date: Fri, 30 Dec 2022 14:59:08 -0700 Message-ID: Subject: Re: [PATCH 1/2] mm: add vma_has_locality() To: Andrew Morton Cc: Yuanchu Xie , Ivan Babrou , Johannes Weiner , Alexander Viro , Steven Barrett , Brian Geffon , Oleksandr Natalenko , Suren Baghdasaryan , Arnd Bergmann , Peter Xu , Hugh Dickins , Gaosheng Cui , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_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 On Thu, Dec 22, 2022 at 1:29 PM Andrew Morton wrote: > > On Thu, 22 Dec 2022 12:44:35 -0700 Yu Zhao wrote: > > > On Thu, Dec 22, 2022 at 11:49 AM Andrew Morton > > wrote: > > > > > > On Wed, 21 Dec 2022 22:13:40 -0800 Yuanchu Xie wrote: > > > > > > > From: Yu Zhao > > > > This works; suggested-by probably works even better, since I didn't do > > the follow-up work. > > > > > > Currently in vm_flags in vm_area_struct, both VM_SEQ_READ and > > > > VM_RAND_READ indicate a lack of locality in accesses to the vma. Some > > > > places that check for locality are missing one of them. We add > > > > vma_has_locality to replace the existing locality checks for clarity. > > > > > > I'm all confused. Surely VM_SEQ_READ implies locality and VM_RAND_READ > > > indicates no-locality? > > > > Spatially, yes. But we focus more on the temporal criteria here, i.e., > > the reuse of an area within a relatively small duration. Both the > > active/inactive LRU and MGLRU rely on this. > > Oh. Why didn't it say that ;) > > How about s/locality/recency/g? Thanks. I've done this, and posted the v2 which includes much better commit messages.