From: Andrew Morton <akpm@osdl.org>
To: Linus Torvalds <torvalds@osdl.org>
Cc: mbligh@aracnet.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, kmannth@us.ibm.com
Subject: Re: [Bugme-new] [Bug 2019] New: Bug from the mm subsystem involving X (fwd)
Date: Wed, 4 Feb 2004 16:56:20 -0800 [thread overview]
Message-ID: <20040204165620.3d608798.akpm@osdl.org> (raw)
In-Reply-To: <Pine.LNX.4.58.0402041639420.2086@home.osdl.org>
Linus Torvalds <torvalds@osdl.org> wrote:
>
>
>
> On Wed, 4 Feb 2004, Martin J. Bligh wrote:
> >
> > Oh hell ... I remember what's wrong with this whole bit. pfn_valid is
> > used inconsistently in different places, IIRC. Linus / Andrew ... what
> > do you actually want it to mean? Some things seem to use it to say
> > "the memory here is valid accessible RAM", some things "there is a
> > valid struct page for this pfn". I was aiming for the latter, but a
> > few other arches seemed to disagree.
> >
> > Could I get a ruling on this? ;-)
>
> It _definitely_ means "there is a valid 'struct page' for this pfn".
>
> To test for "there is RAM" here, you need to first check that the pfn is
> valid, and then you can check what the page type is (usually that would be
> PageReserved(), but it could be a highmem check or something like that
> too).
pfn_valid() could become quite expensive indeed, and it lies on super-duper
hotpaths.
An alternative which is less conceptually clean but should work in this
case is to mark all vma's which were created by /dev/mem mappings as VM_IO,
and test that in remap_page_range().
The marking of mmap_mem() vma's as VM_IO has been in -mm for four months.
But I didn't changelog it at the time and I've forgotten why I wrote it
(really). It's something to do with get_user_pages() against a mapping of
/dev/mem :(
ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.2-rc3/2.6.2-rc3-mm1/broken-out/get_user_pages-handle-VM_IO.patch
--
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:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-02-05 0:56 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-02-04 23:17 Martin J. Bligh
2004-02-04 23:58 ` Linus Torvalds
2004-02-05 0:12 ` Martin J. Bligh
2004-02-05 0:36 ` Martin J. Bligh
2004-02-05 0:43 ` Linus Torvalds
2004-02-05 0:56 ` Andrew Morton [this message]
2004-02-05 1:29 ` Linus Torvalds
2004-02-05 1:56 ` Keith Mannthey
2004-02-05 2:04 ` Linus Torvalds
2004-02-05 2:33 ` Keith Mannthey
2004-02-05 2:47 ` Linus Torvalds
2004-02-06 7:17 ` Martin J. Bligh
2004-02-06 7:19 ` Martin J. Bligh
2004-02-06 9:57 ` Dave Hansen
2004-02-06 15:49 ` Martin J. Bligh
2004-02-06 17:22 ` Dave Hansen
2004-02-06 19:59 ` Martin J. Bligh
2004-02-06 20:16 ` Linus Torvalds
2004-02-06 21:18 ` Martin J. Bligh
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=20040204165620.3d608798.akpm@osdl.org \
--to=akpm@osdl.org \
--cc=kmannth@us.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mbligh@aracnet.com \
--cc=torvalds@osdl.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