mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Oleg Nesterov <oleg@redhat.com>, Ingo Molnar <mingo@elte.hu>,
	Denys Vlasenko <dvlasenk@redhat.com>,
	Hugh Dickins <hughd@google.com>,
	Jim Keniston <jkenisto@us.ibm.com>,
	Masami Hiramatsu <masami.hiramatsu.pt@hitachi.com>,
	Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
	linux-kernel@vger.kernel.org
Subject: Re: [GIT PULL] uprobes: tmpfs support
Date: Mon, 2 Jun 2014 12:09:46 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.11.1406021141160.1531@eggly.anvils> (raw)
In-Reply-To: <20140602183028.GA9372@infradead.org>

On Mon, 2 Jun 2014, Christoph Hellwig wrote:
> On Mon, Jun 02, 2014 at 04:14:06PM +0200, Oleg Nesterov wrote:
> > Ingo, please pull from
> > 
> >   git://git.kernel.org/pub/scm/linux/kernel/git/oleg/misc uprobes/core
> > 
> > Based on tip:perf/uprobes
> 
> Eww, adding tmpfs-specific code to uprobes screams layering violation.
> 
> Hugh, what is the problem with implementing ->readpage for tmpfs again?

The problem is that ->readpage invites the caller to allocate a page
of their choice for pagecache, and then pass it down to the filesystem
to fill and use thereafter.

There are several ways in which that does not suit tmpfs, 3 spring to mind:
1. the page may already be in memory, but currently in swapcache not in
filecache: tmpfs knows how to manage that, the ->readpage caller does not
2. there may be a NUMA mempolicy applied to that file, which would choose
to allocate the page differently: tmpfs knows about that, caller does not
3. (handy side-effect) it happens to disable use of tmpfs file as swapfile

It was a great relief when tmpfs could finally jettison its ->readpage
back in v3.1 (though if you press me, I could admit to some remaining
embarrassments).  I certainly do not want it back.

Just think of tmpfs as a layering violation itself (memory as backing!
no wonder it has peculiar demands on the allocation of its backing)
and we're all good - there's a variety of ways in which the generic
code already happens to accommodate it (many PageSwapBacked tests,
or the mapping_cap_account_dirty/writeback tests, for example).

IIRC, you were in on the discussion of shmem_read_mapping_page() when we
introduced it: Oleg is simply adding a call to it to fix a uprobes bug.  
That the name explicitly mentions shmem instead of concealing it,
is not necessarily a bad thing.

Hugh

  reply	other threads:[~2014-06-02 19:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-02 14:14 Oleg Nesterov
2014-06-02 18:30 ` Christoph Hellwig
2014-06-02 19:09   ` Hugh Dickins [this message]
2014-06-02 19:23   ` Oleg Nesterov

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=alpine.LSU.2.11.1406021141160.1531@eggly.anvils \
    --to=hughd@google.com \
    --cc=dvlasenk@redhat.com \
    --cc=hch@infradead.org \
    --cc=jkenisto@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=masami.hiramatsu.pt@hitachi.com \
    --cc=mingo@elte.hu \
    --cc=oleg@redhat.com \
    --cc=srikar@linux.vnet.ibm.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

all inboxes | Powered by JetHome®