* [PATCH 29/36] ipc,rcu: convert call_rcu(free_un) to kfree_rcu()
@ 2011-03-18 4:09 Lai Jiangshan
0 siblings, 0 replies; only message in thread
From: Lai Jiangshan @ 2011-03-18 4:09 UTC (permalink / raw)
To: Paul E. McKenney, Ingo Molnar, Andrew Morton, Manfred Spraul,
Dan Rosenberg, Julia Lawall, linux-kernel
The rcu callback free_un() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(free_un).
Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
---
ipc/sem.c | 10 ++--------
1 files changed, 2 insertions(+), 8 deletions(-)
diff --git a/ipc/sem.c b/ipc/sem.c
index 0e0d49b..243437e 100644
--- a/ipc/sem.c
+++ b/ipc/sem.c
@@ -689,12 +689,6 @@ static int count_semzcnt (struct sem_array * sma, ushort semnum)
return semzcnt;
}
-static void free_un(struct rcu_head *head)
-{
- struct sem_undo *un = container_of(head, struct sem_undo, rcu);
- kfree(un);
-}
-
/* Free a semaphore set. freeary() is called with sem_ids.rw_mutex locked
* as a writer and the spinlock for this semaphore set hold. sem_ids.rw_mutex
* remains locked on exit.
@@ -714,7 +708,7 @@ static void freeary(struct ipc_namespace *ns, struct kern_ipc_perm *ipcp)
un->semid = -1;
list_del_rcu(&un->list_proc);
spin_unlock(&un->ulp->lock);
- call_rcu(&un->rcu, free_un);
+ kfree_rcu(un, rcu);
}
/* Wake up all pending processes and let them fail with EIDRM. */
@@ -1610,7 +1604,7 @@ void exit_sem(struct task_struct *tsk)
sem_unlock(sma);
wake_up_sem_queue_do(&tasks);
- call_rcu(&un->rcu, free_un);
+ kfree_rcu(un, rcu);
}
kfree(ulp);
}
--
1.7.4
^ permalink raw reply related [flat|nested] only message in thread
only message in thread, other threads:[~2011-03-18 4:07 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-18 4:09 [PATCH 29/36] ipc,rcu: convert call_rcu(free_un) to kfree_rcu() Lai Jiangshan
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox