Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp658793rwj; Thu, 22 Dec 2022 12:50:27 -0800 (PST) X-Google-Smtp-Source: AMrXdXuMA34hicDEZItKC4nVk2Ti06qkZbfEZ0Szdn9ZOjZ0K/6DU6qgsW9wtn7/p3llmkk4mXtl X-Received: by 2002:a05:6402:1298:b0:461:75f1:9254 with SMTP id w24-20020a056402129800b0046175f19254mr5935468edv.2.1671742226817; Thu, 22 Dec 2022 12:50:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671742226; cv=none; d=google.com; s=arc-20160816; b=VsPueVvUvqSUBriXGBkluxEIuB7rFrcyeYMJ/TAu2DyPlrNUKtMUCD3WqID2CuXw8U vIdi94tVrag/h4Ny8XY5FGN0vNdkOqVxrevZI5QjDCwj2iwKgLBUlmnEw/GyLvUZHLom nET4MN/bWkZSgzfVgrsI97F5n8T+Kw5Kdpd++/YyvyOipjDpnhVE+tWrafHpJpWiuUmp c67PCnKjtwHsIKCOqePIV+9JBCT9Ne7GuD0dr8LIEEUVQdMUUrGxroEfzJ/D33HcRedi Qdb4GESpOFQpFfVL4aRsCnKCaDpxwu3NWppKZuJ+zhPvRn0of6BAVy89oHqO4L2kEZAz SqlQ== 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=cHtRUDfJ8+KPIIIdZp/lV5Me9KLByFDBlDs3+48srbs=; b=jJxI+FcnlytwNafAQT0OtAkpe0mwqCThAIKMbqJsu2pWhOeqqTuiE8zDBsOvloe6IB YW6O7/weLrcLdzZCXmFu3k+c+jd6pa1yuvFt1YwXpUG49EctaLOeigvUFCG6ajSs+W76 x0Kdnt/J7QroxPTnyyZloc01UlsFQgNyTCE12kU4KQNSd5Rt9Q9wLsN8FIX18di/wp70 t4SaAVTkovukhOT7aIB79zO9GdjP/Az9+n1s3wDVTT65Gii2f5ciPTdr8lV6/BNoIVgB 4O2FiTbwf0AoXftGKKwcs9JihFmwMlWdEPbFZ4ZYt53OttBXetnx8BPtTFqoXu1q6XRP KOGA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=xyQfmfqH; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t30-20020a50d71e000000b0046b187299e0si1408235edi.342.2022.12.22.12.50.10; Thu, 22 Dec 2022 12:50:26 -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=@linux-foundation.org header.s=korg header.b=xyQfmfqH; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229974AbiLVU3o (ORCPT + 69 others); Thu, 22 Dec 2022 15:29:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229704AbiLVU3m (ORCPT ); Thu, 22 Dec 2022 15:29:42 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E74EE20BC6; Thu, 22 Dec 2022 12:29:41 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 84663B81F57; Thu, 22 Dec 2022 20:29:40 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id AF61AC433D2; Thu, 22 Dec 2022 20:29:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1671740979; bh=78+XeTaO6EMlC2xgXSJtYAPRNZoQKpOoT72uxN9IWGQ=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=xyQfmfqHleLWQeqi0qk3kyOaphPCaS5qie4t74lALvgAZ+RJZDhcSgk0Rjt0Luol2 SgQmFBqK2/nkThRXODkH/0mB2/KFmBSg+30Gw6lQ9wgSx+RCx0KHuOZ7B2gY/iOvWw mQfP7+bj3hW/aKupheNg6Oj0RhjLn/V0cXLnJp5Q= Date: Thu, 22 Dec 2022 12:29:37 -0800 From: Andrew Morton To: Yu Zhao 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 Subject: Re: [PATCH 1/2] mm: add vma_has_locality() Message-Id: <20221222122937.06b9e9f3765e287b91b14954@linux-foundation.org> In-Reply-To: References: <20221222061341.381903-1-yuanchu@google.com> <20221222104937.795d2a134ac59c8244d9912c@linux-foundation.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-8.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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, 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?