* [PATCH 2/7] cgroups: use simple_malloc()/simple_free()
@ 2008-11-16 4:33 Lai Jiangshan
0 siblings, 0 replies; only message in thread
From: Lai Jiangshan @ 2008-11-16 4:33 UTC (permalink / raw)
To: Andrew Morton; +Cc: Paul Menage, Linux Kernel Mailing List
use simple_malloc()/simple_free() for large tasks file.
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
diff --git a/kernel/cgroup.c b/kernel/cgroup.c
index 358e775..349ec9a 100644
--- a/kernel/cgroup.c
+++ b/kernel/cgroup.c
@@ -2167,7 +2167,7 @@ static void release_cgroup_pid_array(struct cgroup *cgrp)
down_write(&cgrp->pids_mutex);
BUG_ON(!cgrp->pids_use_count);
if (!--cgrp->pids_use_count) {
- kfree(cgrp->tasks_pids);
+ simple_free(cgrp->tasks_pids);
cgrp->tasks_pids = NULL;
cgrp->pids_length = 0;
}
@@ -2215,7 +2215,7 @@ static int cgroup_tasks_open(struct inode *unused, struct file *file)
* show up until sometime later on.
*/
npids = cgroup_task_count(cgrp);
- pidarray = kmalloc(npids * sizeof(pid_t), GFP_KERNEL);
+ pidarray = simple_malloc(npids * sizeof(pid_t));
if (!pidarray)
return -ENOMEM;
npids = pid_array_load(pidarray, npids, cgrp);
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2008-11-16 4:37 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-16 4:33 [PATCH 2/7] cgroups: use simple_malloc()/simple_free() Lai Jiangshan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox