All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] cgroup: Avoid a memset by using vzalloc
@ 2010-10-30 21:35 ` Jesper Juhl
  0 siblings, 0 replies; 153+ messages in thread
From: Jesper Juhl @ 2010-10-30 21:35 UTC (permalink / raw)
  To: linux-kernel; +Cc: linux-mm, Paul Menage, Li Zefan, containers

Hi,

We can avoid doing a memset in swap_cgroup_swapon() by using vzalloc().


Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
compile tested only.
 page_cgroup.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada..34970c7 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -450,11 +450,10 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
 	length = ((max_pages/SC_PER_PAGE) + 1);
 	array_size = length * sizeof(void *);
 
-	array = vmalloc(array_size);
+	array = vzalloc(array_size);
 	if (!array)
 		goto nomem;
 
-	memset(array, 0, array_size);
 	ctrl = &swap_cgroup_ctrl[type];
 	mutex_lock(&swap_cgroup_mutex);
 	ctrl->length = length;

-- 
Jesper Juhl <jj@chaosbits.net>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html


^ permalink raw reply related	[flat|nested] 153+ messages in thread
* [PATCH] cgroup: Avoid a memset by using vzalloc
@ 2010-10-30 21:35 Jesper Juhl
  0 siblings, 0 replies; 153+ messages in thread
From: Jesper Juhl @ 2010-10-30 21:35 UTC (permalink / raw)
  To: linux-kernel-u79uwXL29TY76Z2rM5mHXA
  Cc: linux-mm-Bw31MaZKKs3YtjvyW6yDsg, Paul Menage,
	containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA

Hi,

We can avoid doing a memset in swap_cgroup_swapon() by using vzalloc().


Signed-off-by: Jesper Juhl <jj-IYz4IdjRLj0sV2N9l4h3zg@public.gmane.org>
---
compile tested only.
 page_cgroup.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/mm/page_cgroup.c b/mm/page_cgroup.c
index 5bffada..34970c7 100644
--- a/mm/page_cgroup.c
+++ b/mm/page_cgroup.c
@@ -450,11 +450,10 @@ int swap_cgroup_swapon(int type, unsigned long max_pages)
 	length = ((max_pages/SC_PER_PAGE) + 1);
 	array_size = length * sizeof(void *);
 
-	array = vmalloc(array_size);
+	array = vzalloc(array_size);
 	if (!array)
 		goto nomem;
 
-	memset(array, 0, array_size);
 	ctrl = &swap_cgroup_ctrl[type];
 	mutex_lock(&swap_cgroup_mutex);
 	ctrl->length = length;

-- 
Jesper Juhl <jj-IYz4IdjRLj0sV2N9l4h3zg@public.gmane.org>             http://www.chaosbits.net/
Plain text mails only, please      http://www.expita.com/nomime.html
Don't top-post  http://www.catb.org/~esr/jargon/html/T/top-post.html

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

end of thread, other threads:[~2011-01-17 20:28 UTC | newest]

Thread overview: 153+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 21:35 [PATCH] cgroup: Avoid a memset by using vzalloc Jesper Juhl
2010-10-30 21:35 ` Jesper Juhl
2010-10-30 23:34 ` Minchan Kim
2010-10-30 23:34   ` Minchan Kim
2010-10-31 17:33   ` Balbir Singh
2010-10-31 17:33     ` Balbir Singh
2010-11-01  5:40     ` Jesper Juhl
2010-11-01  5:40       ` Jesper Juhl
2010-11-03 14:38       ` Christoph Lameter
2010-11-03 14:38         ` Christoph Lameter
2010-11-03 15:20         ` jovi zhang
2010-11-03 15:20           ` jovi zhang
2010-11-03 15:48           ` Joe Perches
2010-11-03 15:48             ` Joe Perches
2010-11-03 16:10             ` Christoph Lameter
2010-11-03 16:10               ` Christoph Lameter
2010-11-04 21:43               ` Jesper Juhl
2010-11-04 21:43                 ` Jesper Juhl
     [not found]               ` <alpine.DEB.2.00.1011031108260.11625-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-11-04 21:43                 ` Jesper Juhl
2010-11-05  3:07                 ` [PATCH 00/49] Use vzalloc not vmalloc/kmemset Joe Perches
2010-11-05  3:07                 ` [PATCH 12/49] drivers/infiniband: Use vzalloc Joe Perches
2010-11-05  3:07                   ` Joe Perches
     [not found]                   ` <2a6dc4ae9321aef16372b34fc65ceda93190af0a.1288925424.git.joe-6d6DIl74uiNBDgjK7y7TUQ@public.gmane.org>
2011-01-12 19:12                     ` Roland Dreier
2011-01-12 19:12                       ` Roland Dreier
2010-11-05  3:08                 ` [PATCH 44/49] mm: " Joe Perches
2010-11-05  3:07               ` [PATCH 00/49] Use vzalloc not vmalloc/kmemset Joe Perches
2010-11-05  3:07                 ` Joe Perches
2010-11-05  3:07                 ` Joe Perches
2010-11-05  3:07                 ` Joe Perches
2010-11-05  3:07                 ` Joe Perches
2010-11-05  3:07                 ` [PATCH 01/49] arch/ia64: Use vzalloc Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                 ` [PATCH 02/49] arch/mips: " Joe Perches
2010-11-05 10:51                   ` Ralf Baechle
2010-11-05  3:07                 ` [PATCH 03/49] arch/powerpc: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05 13:08                   ` [Cbe-oss-dev] " Jeremy Kerr
2010-11-05 13:08                     ` Jeremy Kerr
2010-11-05 13:08                     ` Jeremy Kerr
2010-11-05  3:07                 ` [PATCH 04/49] arch/s390: " Joe Perches
2010-11-05  3:07                 ` [PATCH 05/49] arch/x86: " Joe Perches
2010-11-05  4:22                   ` Takuya Yoshikawa
2010-11-05  3:07                 ` [PATCH 06/49] crypto: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-27  8:31                   ` Herbert Xu
2010-11-27  8:31                     ` Herbert Xu
2010-11-05  3:07                 ` [PATCH 07/49] drivers/atm: " Joe Perches
2010-11-05  3:07                 ` [PATCH 08/49] drivers/block: " Joe Perches
2010-11-05  3:07                 ` [PATCH 09/49] drivers/char: " Joe Perches
2010-11-05  3:07                 ` [PATCH 10/49] drivers/gpu: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  9:29                   ` Thomas Hellstrom
2010-11-05  3:07                 ` [PATCH 11/49] drivers/hid: " Joe Perches
2010-11-05  3:07                 ` [PATCH 13/49] drivers/isdn: " Joe Perches
2010-11-05  3:07                 ` [PATCH 14/49] drivers/md: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2011-01-17 20:28                   ` Mike Snitzer
2010-11-05  3:07                 ` [PATCH 15/49] drivers/media: " Joe Perches
2010-11-05  3:07                 ` [PATCH 16/49] drivers/mtd: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-13 11:19                   ` Artem Bityutskiy
2010-11-13 11:19                     ` Artem Bityutskiy
2010-11-05  3:07                 ` [PATCH 17/49] drivers/net/cxgb3: " Joe Perches
2010-11-05  3:07                 ` [PATCH 18/49] drivers/net/cxgb4: " Joe Perches
2010-11-05  3:07                 ` [PATCH 19/49] drivers/net/e1000: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                 ` [PATCH 20/49] drivers/net/e1000e: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                 ` [PATCH 21/49] drivers/net/ehea: " Joe Perches
2010-11-05  3:07                 ` [PATCH 22/49] drivers/net/igb: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                 ` [PATCH 23/49] drivers/net/igbvf: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05 11:58                   ` Rose, Gregory V
2010-11-05 11:58                     ` Rose, Gregory V
2010-11-05  3:07                 ` [PATCH 24/49] drivers/net/ixgb: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                 ` [PATCH 25/49] drivers/net/ixgbe: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05  3:07                 ` [PATCH 26/49] drivers/net/ixgbevf: " Joe Perches
2010-11-05  3:07                   ` Joe Perches
2010-11-05 11:59                   ` Rose, Gregory V
2010-11-05 11:59                     ` Rose, Gregory V
2010-11-05  3:07                 ` [PATCH 27/49] drivers/net/netxen: " Joe Perches
2010-11-05  5:18                   ` Amit Salecha
2010-11-05  3:07                 ` [PATCH 28/49] drivers/net/pch_gbe: " Joe Perches
2010-11-05  3:07                 ` [PATCH 29/49] drivers/net/qlcnic: " Joe Perches
2010-11-05  3:07                 ` [PATCH 30/49] drivers/net/sfc: " Joe Perches
2010-11-05  3:07                 ` [PATCH 31/49] drivers/net/vxge: " Joe Perches
2010-11-05  3:07                 ` [PATCH 32/49] drivers/net/bnx2.c: " Joe Perches
2010-11-05  3:07                 ` [PATCH 33/49] drivers/s390: " Joe Perches
2010-11-05  3:07                 ` [PATCH 34/49] drivers/scsi: " Joe Perches
2010-11-05  3:07                 ` [PATCH 35/49] drivers/staging: " Joe Perches
2010-11-05  3:08                 ` [PATCH 36/49] drivers/video: " Joe Perches
2010-11-05  5:27                   ` Dave Young
2010-11-05  5:31                     ` Joe Perches
2010-11-08 16:43                   ` Konrad Rzeszutek Wilk
2010-11-05  3:08                 ` [PATCH 37/49] fs/ext4: " Joe Perches
2010-11-05  7:02                   ` Andreas Dilger
2010-11-05  7:18                     ` [PATCH V2 " Joe Perches
2010-12-20  3:22                       ` Ted Ts'o
2010-11-05  3:08                 ` [PATCH 38/49] fs/jffs2: " Joe Perches
2010-11-05  3:08                   ` Joe Perches
2010-11-13 11:19                   ` Artem Bityutskiy
2010-11-13 11:19                     ` Artem Bityutskiy
2010-11-05  3:08                 ` [PATCH 39/49] fs/reiserfs: " Joe Perches
2010-11-05  3:08                 ` [PATCH 40/49] fs/udf: " Joe Perches
2010-11-05  9:11                   ` Jan Kara
2010-11-05  9:15                     ` Peter Bortas
2010-11-05  9:30                       ` Jan Kara
2010-11-05  3:08                 ` [PATCH 41/49] fs/xfs: " Joe Perches
2010-11-05  3:08                   ` Joe Perches
2010-11-05 17:09                   ` Alex Elder
2010-11-05 17:09                     ` Alex Elder
2010-11-05  3:08                 ` [PATCH 42/49] include/linux/coda_linux.h: " Joe Perches
2010-11-05  3:08                 ` [PATCH 43/49] kernel: " Joe Perches
2010-11-05  3:08                 ` [PATCH 44/49] mm: " Joe Perches
2010-11-05  3:08                   ` Joe Perches
2010-11-05  3:08                 ` [PATCH 45/49] net/core/pktgen.c: " Joe Perches
2010-11-05  3:08                 ` [PATCH 46/49] net/netfilter: " Joe Perches
2010-11-05  6:30                   ` Eric Dumazet
2010-11-05  6:55                     ` Joe Perches
2010-11-05  7:16                       ` Eric Dumazet
2010-11-05  7:16                         ` Eric Dumazet
2010-11-05 17:01                         ` Jesper Juhl
2010-11-05 15:10                       ` Jiri Kosina
2010-11-05 15:25                         ` Joe Perches
2010-11-05  3:08                 ` [PATCH 47/49] net/rds: " Joe Perches
2010-11-05  3:08                 ` [PATCH 48/49] sound/oss/dev_table.c: " Joe Perches
2010-11-22  6:59                   ` Takashi Iwai
2010-11-22  6:59                     ` Takashi Iwai
2010-11-05  3:08                 ` [PATCH 49/49] virt/kvm/kvm_main.c: " Joe Perches
2010-11-05  4:25                   ` Takuya Yoshikawa
2010-11-05  4:44                     ` Joe Perches
2010-11-05  5:31                 ` [PATCH V2 36/49] drivers/video: " Joe Perches
2010-11-03 16:10             ` [PATCH] cgroup: Avoid a memset by using vzalloc Christoph Lameter
2010-11-03 16:37           ` Américo Wang
2010-11-03 16:37             ` Américo Wang
     [not found]           ` <AANLkTinhAQ7mNQWtjWCOWEHHwgUf+BynMM7jnVBMG32--JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-11-03 15:31             ` Christoph Lameter
2010-11-03 15:31               ` Christoph Lameter
2010-11-03 15:31               ` Christoph Lameter
2010-11-03 15:48             ` Joe Perches
2010-11-03 16:37             ` Américo Wang
     [not found]         ` <alpine.DEB.2.00.1011030937580.10599-sBS69tsa9Uj/9pzu0YdTqQ@public.gmane.org>
2010-11-03 15:20           ` jovi zhang
     [not found]       ` <alpine.LNX.2.00.1011010639410.31190-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
2010-11-03 14:38         ` Christoph Lameter
     [not found]     ` <20101031173336.GA28141-SINUvgVNF2CyUtPGxGje5AC/G2K4zDHf@public.gmane.org>
2010-11-01  5:40       ` Jesper Juhl
     [not found]   ` <AANLkTi=nMU3ezNFD8LKBhJxr6CmW6-qHY_Mo3HRt6Os0-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2010-10-31 17:33     ` Balbir Singh
     [not found] ` <alpine.LNX.2.00.1010302333130.1572-h2p7t3/P30RzeRGmFJ5qR7ZzlVVXadcDXqFh9Ls21Oc@public.gmane.org>
2010-10-30 23:34   ` Minchan Kim
2010-11-01 22:00   ` Paul Menage
2010-11-01 22:00 ` Paul Menage
2010-11-01 22:00   ` Paul Menage
2010-10-30 21:35 Jesper Juhl

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.