linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/8] kzfree()
@ 2009-02-16 14:29 Johannes Weiner
  2009-02-16 14:29 ` [patch 1/8] slab: introduce kzfree() Johannes Weiner
                   ` (8 more replies)
  0 siblings, 9 replies; 24+ messages in thread
From: Johannes Weiner @ 2009-02-16 14:29 UTC (permalink / raw)
  To: Andrew Morton; +Cc: Pekka Enberg, linux-mm, linux-kernel

This series introduces kzfree() and converts callsites which do
memset() + kfree() explicitely.

The callsites may be incomplete, I used coccinelle [1] to find them.

Regarding the recent re-exporting of ksize() to modules and the
discussion around it [2], this removes the single modular in-tree user
of ksize() again (unless I overgrepped something).

kfree() uses ksize() internally to determine the size of the memory
region to zero out.  This could mean overhead as the size is actually
that of the kmalloc cache the object is from, but memset() + kfree()
isn't really the common fast path pattern.

I left out w1 because I think it doesn't need to zero the memory at
all.  I will take a deeper look into it and send a followup with
either a kzfree() conversion or removal of the memset() alltogether.

	Hannes

[1] http://www.emn.fr/x-info/coccinelle/

	@@
	expression M, S;
	@@

	- memset(M, 0, S);
	- kfree(M);
	+ kzfree(M);

   (from the back of my head, no coccinelle installed on this box)

[2] http://lkml.org/lkml/2009/2/10/144

 arch/s390/crypto/prng.c             |    3 +--
 crypto/api.c                        |    5 +----
 drivers/md/dm-crypt.c               |    6 ++----
 drivers/s390/crypto/zcrypt_pcixcc.c |    3 +--
 drivers/usb/host/hwa-hc.c           |    3 +--
 drivers/usb/wusbcore/cbaf.c         |    3 +--
 fs/cifs/connect.c                   |    7 ++-----
 fs/cifs/misc.c                      |   12 ++++--------
 fs/ecryptfs/keystore.c              |    3 +--
 fs/ecryptfs/messaging.c             |    3 +--
 include/linux/slab.h                |    1 +
 mm/util.c                           |   19 +++++++++++++++++++
 net/atm/mpoa_caches.c               |   14 ++++----------
 13 files changed, 39 insertions(+), 43 deletions(-)

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

^ permalink raw reply	[flat|nested] 24+ messages in thread

end of thread, other threads:[~2009-02-17 16:09 UTC | newest]

Thread overview: 24+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-16 14:29 [patch 0/8] kzfree() Johannes Weiner
2009-02-16 14:29 ` [patch 1/8] slab: introduce kzfree() Johannes Weiner
2009-02-16 15:27   ` Johannes Weiner
2009-02-17 15:08     ` Christoph Lameter
2009-02-17 15:51       ` Pekka Enberg
2009-02-17 16:01         ` Christoph Lameter
2009-02-16 14:29 ` [patch 2/8] crypto: use kzfree() Johannes Weiner
2009-02-16 14:29 ` [patch 3/8] s390: " Johannes Weiner
2009-02-16 14:29 ` [patch 4/8] md: " Johannes Weiner
2009-02-16 14:29 ` [patch 5/8] usb: " Johannes Weiner
2009-02-16 14:29 ` [patch 6/8] cifs: " Johannes Weiner
2009-02-16 15:13   ` Pekka Enberg
2009-02-16 15:33     ` Johannes Weiner
2009-02-16 18:17       ` Pekka Enberg
2009-02-16 19:01       ` Steve French
2009-02-16 19:02       ` Steve French
2009-02-16 14:29 ` [patch 7/8] ecryptfs: " Johannes Weiner
2009-02-16 20:02   ` Andrew Morton
2009-02-16 20:28     ` Johannes Weiner
2009-02-17  7:51   ` Tyler Hicks
2009-02-16 14:29 ` [patch 8/8] atm: " Johannes Weiner
2009-02-16 19:59 ` [patch 0/8] kzfree() Andrew Morton
2009-02-16 19:58   ` Pekka Enberg
2009-02-16 20:19     ` Andrew Morton

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).