From: vapier@gentoo•org (Mike Frysinger)
To: linux-arm-kernel@lists•infradead.org
Subject: [PATCH 5/9] blackfin: A couple of task->mm handling fixes
Date: Fri, 1 Jun 2012 00:36:35 -0400 [thread overview]
Message-ID: <201206010036.40468.vapier@gentoo.org> (raw)
In-Reply-To: <20120423070901.GE30752@lizard>
On Monday 23 April 2012 03:09:01 Anton Vorontsov wrote:
> 1. Working with task->mm w/o getting mm or grabing the task lock is
> dangerous as ->mm might disappear (exit_mm() assigns NULL under
> task_lock(), so tasklist lock is not enough).
that isn't a problem for this code as it specifically checks if it's in an
atomic section. if it is, then task->mm can't go away on us.
> We can't use get_task_mm()/mmput() pair as mmput() might sleep,
> so we have to take the task lock while handle its mm.
if we're not in an atomic section, then sleeping is fine.
> 2. Checking for process->mm is not enough because process' main
> thread may exit or detach its mm via use_mm(), but other threads
> may still have a valid mm.
i don't think it matters for this code (per the reasons above).
> To catch this we use find_lock_task_mm(), which walks up all
> threads and returns an appropriate task (with task lock held).
certainly fine for the non-atomic code path. i guess we'll notice in crashes
if it causes a problem in atomic code paths as well.
-mike
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20120601/ff9a5018/attachment.sig>
next prev parent reply other threads:[~2012-06-01 4:36 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-04-23 7:06 [PATCH v3 0/9] Fixes for common mistakes w/ for_each_process and task->mm Anton Vorontsov
2012-04-23 7:07 ` [PATCH 1/9] cpu: Introduce clear_tasks_mm_cpumask() helper Anton Vorontsov
2012-04-26 23:59 ` Andrew Morton
2012-05-01 10:45 ` Peter Zijlstra
2012-05-05 1:47 ` [PATCH] cpu: Document clear_tasks_mm_cpumask() Anton Vorontsov
2012-05-05 1:47 ` [PATCH 1/9] cpu: Introduce clear_tasks_mm_cpumask() helper Anton Vorontsov
2012-04-23 7:08 ` [PATCH 2/9] arm: Use clear_tasks_mm_cpumask() Anton Vorontsov
2012-04-23 7:08 ` [PATCH 3/9] powerpc: " Anton Vorontsov
2012-04-23 7:08 ` [PATCH 4/9] sh: " Anton Vorontsov
2012-04-23 7:09 ` [PATCH 5/9] blackfin: A couple of task->mm handling fixes Anton Vorontsov
2012-06-01 4:36 ` Mike Frysinger [this message]
2012-04-23 7:09 ` [PATCH 6/9] blackfin: Fix possible deadlock in decode_address() Anton Vorontsov
2012-04-23 7:09 ` [PATCH 7/9] um: Should hold tasklist_lock while traversing processes Anton Vorontsov
2012-04-23 14:57 ` Richard Weinberger
2012-04-23 15:40 ` Anton Vorontsov
2012-04-23 7:09 ` [PATCH 8/9] um: Fix possible race on task->mm Anton Vorontsov
2012-04-23 7:09 ` [PATCH 9/9] um: Properly check all process' threads for a live mm Anton Vorontsov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=201206010036.40468.vapier@gentoo.org \
--to=vapier@gentoo$(echo .)org \
--cc=linux-arm-kernel@lists$(echo .)infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox