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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS 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 6F1ADC432BE for ; Wed, 1 Sep 2021 23:59:11 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B1BA261053 for ; Wed, 1 Sep 2021 23:59:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B1BA261053 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 34C5B8D0002; Wed, 1 Sep 2021 19:59:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2D3D48D0001; Wed, 1 Sep 2021 19:59:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19C278D0002; Wed, 1 Sep 2021 19:59:10 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0165.hostedemail.com [216.40.44.165]) by kanga.kvack.org (Postfix) with ESMTP id 078358D0001 for ; Wed, 1 Sep 2021 19:59:10 -0400 (EDT) Received: from smtpin09.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AD54E8249980 for ; Wed, 1 Sep 2021 23:59:09 +0000 (UTC) X-FDA: 78540673218.09.3989414 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 4F282B000183 for ; Wed, 1 Sep 2021 23:59:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=NS2CxBpdM7T3fz0/+Dj80k1I+SuLflnA7x6FaBAQ2IE=; b=YBL1898AGSPsCRxznQ0d1JRo8r ZgcAwbgTL4YwbAs7tRU/VZZ+DV6TsoLBRilDMxeqa/i04qHVWKVUPpC7hH/KUvY8tTQdD6bL0WDQ8 UCetGH/beP+vX75Z7Rqm3TlVSnn3W4XCbKfk1245sa5KwQVVrbLlx0W++oPYRWMPj3s1/qhMxchNJ U6G143Xr274AFCP4KwcQRqbk0QTXBKd9NCo4B4oP326BPlYTju9Cse4iCsRGK+0z0ikfRb2VC0rrb 640Mp7v2NBMz3nRYBNoKbz/IDCNeGYIoCxechl4tiTN3/k8L47UlQVWczBK2HQCfE3Y9+78R3aad1 vfD7SuKA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1mLa7G-002vNq-P4; Wed, 01 Sep 2021 23:58:15 +0000 Date: Thu, 2 Sep 2021 00:58:02 +0100 From: Matthew Wilcox To: Huang Shijie Cc: Shijie Huang , torvalds@linux-foundation.org, viro@zeniv.linux.org.uk, akpm@linux-foundation.org, linux-mm@kvack.org, song.bao.hua@hisilicon.com, linux-kernel@vger.kernel.org, Frank Wang Subject: Re: Is it possible to implement the per-node page cache for programs/libraries? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=YBL1898A; dmarc=none; spf=none (imf25.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 4F282B000183 X-Stat-Signature: uja33hqdg8jzhwj6rhenxkmrzsn6t91b X-HE-Tag: 1630540748-619260 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 Wed, Sep 01, 2021 at 02:25:34PM +0000, Huang Shijie wrote: > On Wed, Sep 01, 2021 at 01:30:45PM +0000, Huang Shijie wrote: > > On Wed, Sep 01, 2021 at 04:25:01AM +0100, Matthew Wilcox wrote: > > > On Wed, Sep 01, 2021 at 11:07:41AM +0800, Shijie Huang wrote: > > > > In the NUMA, we only have one page cache for each file. For the > > > > program/shared libraries, the > > > > remote-access delays longer then the local-access. > > > > > > > > So, is it possible to implement the per-node page cache for > > > > programs/libraries? > > > > > > At this point, we have no way to support text replication within a > > > process. So what you're suggesting (if implemented) would work for > > > > I created a glibc patch which can do the text replication within a process. > The "text replication" means the shared libraries, not program itself. Thinking about it some more, if you're ok with it only being shared libraries, you can do this: for i in `seq 0 3`; do \ cp --reflink=always /lib/x86_64-linux-gnu/libc.so.6 \ /lib/x86_64-linux-gnu/libc.so.6.numa$i; \ done Reflinked files don't share page cache, so you can do this all in userspace with no kernel changes.