lkml.org 
[lkml]   [2007]   [Sep]   [19]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [05/17] vunmap: return page array
On Wed, 19 Sep 2007, KAMEZAWA Hiroyuki wrote:

> Hmm, I don't like returning array which someone allocated in past and forgot.

But that is exactly the point. There is no need to keep track of the
information that is of no interest until the disposition of the mapping.

> And, area->page[] array under vmalloc() is allocated as following (in -rc6-mm1)
> ==
> if (array_size > PAGE_SIZE) {
> pages = __vmalloc_node(array_size, gfp_mask | __GFP_ZERO,
> PAGE_KERNEL, node);
> area->flags |= VM_VPAGES;
> } else {
> pages = kmalloc_node(array_size,
> (gfp_mask & GFP_RECLAIM_MASK) | __GFP_ZERO,
> node);
> }
> ==
> A bit complicating.

Not at all. You can pass a __vmalloc'ed entity to vmap if you add VM_VPAGES
to the flags passed to it.

> At least, please add comments "How to free page-array returned by vummap"

But that depends on how the vmap was called. The caller knows what he has
done to acquire the memory and therefore also knows how to get rid of it.

The knowledge of how to displose of things is only important when we use
vfree() to free up a vmap() (we never do that today) and expect the page
array to go with it.

In that case the user needs to specific VM_VPAGES if the page array was
vmalloced.

I can add a comment explaining that?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-09-20 00:19    [W:0.644 / U:0.016 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site