[uml-devel] [PATCH 07/10] um: Should hold tasklist_lock while traversing processes

2012-03-24 Thread Anton Vorontsov
Traversing the tasks requires holding tasklist_lock, otherwise it is unsafe. p.s. However, I'm not sure that calling os_kill_ptraced_process() in the atomic context is correct. It seem to work, but please take a closer look. Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/um

[uml-devel] [PATCH 02/10] arm: Use clear_tasks_mm_cpumask()

2012-03-24 Thread Anton Vorontsov
walk up all threads and returns an appropriate task (with task lock held). clear_tasks_mm_cpumask() has all the issues fixed, so let's use it. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/arm/kernel/smp.c |8 +--- 1

[uml-devel] [PATCH 04/10] sh: Use clear_tasks_mm_cpumask()

2012-03-24 Thread Anton Vorontsov
walk up all threads and returns an appropriate task (with task lock held). clear_tasks_mm_cpumask() has all the issues fixed, so let's use it. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/sh/kernel/smp.c |7 +-- 1 file

[uml-devel] [PATCH 08/10] um: Fix possible race on task-mm

2012-03-24 Thread Anton Vorontsov
find_lock_task_mm() to check all process' threads for a valid mm, but for uml we'll do it in a separate patch. Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/um/kernel/reboot.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/um/kernel/reboot.c b/arch/um

[uml-devel] [PATCH 03/10] powerpc: Use clear_tasks_mm_cpumask()

2012-03-24 Thread Anton Vorontsov
walk up all threads and returns an appropriate task (with task lock held). clear_tasks_mm_cpumask() has all the issues fixed, so let's use it. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/powerpc/mm/mmu_context_nohash.c | 11

[uml-devel] [PATCH 05/10] blackfin: A couple of task-mm handling fixes

2012-03-24 Thread Anton Vorontsov
an appropriate task (with task lock held). Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/blackfin/kernel/trace.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/blackfin/kernel/trace.c b

[uml-devel] [PATCH 06/10] blackfin: Fix possible deadlock in decode_address()

2012-03-24 Thread Anton Vorontsov
of the tasklist lock, read_ one is enough. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/blackfin/kernel/trace.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin

[uml-devel] [PATCH 09/10] um: Properly check all process' threads for a live mm

2012-03-24 Thread Anton Vorontsov
an appropriate task (with task lock held). Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/um/kernel/reboot.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel

[uml-devel] [PATCH v2 0/10] Fixes for common mistakes w/ for_each_process and task-mm

2012-03-24 Thread Anton Vorontsov
better to fix it and move the logic into a common function. Thanks! -- Anton Vorontsov Email: cbouatmai...@gmail.com -- This SF email is sponsosred by: Try Windows Azure free for 90 days Click Here http://p.sf.net/sfu

Re: [uml-devel] [PATCH 07/10] um: Should hold tasklist_lock while traversing processes

2012-03-24 Thread Anton Vorontsov
On Sat, Mar 24, 2012 at 01:48:23PM +0100, Peter Zijlstra wrote: On Sat, 2012-03-24 at 14:30 +0400, Anton Vorontsov wrote: Traversing the tasks requires holding tasklist_lock, otherwise it is unsafe. No it doesn't, it either requires tasklist_lock or rcu_read_lock(). Well, currently

Re: [uml-devel] [PATCH 10/10] oom: Make find_lock_task_mm() sparse-aware

2012-03-24 Thread Anton Vorontsov
task_struct *find_lock_task_mm(struct task_struct *p) __ret_locked_nonnull(__ret_value-alloc_lock); Thanks, -- Anton Vorontsov Email: cbouatmai...@gmail.com -- This SF email is sponsosred by: Try Windows Azure free

[uml-devel] [PATCH v2.1 01/10] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-03-24 Thread Anton Vorontsov
and marked offline, so no new tasks will get this cpu set in their mm mask. Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- On Sat, Mar 24, 2012 at 01:43:41PM +0100, Peter Zijlstra wrote: On Sat, 2012-03-24 at 14:27 +0400, Anton Vorontsov wrote: + read_unlock(tasklist_lock

[uml-devel] [PATCH v3 0/9] Fixes for common mistakes w/ for_each_process and task-mm

2012-04-23 Thread Anton Vorontsov
for the whole tasklist_lock. Suggested by Peter Zijlstra. In v2: - introduced a small helper in cpu.c: most arches duplicate the same [buggy] code snippet, so it's better to fix it and move the logic into a common function. Thanks, -- Anton Vorontsov Email: cbouatmai...@gmail.com

[uml-devel] [PATCH 2/9] arm: Use clear_tasks_mm_cpumask()

2012-04-23 Thread Anton Vorontsov
). clear_tasks_mm_cpumask() has this issue fixed, so let's use it. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/arm/kernel/smp.c |8 +--- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/arch/arm/kernel/smp.c b/arch

[uml-devel] [PATCH 7/9] um: Should hold tasklist_lock while traversing processes

2012-04-23 Thread Anton Vorontsov
Traversing the tasks requires holding tasklist_lock, otherwise it is unsafe. p.s. However, I'm not sure that calling os_kill_ptraced_process() in the atomic context is correct. It seem to work, but please take a closer look. Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/um

[uml-devel] [PATCH 1/9] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-04-23 Thread Anton Vorontsov
is called after the cpu is taken down and marked offline, so no new tasks will get this cpu set in their mm mask. Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- include/linux/cpu.h |1 + kernel/cpu.c| 26 ++ 2 files changed, 27 insertions(+) diff

[uml-devel] [PATCH 8/9] um: Fix possible race on task-mm

2012-04-23 Thread Anton Vorontsov
find_lock_task_mm() to check all process' threads for a valid mm, but for uml we'll do it in a separate patch. Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/um/kernel/reboot.c |7 +-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/arch/um/kernel/reboot.c b/arch/um

[uml-devel] [PATCH 5/9] blackfin: A couple of task-mm handling fixes

2012-04-23 Thread Anton Vorontsov
an appropriate task (with task lock held). Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/blackfin/kernel/trace.c | 26 +- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/arch/blackfin/kernel/trace.c b

[uml-devel] [PATCH 4/9] sh: Use clear_tasks_mm_cpumask()

2012-04-23 Thread Anton Vorontsov
). clear_tasks_mm_cpumask() has the issue fixed, so let's use it. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/sh/kernel/smp.c |7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/arch/sh/kernel/smp.c b/arch/sh

[uml-devel] [PATCH 3/9] powerpc: Use clear_tasks_mm_cpumask()

2012-04-23 Thread Anton Vorontsov
walk up all threads and returns an appropriate task (with task lock held). clear_tasks_mm_cpumask() has all the issues fixed, so let's use it. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/powerpc/mm/mmu_context_nohash.c | 11

[uml-devel] [PATCH 6/9] blackfin: Fix possible deadlock in decode_address()

2012-04-23 Thread Anton Vorontsov
of the tasklist lock, read_ one is enough. Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/blackfin/kernel/trace.c |6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/blackfin/kernel/trace.c b/arch/blackfin

[uml-devel] [PATCH 9/9] um: Properly check all process' threads for a live mm

2012-04-23 Thread Anton Vorontsov
an appropriate task (with task lock held). Suggested-by: Oleg Nesterov o...@redhat.com Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- arch/um/kernel/reboot.c | 13 +++-- 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/arch/um/kernel/reboot.c b/arch/um/kernel

Re: [uml-devel] [PATCH 7/9] um: Should hold tasklist_lock while traversing processes

2012-04-23 Thread Anton Vorontsov
On Mon, Apr 23, 2012 at 04:57:54PM +0200, Richard Weinberger wrote: On 23.04.2012 09:09, Anton Vorontsov wrote: Traversing the tasks requires holding tasklist_lock, otherwise it is unsafe. p.s. However, I'm not sure that calling os_kill_ptraced_process() in the atomic context is correct

Re: [uml-devel] [PATCH 1/9] cpu: Introduce clear_tasks_mm_cpumask() helper

2012-05-04 Thread Anton Vorontsov
(); +} It is good that this code exists under CONFIG_HOTPLUG_CPU. Did you check that everything works correctly with CONFIG_HOTPLUG_CPU=n? Yeah, only the code under CONFIG_HOTPLUG_CPU calls the function, so it should be all fine. Thanks! -- Anton Vorontsov Email: cbouatmai...@gmail.com

[uml-devel] [PATCH] cpu: Document clear_tasks_mm_cpumask()

2012-05-04 Thread Anton Vorontsov
...@chello.nl Signed-off-by: Anton Vorontsov anton.voront...@linaro.org --- On Tue, May 01, 2012 at 12:45:33PM +0200, Peter Zijlstra wrote: On Thu, 2012-04-26 at 16:59 -0700, Andrew Morton wrote: +void clear_tasks_mm_cpumask(int cpu) The operation of this function was presumably obvious to you