linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Barry Song <21cnbao@gmail.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: Huang Shijie <shijie@os.amperecomputing.com>,
	Shijie Huang <shijie@amperemail.onmicrosoft.com>,
	Linus Torvalds <torvalds@linux-foundation.org>,
	Al Viro <viro@zeniv.linux.org.uk>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux-MM <linux-mm@kvack.org>,
	Barry Song <song.bao.hua@hisilicon.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Frank Wang <zwang@amperecomputing.com>
Subject: Re: Is it possible to implement the per-node page cache for programs/libraries?
Date: Thu, 2 Sep 2021 12:15:06 +1200	[thread overview]
Message-ID: <CAGsJ_4ySjL9SWaquP4BoWROZ=qPFgyTKnPWuSP_LD08RZB7uzg@mail.gmail.com> (raw)
In-Reply-To: <YTATir09urAUTSI+@casper.infradead.org>

On Thu, Sep 2, 2021 at 12:00 PM Matthew Wilcox <willy@infradead.org> wrote:
>
> 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.

Not quite sure I catch your point. In case we are running mysql on a
machine with 128 cores
(4numa, 32cores in each numa), how will the reflink help the only
mysql process to leverage
its local libc copy?

Thanks
Barry

  reply	other threads:[~2021-09-02  0:15 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-01  3:07 Is it possible to implement the per-node page cache for programs/libraries? Shijie Huang
2021-09-01  2:09 ` Barry Song
2021-09-01  3:25 ` Matthew Wilcox
2021-09-01 13:30   ` Huang Shijie
2021-09-01 14:25     ` Huang Shijie
2021-09-01 11:32       ` Matthew Wilcox
2021-09-01 23:58       ` Matthew Wilcox
2021-09-02  0:15         ` Barry Song [this message]
2021-09-02  1:13           ` Linus Torvalds
2021-09-02 10:16         ` Huang Shijie
2021-09-02  3:25   ` Nicholas Piggin
2021-09-02 10:17     ` Matthew Wilcox
2021-09-03  7:10       ` Nicholas Piggin
2021-09-03 19:01         ` Matthew Wilcox
2021-09-03 19:08           ` Linus Torvalds
2021-09-06  9:56             ` Huang Shijie
2021-09-03 23:42           ` Nicholas Piggin
2021-09-01  4:55 ` Al Viro
2021-09-01 13:10   ` Huang Shijie
2021-09-01 17:24   ` Linus Torvalds
2021-09-01 17:29     ` Linus Torvalds
2021-09-01 22:56       ` Barry Song
2021-09-02 10:12         ` Huang Shijie
2021-09-02 10:08       ` Huang Shijie

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAGsJ_4ySjL9SWaquP4BoWROZ=qPFgyTKnPWuSP_LD08RZB7uzg@mail.gmail.com' \
    --to=21cnbao@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=shijie@amperemail.onmicrosoft.com \
    --cc=shijie@os.amperecomputing.com \
    --cc=song.bao.hua@hisilicon.com \
    --cc=torvalds@linux-foundation.org \
    --cc=viro@zeniv.linux.org.uk \
    --cc=willy@infradead.org \
    --cc=zwang@amperecomputing.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).