lkml.org 
[lkml]   [2002]   [Jan]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectQuestion on current->local_pages and its usage
Date
While reviewing 2.4.17 __alloc_pages() and associated routines, I came across
something I don't understand ( no surprise ;-)

In __free_pages_ok(), if current->flags & PF_FREE_PAGES, the code adds the
pages being freed to current->local_pages using the following block of code:


local_freelist:
if (current->nr_local_pages)
goto back_local_freelist;
if (in_interrupt())
goto back_local_freelist;

list_add(&page->list, &current->local_pages);
page->index = order;
current->nr_local_pages++;


Unless I am misreading this, that first if statement in going to limit
us to at most one block of pages no matter how many times we call
__free_pages_ok()


However, in balance_classzone(), the code seems to expect that multiple
blocks of pages may be 'cached' in local_pages.


do {
tmp = list_entry(entry, struct page, list);
if (tmp->index == order && memclass(tmp->zone, classzone)) {
list_del(entry);
current->nr_local_pages--;
...
} while ((entry = entry->next) != local_pages);


So, am I misreading this.. or is one of these wrong? If I were to hazard a
guess, __free_pages_ok() should be 'fixed'.

- jim

--
James Washer
IBM Linux Change Team
-
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: 2005-03-22 13:15    [W:0.053 / U:0.128 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site