Question on current->local_pages and its usage

From: James Washer (e2big@us.ibm.com)
Date: Wed Jan 23 2002 - 01:08:05 EST


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/



This archive was generated by hypermail 2b29 : Wed Jan 23 2002 - 21:01:01 EST