Re: [Patch 3/3] Shrink quicklist based upon node free memory.

From: Robin Holt <holt_at_sgi.com>
Date: 2005-03-04 00:49:42
How about the following?

static inline long
min_pages_to_free (void)
{
        long pages_to_free;

        pages_to_free = pgtable_quicklist_size - max_pgt_pages();
        pages_to_free = min(pages_to_free, 1L << NODE_FREE_PAGES_SHIFT);
        return pages_to_free;
}


void
check_pgt_cache (void)
{
        long pages_to_free;

        if (unlikely(pgtable_quicklist_size <= MIN_PGT_PAGES))
                return;

        preempt_disable();
        while (unlikely((pages_to_free=min_pages_to_free()) > 0)) {
                while (pages_to_free--) {
                        free_page((unsigned long)pgtable_quicklist_alloc());
                }
                preempt_enable();
                preempt_disable();
        }
        preempt_enable();
}

-
To unsubscribe from this list: send the line "unsubscribe linux-ia64" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Received on Thu Mar 3 08:51:07 2005

This archive was generated by hypermail 2.1.8 : 2005-08-02 09:20:36 EST