Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1667634
| From | Daniel Bristot de Oliveira <bristot@redhat.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | [RFC 2/3] rt: Update nr_cpus_allowed if the affinity of a task changes while its migration is disabled |
| Date | 2017-06-16 12:50 +0200 |
| Message-ID | <tSWZb-7iK-5@gated-at.bofh.it> (permalink) |
| References | <tSWZb-7iK-7@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
Currently, if the affinity of a task changes when it is with migration
disabled, the nr_cpus_allowed is not being updated, creating an
inconsistency between nr_cpus_allowed and cpumask_weight(cpus_allowed)
This patch fixes this problem by calling set_cpus_allowed_common()
if the cpumask of a task changes while it is with migration disable.
Signed-off-by: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Luis Claudio R. Goncalves <lgoncalv@redhat.com>
Cc: Clark Williams <williams@redhat.com>
Cc: Luiz Capitulino <lcapitulino@redhat.com>
Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Thomas Gleixner <tglx@linutronix.de>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: LKML <linux-kernel@vger.kernel.org>
Cc: linux-rt-users <linux-rt-users@vger.kernel.org>
---
kernel/sched/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/sched/core.c b/kernel/sched/core.c
index aeb3e12..0396bf2 100644
--- a/kernel/sched/core.c
+++ b/kernel/sched/core.c
@@ -1146,7 +1146,7 @@ void do_set_cpus_allowed(struct task_struct *p, const struct cpumask *new_mask)
lockdep_assert_held(&p->pi_lock);
if (__migrate_disabled(p)) {
- cpumask_copy(&p->cpus_allowed, new_mask);
+ set_cpus_allowed_common(p, new_mask);
return;
}
--
2.9.4
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[RFC 0/3] rt: Some fixes for migrate_disable/enable Daniel Bristot de Oliveira <bristot@redhat.com> - 2017-06-16 12:50 +0200
[RFC 2/3] rt: Update nr_cpus_allowed if the affinity of a task changes while its migration is disabled Daniel Bristot de Oliveira <bristot@redhat.com> - 2017-06-16 12:50 +0200
[RFC 3/3] rt: Check if the task needs to migrate when re-enabling migration Daniel Bristot de Oliveira <bristot@redhat.com> - 2017-06-16 12:50 +0200
Re: [RFC 3/3] rt: Check if the task needs to migrate when re-enabling migration Sebastian Andrzej Siewior <bigeasy@linutronix.de> - 2017-06-16 19:00 +0200
[RFC 1/3] rt: Increase/decrease the nr of migratable tasks when enabling/disabling migration Daniel Bristot de Oliveira <bristot@redhat.com> - 2017-06-16 12:50 +0200
csiph-web