Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 105916
b: refs/heads/master
c: 0241248
h: refs/heads/master
v: v3
  • Loading branch information
Lai Jiangshan authored and Linus Torvalds committed Jul 25, 2008
1 parent 4f603ad commit e81392b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 32 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: 489a5393a20dcbf91104052120eb2eff8791b61b
refs/heads/master: 02412483777651a26b19a75e49c2a451a174ca9c
37 changes: 6 additions & 31 deletions trunk/kernel/cpuset.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,36 +709,6 @@ void rebuild_sched_domains(void)
/* Don't kfree(dattr) -- partition_sched_domains() does that. */
}

static inline int started_after_time(struct task_struct *t1,
struct timespec *time,
struct task_struct *t2)
{
int start_diff = timespec_compare(&t1->start_time, time);
if (start_diff > 0) {
return 1;
} else if (start_diff < 0) {
return 0;
} else {
/*
* Arbitrarily, if two processes started at the same
* time, we'll say that the lower pointer value
* started first. Note that t2 may have exited by now
* so this may not be a valid pointer any longer, but
* that's fine - it still serves to distinguish
* between two tasks started (effectively)
* simultaneously.
*/
return t1 > t2;
}
}

static inline int started_after(void *p1, void *p2)
{
struct task_struct *t1 = p1;
struct task_struct *t2 = p2;
return started_after_time(t1, &t2->start_time, t2);
}

/**
* cpuset_test_cpumask - test a task's cpus_allowed versus its cpuset's
* @tsk: task to test
Expand Down Expand Up @@ -790,7 +760,12 @@ static int update_tasks_cpumask(struct cpuset *cs)
struct ptr_heap heap;
int retval;

retval = heap_init(&heap, PAGE_SIZE, GFP_KERNEL, &started_after);
/*
* cgroup_scan_tasks() will initialize heap->gt for us.
* heap_init() is still needed here for we should not change
* cs->cpus_allowed when heap_init() fails.
*/
retval = heap_init(&heap, PAGE_SIZE, GFP_KERNEL, NULL);
if (retval)
return retval;

Expand Down

0 comments on commit e81392b

Please sign in to comment.