Re: truncate_list_pages() BUG and confusion

Dave Hansen (haveblue@us.ibm.com)
Thu, 07 Mar 2002 19:04:38 -0800


Martin J. Bligh wrote:
> Where did truncate_list_pages unlock it? It doesn't do that
> until after it's called truncate_complete_page, which (indirectly)
> frees the page ... ?

Ahh, put_page_testzero
#define put_page_testzero(p) atomic_dec_and_test(&(p)->count)

It will only try to free if the page count is zero. The caller makes
sure that this doesn't happen.

if (!PageReserved(page) && put_page_testzero(page)) {
if (PageLRU(page))
lru_cache_del(page);
__free_pages_ok(page, 0);
}

-- 
Dave Hansen
haveblue@us.ibm.com

- 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/