Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 42810
b: refs/heads/master
c: 128fb95
h: refs/heads/master
v: v3
  • Loading branch information
Oleg Nesterov authored and Linus Torvalds committed Dec 7, 2006
1 parent 2a62259 commit b975994
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 38da288b8ba2b07b4e07165027e650b61d7c8ffc
refs/heads/master: 128fb95650b3273a8dc9ba5514b6fe7db8ea30bf
17 changes: 4 additions & 13 deletions trunk/kernel/taskstats.c
Original file line number Diff line number Diff line change
Expand Up @@ -416,27 +416,18 @@ static int taskstats_user_cmd(struct sk_buff *skb, struct genl_info *info)
void taskstats_exit_alloc(struct taskstats **ptidstats, unsigned int *mycpu)
{
struct listener_list *listeners;
struct taskstats *tmp;
/*
* This is the cpu on which the task is exiting currently and will
* be the one for which the exit event is sent, even if the cpu
* on which this function is running changes later.
*/
*mycpu = raw_smp_processor_id();

*ptidstats = NULL;
tmp = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL);
if (!tmp)
return;

listeners = &per_cpu(listener_array, *mycpu);
down_read(&listeners->sem);
if (!list_empty(&listeners->list)) {
*ptidstats = tmp;
tmp = NULL;
}
up_read(&listeners->sem);
kfree(tmp);

*ptidstats = NULL;
if (!list_empty(&listeners->list))
*ptidstats = kmem_cache_zalloc(taskstats_cache, GFP_KERNEL);
}

/* Send pid data out on exit */
Expand Down

0 comments on commit b975994

Please sign in to comment.