Fix for a race condition when a task gets preempted by another task
while executing the destroy_context(...) in a FEW_CONTEXTS environment.
mm->context == NO_CONTEXT but the context_map may indicate all contexts
are in use.
The solution to this problem is to disable kernel preemption while
destroying a MMU context.
Signed-off-by: Guillaume Autran <redacted>
---
diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
On Tue, Jul 12, 2005 at 10:23:51AM -0400, Guillaume Autran wrote:
quoted hunk
Fix for a race condition when a task gets preempted by another task
while executing the destroy_context(...) in a FEW_CONTEXTS environment.
mm->context == NO_CONTEXT but the context_map may indicate all contexts
are in use.
The solution to this problem is to disable kernel preemption while
destroying a MMU context.
Signed-off-by: Guillaume Autran <redacted>
---
diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
Could you explain, why this patch is needed?
AFAIK, destroy_context() is only called from switch_mm(), which in
turn is called from schedule() with preemption already disabled. If
not, IMHO we have bigger problems, and "fixing" destroy_context() will
only hide such problems.
--
Eugene
Eugene, destroy_context(..) can be called from other place outside of
the scheduler and switch_mm(...). See mmdrop(...) for example.
In many of those cases, the task will run with preemption enable.
Guillaume.
Eugene Surovegin wrote:
On Tue, Jul 12, 2005 at 10:23:51AM -0400, Guillaume Autran wrote:
quoted
Fix for a race condition when a task gets preempted by another task
while executing the destroy_context(...) in a FEW_CONTEXTS environment.
mm->context == NO_CONTEXT but the context_map may indicate all contexts
are in use.
The solution to this problem is to disable kernel preemption while
destroying a MMU context.
Signed-off-by: Guillaume Autran <redacted>
---
diff -Nru a/include/asm-ppc/mmu_context.h b/include/asm-ppc/mmu_context.h
Could you explain, why this patch is needed?
AFAIK, destroy_context() is only called from switch_mm(), which in
turn is called from schedule() with preemption already disabled. If
not, IMHO we have bigger problems, and "fixing" destroy_context() will
only hide such problems.
On Tue, Jul 12, 2005 at 02:29:04PM -0400, Guillaume Autran wrote:
Eugene, destroy_context(..) can be called from other place outside of
the scheduler and switch_mm(...). See mmdrop(...) for example.
In many of those cases, the task will run with preemption enable.
Ahh, OK, you're right. Maybe it's worth mentioning in the patch
description :).
--
Eugene
From: Benjamin Herrenschmidt <benh@kernel.crashing.org> Date: 2005-07-13 00:11:38
On Tue, 2005-07-12 at 10:23 -0400, Guillaume Autran wrote:
Fix for a race condition when a task gets preempted by another task
while executing the destroy_context(...) in a FEW_CONTEXTS environment.
mm->context == NO_CONTEXT but the context_map may indicate all contexts
are in use.
The solution to this problem is to disable kernel preemption while
destroying a MMU context.
Signed-off-by: Guillaume Autran <redacted>
Acked-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>