Thread (15 messages) 15 messages, 3 authors, 2012-08-02

Re: Any reason to use put_page in slub.c?

From: Christoph Lameter <hidden>
Date: 2012-07-31 14:09:57

On Tue, 31 Jul 2012, Glauber Costa wrote:
quoted
quoted
Or am I missing something ?
Yes the refcounting is done at the page level by the page allocator. It is
safe. The slab allocator can free a page removing all references from its
internal structure while the subsystem page reference will hold off the
page allocator from actually freeing the page until the subsystem itself
drops the page count.
pages, yes. But when you do kfree, you don't free a page. You free an
object. The allocator is totally free to keep the page around and pass
it on to someone else.
That is understood. Typically these object where page sized though and
various assumptions (pretty dangerous ones as you are finding out) are
made regarding object reuse. The fallback of SLUB for higher order allocs
to the page allocator avoids these problems for higher order pages.

It would be better and cleaner if all callers would not use slab
allocators but the page allocators directly for any page that requires an
increased refcount for DMA operations.



--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help