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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07/27/2012 07:55 PM, Christoph Lameter wrote:
> On Fri, 27 Jul 2012, Glauber Costa wrote:
> 
>> But I am still wondering if there is anything I am overlooking.
> 
> put_page() is necessary because other subsystems may still be holding a
> refcount on the page (if f.e. there is DMA still pending to that page).
> 

Humm, this seems to be extremely unsafe in my read.
If you do kmalloc, the API - AFAIK - does not provide us with any
guarantee that the object (it's not even a page, in the strict sense!)
allocated is reference counted internally. So relying on kfree to do it
doesn't bode well. For one thing, slab doesn't go to the page allocator
for high order allocations, and this code would crash miserably if
running with the slab.

Or am I missing something ?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]