Skip to content

kzfree()

Johannes Weiner dm-devel linux-mm lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest8 patches 15 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8slab: introduce kzfree()include/linux/slab.h mm/util.c+20 -04 replies
2/8crypto: use kzfree()crypto/api.c+1 -40 replies
3/8s390: use kzfree()arch/s390/crypto/prng.c drivers/s390/crypto/zcrypt_pcixcc.c+2 -40 replies
4/8md: use kzfree()drivers/md/dm-crypt.c+2 -40 replies
5/8usb: use kzfree()drivers/usb/host/hwa-hc.c drivers/usb/wusbcore/cbaf.c+2 -40 replies
6/8cifs: use kzfree()fs/cifs/connect.c fs/cifs/misc.c+6 -135 replies
7/8ecryptfs: use kzfree()fs/ecryptfs/keystore.c fs/ecryptfs/messaging.c+2 -43 replies
8/8atm: use kzfree()net/atm/mpoa_caches.c+4 -100 replies

Reviews trailers per patch

3 of 8 patches have a Reviewed-by or Acked-by.

PatchPekka EnbergSteve FrenchTyler Hicks
1/8A-b
2/8
3/8
4/8
5/8
6/8R-b A-b A-b
7/8A-b
8/8

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.

Read the v1 thread

Cover letter [patch 0/8] kzfree()

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 [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>