Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 8568
b: refs/heads/master
c: b342659
h: refs/heads/master
v: v3
  • Loading branch information
Paul Jackson authored and Linus Torvalds committed Sep 12, 2005
1 parent 8985cbf commit 3fd3f85
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 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: f24ec7f6c6278c0ea4c00efe96d50b1e66796c44
refs/heads/master: b3426599af9524104be6938bcb1fcaab314781c7
1 change: 0 additions & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -785,7 +785,6 @@ struct task_struct {
short il_next;
#endif
#ifdef CONFIG_CPUSETS
short cpuset_sem_nest_depth;
struct cpuset *cpuset;
nodemask_t mems_allowed;
int cpuset_mems_generation;
Expand Down
13 changes: 9 additions & 4 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ static struct super_block *cpuset_sb = NULL;
*/

static DECLARE_MUTEX(cpuset_sem);
static struct task_struct *cpuset_sem_owner;
static int cpuset_sem_depth;

/*
* The global cpuset semaphore cpuset_sem can be needed by the
Expand All @@ -200,16 +202,19 @@ static DECLARE_MUTEX(cpuset_sem);

static inline void cpuset_down(struct semaphore *psem)
{
if (current->cpuset_sem_nest_depth == 0)
if (cpuset_sem_owner != current) {
down(psem);
current->cpuset_sem_nest_depth++;
cpuset_sem_owner = current;
}
cpuset_sem_depth++;
}

static inline void cpuset_up(struct semaphore *psem)
{
current->cpuset_sem_nest_depth--;
if (current->cpuset_sem_nest_depth == 0)
if (--cpuset_sem_depth == 0) {
cpuset_sem_owner = NULL;
up(psem);
}
}

/*
Expand Down

0 comments on commit 3fd3f85

Please sign in to comment.