linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: lord@sgi.com
To: David Woodhouse <dwmw2@infradead.org>
Cc: linux-kernel@vger.rutgers.edu, linux-mm@kvack.org,
	sct@redhat.com, riel@conectiva.com.br
Subject: Re: kmap_kiobuf()
Date: Wed, 28 Jun 2000 10:54:40 -0500	[thread overview]
Message-ID: <200006281554.KAA19007@jen.americas.sgi.com> (raw)
In-Reply-To: Your message of "Wed, 28 Jun 2000 16:41:55 BST

> I think it would be useful to provide a function which can be used to 
> obtain a virtually-contiguous VM mapping of the pages of an iobuf.
> 
> Currently, to access the pages of an iobuf, you have to kmap() each page
> individually. For various purposes, it would be useful to be able to kmap the
> whole iobuf contiguously, so that you can guarantee that:
> 
> 	page_address(iobuf->maplist[n]) + PAGE_SIZE 
> 		== page_address(iobuf->maplist[n+1])
> 
>     (for n such that n < iobuf->nr_pages, obviously. Don't be so pedantic.)
> 
> Rather than taking a kiobuf as an argument, the new function might as well 
> be more generic:
> 
> unsigned long kremap_pages(struct page **maplist, int nr_pages);
> void kunmap_pages(struct page **maplist, int nr_pages);
> 
> I had a quick look at the code for kmap() and vmalloc() and decided that 
> even if I attempted to do it myself, I'd probably bugger it up and a MM 
> hacker would have to fix it anyway. So I'm not going to bother.
> 
> T'would be useful if someone else could find the time to do so, though.
> 
> 
> --
> dwmw2
> 
> 


The XFS port currently has exactly this beast, there is an extension
to let us pass an existing set of pages into the vmalloc_area_pages
function. It uses the existing pages instead of allocating new ones.
We needed something to let us map groups of pages into a single byte array.


I always knew it would go down like a ton of bricks, because of the TLB
flushing costs. As soon as you have a multi-cpu box this operation gets
expensive, the code could be changed to do lazy tlb flushes on unmapping
the pages, but you still have the cost every time you set a mapping up.

Steve

--
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.eu.org/Linux-MM/

             reply	other threads:[~2000-06-28 15:54 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-06-28 15:54 lord [this message]
2000-06-28 16:06 ` kmap_kiobuf() David Woodhouse
2000-06-28 16:24   ` kmap_kiobuf() Benjamin C.R. LaHaise
2000-06-28 18:07   ` kmap_kiobuf() Stephen C. Tweedie
2000-06-28 18:45     ` kmap_kiobuf() David Woodhouse
2000-06-29  9:09       ` kmap_kiobuf() Stephen C. Tweedie
2000-06-28 17:46 ` kmap_kiobuf() Stephen C. Tweedie
  -- strict thread matches above, loose matches on Subject: below --
2000-06-28 20:16 kmap_kiobuf() lord
2000-06-28 21:22 ` kmap_kiobuf() Benjamin C.R. LaHaise
2000-06-29  9:34 ` kmap_kiobuf() Stephen C. Tweedie
2000-06-29 13:45   ` kmap_kiobuf() Steve Lord
2000-06-28 16:52 kmap_kiobuf() lord
2000-06-28 18:06 ` kmap_kiobuf() Stephen C. Tweedie
2000-06-28 19:06   ` kmap_kiobuf() Manfred Spraul
2000-06-28 21:05   ` kmap_kiobuf() Andi Kleen
2000-06-28 15:41 kmap_kiobuf() David Woodhouse
2000-06-28 17:44 ` kmap_kiobuf() Stephen C. Tweedie
2000-06-29 10:52 ` kmap_kiobuf() Stephen C. Tweedie

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=200006281554.KAA19007@jen.americas.sgi.com \
    --to=lord@sgi.com \
    --cc=dwmw2@infradead.org \
    --cc=linux-kernel@vger.rutgers.edu \
    --cc=linux-mm@kvack.org \
    --cc=riel@conectiva.com.br \
    --cc=sct@redhat.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