linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Theodore Ts'o <tytso@mit.edu>
To: Christoph Lameter <cl@linux.com>
Cc: Andreas Dilger <adilger@dilger.ca>, linux-mm <linux-mm@kvack.org>,
	linux-ext4@vger.kernel.org, hughd@google.com,
	Peter Zijlstra <a.p.zijlstra@chello.nl>
Subject: Re: Best way to pin a page in ext4?
Date: Tue, 16 Sep 2014 14:56:39 -0400	[thread overview]
Message-ID: <20140916185639.GM6205@thunk.org> (raw)
In-Reply-To: <alpine.DEB.2.11.1409161330480.21297@gentwo.org>

On Tue, Sep 16, 2014 at 01:34:37PM -0500, Christoph Lameter wrote:
> On Tue, 16 Sep 2014, Theodore Ts'o wrote:
> 
> > > It doesn't seem unreasonable to just grab an extra refcount on the pages
> > > when they are first loaded.
> >
> > Well yes, but using mlock_vma_page() would be a bit more efficient,
> > and technically, more correct than simply elevating the refcount.
> 
> mlocked pages can be affected by page migration. They are not
> pinned since POSIX only says that the pages must stay in memory. So the OS
> is free to move them around physical memory.

And indeed, that would be a better reason to use mlock_vma_page()
rather than elevating the refcount; we just need the page to stay in
memory.  If the mm system needs to move the page around to coalesce
for hugepages, or some such, that's fine.

(And so the subject line in my original post is wrong; apologies, I'm
a fs developer, not a mm developer, and so I used the wrong
terminology.)

Cheers,

					- Ted

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2014-09-16 18:56 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-15 18:51 Best way to pin a page in ext4? Theodore Ts'o
2014-09-15 20:57 ` Andreas Dilger
2014-09-16 18:07   ` Theodore Ts'o
2014-09-16 18:34     ` Christoph Lameter
2014-09-16 18:56       ` Theodore Ts'o [this message]
2014-09-17  0:07     ` Hugh Dickins
2014-09-17  1:25       ` Theodore Ts'o
2014-09-17  3:31       ` Christoph Lameter
2014-09-17 13:57         ` Peter Zijlstra
2014-09-17 20:37           ` Hugh Dickins
2014-09-17 13:56       ` Peter Zijlstra

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=20140916185639.GM6205@thunk.org \
    --to=tytso@mit.edu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=adilger@dilger.ca \
    --cc=cl@linux.com \
    --cc=hughd@google.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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).