Linux MIPS Architecture development
 help / color / mirror / Atom feed
* [PATCH][MIPS] fix user_cpus_allowed assignment
@ 2007-12-17 13:17 Pavel Kiryukhin
  2007-12-17 16:40 ` Kevin D. Kissell
  0 siblings, 1 reply; 4+ messages in thread
From: Pavel Kiryukhin @ 2007-12-17 13:17 UTC (permalink / raw)
  To: linux-mips; +Cc: vksavl

Hi,
there seems to be a bug in affinity handling for CONFIG_MIPS_MT_FPAFF=y.
It can be easily reproduced - for two-cpus system set new mask to 4.
Call fails, but next sched_getaffinity() call returns 0 as current
mask.
Simple fix is below.

Signed-off-by: Pavel Kiryukhin <vksavl@gmail.com>

diff --git a/arch/mips/kernel/mips-mt-fpaff.c
b/arch/mips/kernel/mips-mt-fpaff.cindex 892665b..774f91e 100644
--- a/arch/mips/kernel/mips-mt-fpaff.c
+++ b/arch/mips/kernel/mips-mt-fpaff.c
@@ -87,9 +87,6 @@ asmlinkage long mipsmt_sys_sched_setaffinity(pid_t
pid, unsigned int len,
        if (retval)
                goto out_unlock;

-       /* Record new user-specified CPU set for future reference */
-       p->thread.user_cpus_allowed = new_mask;
-
        /* Unlock the task list */
        read_unlock(&tasklist_lock);

@@ -104,6 +101,10 @@ asmlinkage long
mipsmt_sys_sched_setaffinity(pid_t pid, unsigned int len,
                retval = set_cpus_allowed(p, new_mask);
        }

+        /* Record new user-specified CPU set for future reference */
+       if (!retval)
+               p->thread.user_cpus_allowed = new_mask;
+
 out_unlock:
        put_task_struct(p);
        unlock_cpu_hotplug();

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-12-21  1:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-12-17 13:17 [PATCH][MIPS] fix user_cpus_allowed assignment Pavel Kiryukhin
2007-12-17 16:40 ` Kevin D. Kissell
2007-12-17 16:40   ` Kevin D. Kissell
2007-12-21  1:11   ` Ralf Baechle

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox