public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: David Howells <dhowells@redhat.com>
Cc: linux-kernel@vger.kernel.org, Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH 7/8] FDPIC: Add coredump capability for the ELF-FDPIC binfmt [try #4]
Date: Mon, 10 Jul 2006 06:46:57 +0400	[thread overview]
Message-ID: <20060710024657.GA255@oleg> (raw)

David Howells wrote:
>
> +static int elf_fdpic_core_dump(long signr, struct pt_regs *regs,
> +			       struct file *file)
> +{
>
>  [... snip ...]
>
> +		read_lock(&tasklist_lock);
> +		do_each_thread(g,p)
> +			if (current->mm == p->mm && current != p) {
> +				tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC);
> +				if (!tmp) {
> +					read_unlock(&tasklist_lock);
> +					goto cleanup;
> +				}
> +				INIT_LIST_HEAD(&tmp->list);
> +				tmp->thread = p;
> +				list_add(&tmp->list, &thread_list);
> +			}
> +		while_each_thread(g,p);
> +		read_unlock(&tasklist_lock);

Do you see any reason for tasklist_lock here (and in elf_core_dump) ?

do_each_thread() is rcu-safe, and all tasks which use this ->mm must
sleep in wait_for_completion(&mm->core_done) at this point.

Oleg.


             reply	other threads:[~2006-07-09 22:46 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-07-10  2:46 Oleg Nesterov [this message]
2006-07-10 13:31 ` [PATCH 7/8] FDPIC: Add coredump capability for the ELF-FDPIC binfmt [try #4] David Howells
2006-07-11 17:45   ` Oleg Nesterov
  -- strict thread matches above, loose matches on Subject: below --
2006-07-07 11:47 [PATCH 0/8] Fix FRV, ELF-FDPIC and NOMMU stuff " David Howells
2006-07-07 11:47 ` [PATCH 7/8] FDPIC: Add coredump capability for the ELF-FDPIC binfmt " David Howells

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=20060710024657.GA255@oleg \
    --to=oleg@tv-sign.ru \
    --cc=akpm@osdl.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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