All of lore.kernel.org
 help / color / mirror / Atom feed
From: Stefani Seibold <stefani@seibold.net>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
	linux-mm@kvack.org, Hugh Dickins <hugh@veritas.com>
Subject: Re: vm_ops.page_mkwrite() fails with vmalloc on 2.6.23
Date: Tue, 30 Oct 2007 11:49:16 +0100	[thread overview]
Message-ID: <1193741356.13775.2.camel@matrix> (raw)
In-Reply-To: <1193738177.27652.69.camel@twins>

Hi,

the question is how can i get all pte's from a vmalloc'ed memory. Due to
the zeroed mapping pointer i dont see how to do this?


Am Dienstag, den 30.10.2007, 10:56 +0100 schrieb Peter Zijlstra:
> On Mon, 2007-10-29 at 21:22 -0400, Jaya Kumar wrote:
> > On 10/29/07, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > >
> > > [ also, remap_vmalloc_range() suffers similar issues, only file and anon
> > >   have proper rmap ]
> > >
> > > I'm not sure we want full rmap for remap_pfn/vmalloc_range, but perhaps
> > > we could assist drivers in maintaining and using vma lists.
> > >
> > > I think page_mkclean_one() would work if you'd manually set page->index
> > > and iterate the vmas yourself. Although atm I'm not sure of anything so
> > > don't pin me on it.
> > 
> > :-) If it's anybody's fault, it's mine for not testing properly. My bad.
> > 
> > In the case of defio, I think it's no trouble to build a list of vmas
> > at mmap time and then to iterate through them when it's ready for
> > mkclean time as you suggested. I don't fully understand page->index
> > yet. I had thought it was only used by swap cache or file map.
> > 
> > On an unrelated note, I was looking for somewhere to stuff a 16 bit
> > offset (so that I have a cheap way to know which struct page
> > corresponds to which framebuffer block or offset) for another driver.
> > I had thought page->index was it but I think I am wrong now.
> Yeah, page->index is used along with vma->vmpgoff and vma->vm_start to
> determine the address of the page in the given vma:
> 
>   address = vma->vm_start + ((page->index - vma->vm_pgoff) << PAGE_SHIFT);
> 
> and from that address the pte can be found by walking the vma->vm_mm
> page tables.
> 
> So page->index does what you want it to, identify which part of the
> framebuffer this particular page belongs to.


WARNING: multiple messages have this Message-ID (diff)
From: Stefani Seibold <stefani@seibold.net>
To: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Jaya Kumar <jayakumar.lkml@gmail.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org, David Howells <dhowells@redhat.com>,
	linux-mm@kvack.org, Hugh Dickins <hugh@veritas.com>
Subject: Re: vm_ops.page_mkwrite() fails with vmalloc on 2.6.23
Date: Tue, 30 Oct 2007 11:49:16 +0100	[thread overview]
Message-ID: <1193741356.13775.2.camel@matrix> (raw)
In-Reply-To: <1193738177.27652.69.camel@twins>

Hi,

the question is how can i get all pte's from a vmalloc'ed memory. Due to
the zeroed mapping pointer i dont see how to do this?


Am Dienstag, den 30.10.2007, 10:56 +0100 schrieb Peter Zijlstra:
> On Mon, 2007-10-29 at 21:22 -0400, Jaya Kumar wrote:
> > On 10/29/07, Peter Zijlstra <a.p.zijlstra@chello.nl> wrote:
> > >
> > > [ also, remap_vmalloc_range() suffers similar issues, only file and anon
> > >   have proper rmap ]
> > >
> > > I'm not sure we want full rmap for remap_pfn/vmalloc_range, but perhaps
> > > we could assist drivers in maintaining and using vma lists.
> > >
> > > I think page_mkclean_one() would work if you'd manually set page->index
> > > and iterate the vmas yourself. Although atm I'm not sure of anything so
> > > don't pin me on it.
> > 
> > :-) If it's anybody's fault, it's mine for not testing properly. My bad.
> > 
> > In the case of defio, I think it's no trouble to build a list of vmas
> > at mmap time and then to iterate through them when it's ready for
> > mkclean time as you suggested. I don't fully understand page->index
> > yet. I had thought it was only used by swap cache or file map.
> > 
> > On an unrelated note, I was looking for somewhere to stuff a 16 bit
> > offset (so that I have a cheap way to know which struct page
> > corresponds to which framebuffer block or offset) for another driver.
> > I had thought page->index was it but I think I am wrong now.
> Yeah, page->index is used along with vma->vmpgoff and vma->vm_start to
> determine the address of the page in the given vma:
> 
>   address = vma->vm_start + ((page->index - vma->vm_pgoff) << PAGE_SHIFT);
> 
> and from that address the pte can be found by walking the vma->vm_mm
> page tables.
> 
> So page->index does what you want it to, identify which part of the
> framebuffer this particular page belongs to.

--
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:[~2007-10-30 10:49 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22 14:40 vm_ops.page_mkwrite() fails with vmalloc on 2.6.23 Stefani Seibold
2007-10-29  7:40 ` Andrew Morton
2007-10-29  7:40   ` Andrew Morton
2007-10-29  8:17   ` Jaya Kumar
2007-10-29  8:17     ` Jaya Kumar
2007-10-29 10:11     ` Peter Zijlstra
2007-10-29 10:11       ` Peter Zijlstra
2007-10-29 12:35       ` Peter Zijlstra
2007-10-29 12:35         ` Peter Zijlstra
2007-10-29 14:28         ` Nick Piggin
2007-10-29 14:28           ` Nick Piggin
2007-10-29 17:01     ` Peter Zijlstra
2007-10-29 17:01       ` Peter Zijlstra
2007-10-29 17:51       ` Jaya Kumar
2007-10-29 17:51         ` Jaya Kumar
2007-10-29 18:17         ` Peter Zijlstra
2007-10-29 18:17           ` Peter Zijlstra
2007-10-29 22:16           ` Peter Zijlstra
2007-10-29 22:16             ` Peter Zijlstra
2007-10-30  1:22             ` Jaya Kumar
2007-10-30  1:22               ` Jaya Kumar
2007-10-30  9:56               ` Peter Zijlstra
2007-10-30 10:49                 ` Stefani Seibold [this message]
2007-10-30 10:49                   ` Stefani Seibold
2007-10-30 12:39                   ` Hugh Dickins
2007-10-30 12:39                     ` Hugh Dickins
2007-10-30 13:12                     ` Peter Zijlstra
2007-10-30 13:16                 ` Jaya Kumar
2007-10-30 13:16                   ` Jaya Kumar
2007-10-30 13:25                   ` Peter Zijlstra
2007-10-30 15:47                     ` Hugh Dickins
2007-10-30 15:47                       ` Hugh Dickins
2007-10-30 15:51                       ` Peter Zijlstra
2007-11-01  8:02                       ` Jaya Kumar
2007-11-01  8:02                         ` Jaya Kumar
  -- strict thread matches above, loose matches on Subject: below --
2007-10-22 14:45 Stefani Seibold
2007-10-22 16:37 ` Hugh Dickins
2007-10-22 17:03   ` Jaya Kumar
2007-10-22 17:17 ` Peter Zijlstra
2007-10-22 17:20   ` 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=1193741356.13775.2.camel@matrix \
    --to=stefani@seibold.net \
    --cc=a.p.zijlstra@chello.nl \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=hugh@veritas.com \
    --cc=jayakumar.lkml@gmail.com \
    --cc=linux-kernel@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.