Skip to content

Commit

Permalink
ipc,rcu: Convert call_rcu(ipc_immediate_free) to kfree_rcu()
Browse files Browse the repository at this point in the history
The rcu callback ipc_immediate_free() just calls a kfree(),
so we use kfree_rcu() instead of the call_rcu(ipc_immediate_free).

Signed-off-by: Lai Jiangshan <[email protected]>
Signed-off-by: Paul E. McKenney <[email protected]>
Cc: Andrew Morton <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
  • Loading branch information
Lai Jiangshan authored and paulmck committed Jul 20, 2011
1 parent 693a8b6 commit d4ee9aa
Showing 1 changed file with 1 addition and 15 deletions.
16 changes: 1 addition & 15 deletions ipc/util.c
Original file line number Diff line number Diff line change
Expand Up @@ -579,19 +579,6 @@ static void ipc_schedule_free(struct rcu_head *head)
schedule_work(&sched->work);
}

/**
* ipc_immediate_free - free ipc + rcu space
* @head: RCU callback structure that contains pointer to be freed
*
* Free from the RCU callback context.
*/
static void ipc_immediate_free(struct rcu_head *head)
{
struct ipc_rcu_grace *free =
container_of(head, struct ipc_rcu_grace, rcu);
kfree(free);
}

void ipc_rcu_putref(void *ptr)
{
if (--container_of(ptr, struct ipc_rcu_hdr, data)->refcount > 0)
Expand All @@ -601,8 +588,7 @@ void ipc_rcu_putref(void *ptr)
call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu,
ipc_schedule_free);
} else {
call_rcu(&container_of(ptr, struct ipc_rcu_grace, data)->rcu,
ipc_immediate_free);
kfree_rcu(container_of(ptr, struct ipc_rcu_grace, data), rcu);
}
}

Expand Down

0 comments on commit d4ee9aa

Please sign in to comment.