Scheduling while atomic in find_task_lock_mm

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [RT Stable]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Video 4 Linux]     [Device Mapper]

  Powered by Linux