From: Andrew Morton <akpm@osdl.org>
To: Terence Ripperda <tripperda@nvidia.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [patch] VM accounting change
Date: Thu, 11 Nov 2004 16:27:36 -0800 [thread overview]
Message-ID: <20041111162736.0c9d5dae.akpm@osdl.org> (raw)
In-Reply-To: <20041112001337.GR1740@hygelac>
Terence Ripperda <tripperda@nvidia.com> wrote:
>
> On Thu, Nov 11, 2004 at 03:07:10PM -0800, akpm@osdl.org wrote:
> > VM_LOCKED|VM_IO doesn't seem to be a sane combination. VM_LOCKED means
> > "don't page it out" and VM_IO means "an IO region". The kernel never even
> > attempts to page out IO regions because they don't have reverse mappings.
> > Heck, they don't even have pageframes.
> >
> > How about you drop the VM_LOCKED?
>
> sounds good, I can do that.
>
> on a related note, there are a couple of flags that I'm not 100% clear
> on the difference between, mainly:
>
> VM_LOCKED
> PG_locked
> PG_reserved
>
> everything I've seen in the past has suggested that drivers set the
> PG_reserved flag for memory allocations intended to be locked down in
> memory for extensive dma (the bttv driver had always been pointed to
> as an example of that).
>
> I'm not clear how that differs from PG_locked and VM_LOCKED. is
> PG_reserved still the suggested way to properly lock memory down, or
> is there a more generally accepted method?
VM_LOCKED means that someone did mlock() and the VMA isn't eligible for
paging.
PG_locked is very different: it provides the caller with exclusive access
the page while its actual contents are being changed. It's also used as a
synchronisation point for adding to and removing from pagecache. It's
pretty much a pagecache concept rather than an MM concept.
PG_reserved does mean that the page is "special" and the VM should just
leave the thing alone - some device driver owns the page and knows how to
manage it.
VM_RESERVED is a bit of a mystery, really and we've had some trouble over
the semantics of this vs PG_reserved. Presumably it's supposed to be like
PG_reserved, only for whole mmap regions. It may not work properly because
it gets damn little testing.
We really should have gone through and rationalised, consolidated and
documented the PageReserved/VM_RESERVED code in the 2.5 cycle but it didn't
happen. The most noxious part is all the testing of PG_reserved in the
core kernel page refcounting logic.
prev parent reply other threads:[~2004-11-12 0:31 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-11-11 22:32 [patch] VM accounting change Terence Ripperda
2004-11-11 23:07 ` Andrew Morton
2004-11-12 0:13 ` Terence Ripperda
2004-11-12 0:27 ` Andrew Morton [this message]
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=20041111162736.0c9d5dae.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=tripperda@nvidia.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