Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp819976pxb; Wed, 1 Sep 2021 10:33:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwDQwNMRdHq56vrezrTzrOWzglL09gd9AvVTwhDUSwGvJvyHiQlUVWcE5WYttI87E1qmTUj X-Received: by 2002:a17:906:1e97:: with SMTP id e23mr661247ejj.336.1630517633149; Wed, 01 Sep 2021 10:33:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630517633; cv=none; d=google.com; s=arc-20160816; b=xmawvU7FyaQ3zVrt8iISfAqnSoe8LBcHNrw4Ew6dzP9CsUJlF937PrQz8YYFbjiOBD rsifYgMWRKu3wExdmYvCIa9EEFewzAeoIBf0psPgMjF/G0XyihbWZMbJl07r/FrKxOck hl87rMheAdBI2qPx2MG3RHE/uznSYEPr2yACNNbolVQEsjq2GjcqMKoRYUma+dybUlyd 5eKIPEu45qU5gt1I4gY2BPeA0AN5HSUHog4TjxtC2fzdpsiIV8M+BtbmmniDZh+jW1Oh q0r/AGU7PaGLl2I+UOx8IFCoiRr3JFsx2nG2rPpAiFu7OjgzJVE96UwRK+e6uT3xQr7A xH/w== 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=qLyGBukcS+nnjy1FKTF0pgn11BpStgCPxN3KcpXKwZI=; b=pXoe+T8rhqr1cTzGohLhYicm7crFosGmvWJ3yDmZjkKt+ewKXHTy0VkulbFgeHRzuw sxPjGnHgJjUe5yrcM0AE9Nxjdcgle3104/Nk0Dc96pft+ZhMlmkle9cXcMqAuY6EOtOr A69ye7sL/uaDPgB5WJrbNYy+2UTKCxkSQwAvwUcTmu6WYnVtG4Az6VezqBbB79uui/s0 otVy9LGmx81SIkNz6b0nUVotrXSyD5CnVJzxdGxLF4kcEwfjvpHL8FRhmfHi4vjIAvPW LeHct3eo2PG+x9T9iTiVxPHeizplIi4EYDxd21ZM+RpF2fey9XCqvnVPZVI2uJafBeeR QEPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RJ9SDvHH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id kq12si444421ejb.265.2021.09.01.10.32.56; Wed, 01 Sep 2021 10:33:53 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=google header.b=RJ9SDvHH; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344419AbhIARaS (ORCPT + 99 others); Wed, 1 Sep 2021 13:30:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231852AbhIARaR (ORCPT ); Wed, 1 Sep 2021 13:30:17 -0400 Received: from mail-lj1-x22b.google.com (mail-lj1-x22b.google.com [IPv6:2a00:1450:4864:20::22b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 789E7C061575 for ; Wed, 1 Sep 2021 10:29:20 -0700 (PDT) Received: by mail-lj1-x22b.google.com with SMTP id m4so293856ljq.8 for ; Wed, 01 Sep 2021 10:29:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux-foundation.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=qLyGBukcS+nnjy1FKTF0pgn11BpStgCPxN3KcpXKwZI=; b=RJ9SDvHHQdSbswYw2P2+6h4uecGgZ3MklCwZmG9vM/czpJDFQuD5hmVQoKBnwJIo6T jdvtHHBA7TjXI+RjRG9+7QOKV8BVZG4xDhrnqqzhQS0bh6+KbO/k84s0tX2QNTrpP/Ir +v/NghMPOz47JdAOyeYw0Mfn33mdwEYnE9o9E= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=qLyGBukcS+nnjy1FKTF0pgn11BpStgCPxN3KcpXKwZI=; b=nw57P5tQq1pKBqYWia8ZQ4fKU4Oi5RFNSNfYZEQqd0JJ1YdgOFDRVhc1W0HFDv7ygP kTW+KaRx9l3WtdXKIlPccMsEmXJyja9t5pq9DfpQ3NpYozMMotZtBKJAYBJOnFlahT+E 0KFZvGWhFRtVoezQ9t1Dcke5kzVQmc0ryeL02YRMqI83pywY2QUuSOAGIs582hZNWQpM aKM7xTxaiszphcqWSIZArmJlcgErdgqGYBv1CzC/Tgf76kmvjNWg12frO015p7zm+uw/ /0uwAR6Gb2s50Yd3Le4pJZp6Ylrxs7b8pDlMl7DnJbwyUPUBw6Cigm1JZOU7yn3hnMK3 yplg== X-Gm-Message-State: AOAM5302LJ6qNX50bSgrG669oXb0BjS82y7JLmTg3co6I3Qw1VXQZFQC xuLXzuFLelniQUQJzeFEv232djFHnmx5sBgf X-Received: by 2002:a2e:bc26:: with SMTP id b38mr638264ljf.497.1630517358437; Wed, 01 Sep 2021 10:29:18 -0700 (PDT) Received: from mail-lf1-f41.google.com (mail-lf1-f41.google.com. [209.85.167.41]) by smtp.gmail.com with ESMTPSA id bt42sm11434lfb.118.2021.09.01.10.29.17 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Sep 2021 10:29:17 -0700 (PDT) Received: by mail-lf1-f41.google.com with SMTP id m28so536353lfj.6 for ; Wed, 01 Sep 2021 10:29:17 -0700 (PDT) X-Received: by 2002:a05:6512:681:: with SMTP id t1mr380737lfe.487.1630517357502; Wed, 01 Sep 2021 10:29:17 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Wed, 1 Sep 2021 10:29:01 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Is it possible to implement the per-node page cache for programs/libraries? To: Al Viro Cc: Shijie Huang , Andrew Morton , Linux-MM , "Song Bao Hua (Barry Song)" , Linux Kernel Mailing List , Frank Wang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Sep 1, 2021 at 10:24 AM Linus Torvalds wrote: > > But what you could do, if you wanted to, would be to catch the > situation where you have lots of expensive NUMA accesses either using > our VM infrastructure or performance counters, and when the mapping is > a MAP_PRIVATE you just do a COW fault on them. > > Sounds entirely doable, and has absolutely nothing to do with the page > cache. It would literally just be an "over-eager COW fault triggered > by NUMA access counters". Note how it would work perfectly fine for anonymous mappings too. Just to reinforce the point that this has nothing to do with any page cache issues. Of course, if you want to actually then *share* pages within a node (rather than replicate them for each process), that gets more exciting. But I suspect that this is mainly only useful for long-running big processes (not least due to that node binding thing), so I question the need for that kind of excitement. Linus