]>
Commit | Line | Data |
---|---|---|
2cb7cef9 BS |
1 | Subject: Explain conditional decrement of aff_sched_count |
2 | From: Andre Detsch <adetsch@br.ibm.com> | |
3 | References: 447133 - LTC50070 | |
4 | ||
5 | This patch adds a comment to clarify why atomic_dec_if_positive is being used | |
6 | to decrement gang's aff_sched_count on SPU context unbind. | |
7 | ||
8 | Signed-off-by: Andre Detsch <adetsch@br.ibm.com> | |
9 | Signed-off-by: Jeremy Kerr <jk@ozlabs.org> | |
10 | Signed-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); |