linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] slab: document kzfree() zeroing behavior
@ 2009-05-31 10:50 Pekka J Enberg
  0 siblings, 0 replies; only message in thread
From: Pekka J Enberg @ 2009-05-31 10:50 UTC (permalink / raw)
  To: linux-kernel; +Cc: alan, cl, mpm, npiggin

From: Pekka Enberg <penberg@cs.helsinki.fi>

As suggested by Alan Cox, document the fact that kzfree() can zero out a great
deal more memory than the what the user requested from kmalloc().

Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
Signed-off-by: Pekka Enberg <penberg@cs.helsinki.fi>
---
 mm/util.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/mm/util.c b/mm/util.c
index 55bef16..e79572b 100644
--- a/mm/util.c
+++ b/mm/util.c
@@ -166,6 +166,10 @@ EXPORT_SYMBOL(krealloc);
  *
  * The memory of the object @p points to is zeroed before freed.
  * If @p is %NULL, kzfree() does nothing.
+ *
+ * Note: this function zeroes the whole allocated buffer which can be a good
+ * deal bigger than the requested buffer size passed to kmalloc(). So be
+ * careful when using this function in performance sensitive code.
  */
 void kzfree(const void *p)
 {
-- 
1.6.0.6


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2009-05-31 10:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-05-31 10:50 [PATCH] slab: document kzfree() zeroing behavior Pekka J Enberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).