lkml.org 
[lkml]   [2008]   [Jun]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Add alloc_pages_exact() and free_pages_exact()
Dave Hansen wrote:

> This looks like a really good idea. It looks pretty good to me, no
> functional problems.

Thanks.

> I think the thing that confused me was trying to figure out if
> 'alloc_end' was the end of what we *did* allocate from
> __get_free_pages() or if it was the *goal* allocation end.
>
> 'used' also seemed like a slightly strange variable name because it
> points to the memory which is about to be freed and ends up *unused*.

This function is taken almost verbatim from alloc_large_system_hash(). I
figured if the terminology was good for that function, it's good for mine.

> I'll offer this up just in case you like it better. For me, it is
> easier to parse, and should do the exact same thing. I also think it's
> slightly nicer to do the arithmetic on 'struct page *' rather than
> vaddrs in 'unsigned long'. It is _slightly_ cheaper not having to do a
> virt_to_page() on each free_page() call. The same would go for the free
> side as well.

It does seem to be an improvement, although AKPM just accepted this patch. I'd
hate to bother him with a replacement patch for something so minor.

--
Timur Tabi
Linux kernel developer at Freescale


\
 
 \ /
  Last update: 2008-06-25 00:03    [W:0.035 / U:0.336 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site