]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/blame - src/patches/suse-2.6.27.31/patches.arch/ppc-spufs-10-Explain-conditional-decrement-of-aff_.patch
Merge branch 'master' into next
[people/pmueller/ipfire-2.x.git] / src / patches / suse-2.6.27.31 / patches.arch / ppc-spufs-10-Explain-conditional-decrement-of-aff_.patch
CommitLineData
2cb7cef9
BS
1Subject: Explain conditional decrement of aff_sched_count
2From: Andre Detsch <adetsch@br.ibm.com>
3References: 447133 - LTC50070
4
5This patch adds a comment to clarify why atomic_dec_if_positive is being used
6to decrement gang's aff_sched_count on SPU context unbind.
7
8Signed-off-by: Andre Detsch <adetsch@br.ibm.com>
9Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
10Signed-off-by: Olaf Hering <olh@suse.de>
11---
12 arch/powerpc/platforms/cell/spufs/sched.c | 5 +++++
13 1 file changed, 5 insertions(+)
14
15--- a/arch/powerpc/platforms/cell/spufs/sched.c
16+++ b/arch/powerpc/platforms/cell/spufs/sched.c
17@@ -444,6 +444,11 @@ static void spu_unbind_context(struct sp
18 atomic_dec(&cbe_spu_info[spu->node].reserved_spus);
19
20 if (ctx->gang)
21+ /*
22+ * If ctx->gang->aff_sched_count is positive, SPU affinity is
23+ * being considered in this gang. Using atomic_dec_if_positive
24+ * allow us to skip an explicit check for affinity in this gang
25+ */
26 atomic_dec_if_positive(&ctx->gang->aff_sched_count);
27
28 spu_switch_notify(spu, NULL);