diff options
author | David S. Miller <davem@davemloft.net> | 2010-10-06 19:11:17 -0700 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-10-06 19:11:17 -0700 |
commit | 12e94471b2be5ef9b55b10004a3a2cd819490036 (patch) | |
tree | f84ae818687dc7c35bd54f11bfb9717278d28a4e /block/blk.h | |
parent | 79315068f4560f3f7bd6e9790190dcb43059770c (diff) | |
parent | cb655d0f3d57c23db51b981648e452988c0223f9 (diff) | |
download | blackbird-op-linux-12e94471b2be5ef9b55b10004a3a2cd819490036.tar.gz blackbird-op-linux-12e94471b2be5ef9b55b10004a3a2cd819490036.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/torvalds/linux-2.6
Diffstat (limited to 'block/blk.h')
-rw-r--r-- | block/blk.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/block/blk.h b/block/blk.h index 6e7dc87141e4..d6b911ac002c 100644 --- a/block/blk.h +++ b/block/blk.h @@ -142,14 +142,18 @@ static inline int queue_congestion_off_threshold(struct request_queue *q) static inline int blk_cpu_to_group(int cpu) { + int group = NR_CPUS; #ifdef CONFIG_SCHED_MC const struct cpumask *mask = cpu_coregroup_mask(cpu); - return cpumask_first(mask); + group = cpumask_first(mask); #elif defined(CONFIG_SCHED_SMT) - return cpumask_first(topology_thread_cpumask(cpu)); + group = cpumask_first(topology_thread_cpumask(cpu)); #else return cpu; #endif + if (likely(group < NR_CPUS)) + return group; + return cpu; } /* |