* [PATCH] profile: Use vzalloc rather than vmalloc & memset
@ 2010-10-30 19:56 Jesper Juhl
2010-10-31 15:13 ` [tip:perf/core] profile: Use vzalloc() rather than vmalloc() & memset() tip-bot for Jesper Juhl
0 siblings, 1 reply; 2+ messages in thread
From: Jesper Juhl @ 2010-10-30 19:56 UTC (permalink / raw)
To: linux-kernel; +Cc: Arjan van de Ven, Ingo Molnar, William Irwin, Andrew Morton
Hi,
There's no reason to memset() manually when we have vzalloc().
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
---
profile.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
Compile tested only.
diff --git a/kernel/profile.c b/kernel/profile.c
index 66f841b..14c9f87 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -126,11 +126,9 @@ int __ref profile_init(void)
if (prof_buffer)
return 0;
- prof_buffer = vmalloc(buffer_bytes);
- if (prof_buffer) {
- memset(prof_buffer, 0, buffer_bytes);
+ prof_buffer = vzalloc(buffer_bytes);
+ if (prof_buffer)
return 0;
- }
free_cpumask_var(prof_cpu_mask);
return -ENOMEM;
--
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 [flat|nested] 2+ messages in thread
* [tip:perf/core] profile: Use vzalloc() rather than vmalloc() & memset()
2010-10-30 19:56 [PATCH] profile: Use vzalloc rather than vmalloc & memset Jesper Juhl
@ 2010-10-31 15:13 ` tip-bot for Jesper Juhl
0 siblings, 0 replies; 2+ messages in thread
From: tip-bot for Jesper Juhl @ 2010-10-31 15:13 UTC (permalink / raw)
To: linux-tip-commits; +Cc: linux-kernel, hpa, mingo, arjan, jj, tglx, wli, mingo
Commit-ID: 559fa6e76b271b98ff641fa2a968aa2439e43c28
Gitweb: http://git.kernel.org/tip/559fa6e76b271b98ff641fa2a968aa2439e43c28
Author: Jesper Juhl <jj@chaosbits.net>
AuthorDate: Sat, 30 Oct 2010 21:56:26 +0200
Committer: Ingo Molnar <mingo@elte.hu>
CommitDate: Sun, 31 Oct 2010 09:47:26 +0100
profile: Use vzalloc() rather than vmalloc() & memset()
There's no reason to memset() manually when we have vzalloc().
Signed-off-by: Jesper Juhl <jj@chaosbits.net>
Cc: Arjan van de Ven <arjan@infradead.org>
Cc: William Irwin <wli@holomorphy.com>
LKML-Reference: <alpine.LNX.2.00.1010302150310.1572@swampdragon.chaosbits.net>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
---
kernel/profile.c | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/kernel/profile.c b/kernel/profile.c
index 66f841b..14c9f87 100644
--- a/kernel/profile.c
+++ b/kernel/profile.c
@@ -126,11 +126,9 @@ int __ref profile_init(void)
if (prof_buffer)
return 0;
- prof_buffer = vmalloc(buffer_bytes);
- if (prof_buffer) {
- memset(prof_buffer, 0, buffer_bytes);
+ prof_buffer = vzalloc(buffer_bytes);
+ if (prof_buffer)
return 0;
- }
free_cpumask_var(prof_cpu_mask);
return -ENOMEM;
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2010-10-31 15:18 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-10-30 19:56 [PATCH] profile: Use vzalloc rather than vmalloc & memset Jesper Juhl
2010-10-31 15:13 ` [tip:perf/core] profile: Use vzalloc() rather than vmalloc() & memset() tip-bot for Jesper Juhl
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome