* Scheduling while atomic in find_task_lock_mm
@ 2015-07-22 18:39 David VomLehn
0 siblings, 0 replies; only message in thread
From: David VomLehn @ 2015-07-22 18:39 UTC (permalink / raw)
To: linux-rt-users@vger.kernel.org
I'm trying to port the RT patch to Android (based on Linux 3.10) and things have been
going pretty smoothly. However, I've hit a snag--I have to have hot plugging enabled
and when the system tries to take down a CPU, it gets "scheduling while atomic". At
a high level, the code to take the CPU down is trying to clear the CPU's bit in the
mm_struct associated with every task_struct.
In more detail, cpu_stopper_thread() disables preemption, then there is a sequence
of calls, passing through the ARM-specific __cpu_disable(), finally atrriving at
find_lock_task_mm(). That function calls task_lock(), which uses spin_lock() to
lock a task_struct. When it encounters a task_struct that is already locked, schedule()
gets called and Bad Things happen.
So:
o I don't think I can enable preemption here because it's pretty like another
task will swoop in and mess things up.
o Using a raw_spin_lock() just for ARM doesn't seem like a good choice.
o I *think* I do need the spin_lock() before changing the CPU's bit in the
cpu_vm_mask_var element of the mm_struct.
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2015-07-22 18:40 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-22 18:39 Scheduling while atomic in find_task_lock_mm David VomLehn
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).