[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20070920094720.46e781ec.kamezawa.hiroyu@jp.fujitsu.com>
Date: Thu, 20 Sep 2007 09:47:20 +0900
From: KAMEZAWA Hiroyuki <kamezawa.hiroyu@...fujitsu.com>
To: Christoph Lameter <clameter@....com>
Cc: Christoph Hellwig <hch@....de>, Mel Gorman <mel@...net.ie>,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
David Chinner <dgc@....com>, Jens Axboe <jens.axboe@...cle.com>
Subject: Re: [05/17] vunmap: return page array
On Wed, 19 Sep 2007 15:15:58 -0700 (PDT)
Christoph Lameter <clameter@....com> wrote:
> 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.
>
yes. But I think neat style of this kind function is
==
/* If array != NULL, pointer of unmapped pages are stored in array[] */
extern int vunmap(const void *addr, struct page **array);
==
But yes, this costs.
> > 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.
>
Hm, it seems all your patch are for hiding usage of vmalloc()/vmap().
If freeing pages[] array is also hidden in your patch's context, no problem.
Thanks,
-Kame
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists