[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Pine.LNX.4.64.0703191334280.14446@sbz-30.cs.Helsinki.FI>
Date: Mon, 19 Mar 2007 13:40:37 +0200 (EET)
From: Pekka J Enberg <penberg@...helsinki.fi>
To: Andrew Morton <akpm@...ux-foundation.org>
cc: ast@...dv.de, clameter@....com, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] slab: deal with NULL pointers passed to kmem_cache_free
Hi,
On Mon, 19 Mar 2007, Andrew Morton wrote:
> err, we don't want to do this, do we? It adds overhead for something which
> we've carefully taught all our programmers to not do. The only known code
> which will benefit from this is buggy.
Well, I actually disagree with that. It makes little sense for
kmem_cache_free() to behave differently from kfree() especially since the
overhead is minimal. But anyway, if you're unhappy with the patch, then we
should make it explicit that you're not allowed to pass NULL to
kmem_cache_free(), mempool_free() and perhaps others as well in which case
kfree() comes even more special...
I know this has been discussed in the past but I think you should be able
to blindly pass whetever pointer the allocator fuction gives you to the
corresponding release function which is why I wanted to fix
kmem_cache_free() in the first place.
On Mon, 19 Mar 2007, Andrew Morton wrote:
> s/fix/hide/
No, even though there is clearly some problem with either the scsi or
block layer not allocating any pages for the iovec, I do think slab should
deal with NULL pointers properly.
Pekka
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists