From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 07120C432BE for ; Wed, 1 Sep 2021 17:24:55 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 8819961090 for ; Wed, 1 Sep 2021 17:24:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 8819961090 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id DB9328D0002; Wed, 1 Sep 2021 13:24:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D69198D0001; Wed, 1 Sep 2021 13:24:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C304D8D0002; Wed, 1 Sep 2021 13:24:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0088.hostedemail.com [216.40.44.88]) by kanga.kvack.org (Postfix) with ESMTP id B0C968D0001 for ; Wed, 1 Sep 2021 13:24:53 -0400 (EDT) Received: from smtpin30.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id 5224B18211CD1 for ; Wed, 1 Sep 2021 17:24:53 +0000 (UTC) X-FDA: 78539679666.30.B226B58 Received: from mail-lf1-f53.google.com (mail-lf1-f53.google.com [209.85.167.53]) by imf15.hostedemail.com (Postfix) with ESMTP id 035B9D000097 for ; Wed, 1 Sep 2021 17:24:52 +0000 (UTC) Received: by mail-lf1-f53.google.com with SMTP id c8so536351lfi.3 for ; Wed, 01 Sep 2021 10:24:52 -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=cYSskR1qeRze9m2i9qdO3oEtLqePzdlT8/5OwPr7ipE=; b=USxu9L1bhF7jMLXIxHLM75peGmrT6vCWPVCsIEvdUlFz0JcMEEocWtOcBR0v1JBKO5 KCcsomHYd7LgwU8owuOqjW3N6TZrP8kiykgsZDSxatF+N3gqNhPh99DqwD+iiEyBDZfr 7IG0D+U9NO8Nt/wwlAVsgMVbOcCP7YI4QOjII= 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=cYSskR1qeRze9m2i9qdO3oEtLqePzdlT8/5OwPr7ipE=; b=EOYcor53fX+FkEu3fuVOd7tT7yqw+GohsKluwHJhUnuiASIcIkcKZ6+O6Z8mQK5e5t M/7o5pGk/3R4wDN7tTlklImpcxNMwWSAFP7WAlGntGyJpWrPmtVELpo9XYcE261zH3dw lQEBbxQZnt6thmhm/2qmxr6vafE24tvt3vSZkfyIZuYC+zD4jWXTqgWl540XamlnXPra 9Z5gCowBSgGR9u6QFs0H8AcwiR1yF/loA/CHkyrISMpz3VspCcUIhkx9JHv0ziUmILE1 aXZ1CkOx6c5nn/sTuL+3iRC4ZUschHNwyhfX50K1+NV0hJcrfXL7DacPtYoB3T+QjMjj HAtw== X-Gm-Message-State: AOAM5310TGxfJugIKHnUKyZOj44TTH2z8f+fe1TYBQJSZM5+vl++uy/A 9+EnEamtmMRBMRatTvVfqZfMCQiPZIK0vs8W X-Google-Smtp-Source: ABdhPJx0MO0Hge9mpiFoGu/8XYIWD4ti6yQd7OhqMdFSf62iJTRfFBHDR4gAO/HWYkjOPTDTo7gvPQ== X-Received: by 2002:a05:6512:3f15:: with SMTP id y21mr370922lfa.631.1630517090746; Wed, 01 Sep 2021 10:24:50 -0700 (PDT) Received: from mail-lj1-f182.google.com (mail-lj1-f182.google.com. [209.85.208.182]) by smtp.gmail.com with ESMTPSA id t13sm10954lff.46.2021.09.01.10.24.48 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Sep 2021 10:24:49 -0700 (PDT) Received: by mail-lj1-f182.google.com with SMTP id g14so292927ljk.5 for ; Wed, 01 Sep 2021 10:24:48 -0700 (PDT) X-Received: by 2002:a2e:84c7:: with SMTP id q7mr634325ljh.61.1630517088465; Wed, 01 Sep 2021 10:24:48 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Linus Torvalds Date: Wed, 1 Sep 2021 10:24:32 -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" Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=google header.b=USxu9L1b; spf=pass (imf15.hostedemail.com: domain of torvalds@linuxfoundation.org designates 209.85.167.53 as permitted sender) smtp.mailfrom=torvalds@linuxfoundation.org; dmarc=none X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 035B9D000097 X-Stat-Signature: 4o6urejkq75q773nz958k1c4tpikwu8t X-HE-Tag: 1630517092-944627 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Tue, Aug 31, 2021 at 9:57 PM Al Viro wrote: > > What do you mean, per-node page cache? Multiple pages for the same > area of file? That'd be bloody awful on coherency... You absolutely don't want to actually duplicate it in the cache. 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. Honestly, I suspect it only makes sense when you have already bound your process to one particular NUMA node. 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". Linus