summaryrefslogtreecommitdiffstats
path: root/block/blk.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2010-09-21 11:19:32 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2010-09-21 11:19:32 +0100
commite9e5f8e8d373e72f5c39dafde1ce110fc7082118 (patch)
tree2991e33571a59cc2488daef36dcfeab7bddb9d7f /block/blk.h
parentf899fc64cda8569d0529452aafc0da31c042df2e (diff)
parentdb8c076b9206ea35b1f7299708d5510b17674db2 (diff)
downloadop-kernel-dev-e9e5f8e8d373e72f5c39dafde1ce110fc7082118.zip
op-kernel-dev-e9e5f8e8d373e72f5c39dafde1ce110fc7082118.tar.gz
Merge branch 'drm-intel-fixes' into HEAD
Conflicts: drivers/char/agp/intel-agp.c drivers/gpu/drm/i915/intel_crt.c
Diffstat (limited to 'block/blk.h')
-rw-r--r--block/blk.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/block/blk.h b/block/blk.h
index 6e7dc87..d6b911a 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;
}
/*
OpenPOWER on IntegriCloud