All of lore.kernel.org
 help / color / mirror / Atom feed
From: Balbir Singh <balbir@linux.vnet.ibm.com>
To: Hugh Dickins <hugh@veritas.com>
Cc: Paul Menage <menage@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org
Subject: Re: [PATCH 1/7] mm: remove cgroup_mm_owner_callbacks
Date: Thu, 20 Nov 2008 22:11:56 +0530	[thread overview]
Message-ID: <49259354.2030604@linux.vnet.ibm.com> (raw)
In-Reply-To: <Pine.LNX.4.64.0811200125100.21820@blonde.site>

Hugh Dickins wrote:
> On Wed, 19 Nov 2008, Paul Menage wrote:
>> On Wed, Nov 19, 2008 at 5:11 PM, Hugh Dickins <hugh@veritas.com> wrote:
>>>  assign_new_owner:
>>>        BUG_ON(c == p);
>>>        get_task_struct(c);
>>> -       read_unlock(&tasklist_lock);
>>> -       down_write(&mm->mmap_sem);
>>>        /*
>>>         * The task_lock protects c->mm from changing.
>>>         * We always want mm->owner->mm == mm
>>>         */
>>>        task_lock(c);
>>> +       /*
>>> +        * Delay read_unlock() till we have the task_lock()
>>> +        * to ensure that c does not slip away underneath us
>>> +        */
>>> +       read_unlock(&tasklist_lock);
>> How can c slip away when we've done get_task_struct(c) earlier?
> 

"c" cannot slip away, but c->mm can change, but see below.

> I don't know, I did vaguely wonder the same myself: just putting
> this back to how it was before (including that comment),
> maybe Balbir can enlighten us.

Looking at the patch, we do handle a c->mm != mm case. The code seems to keep
the task on the global tasklist and protects task->mm, which might not be
necessary here. It would seem reasonable to allow the read_unlock() to occur
prior to task_lock().

-- 
	Balbir

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-11-20 16:46 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-20  1:10 [PATCH 0/7] mm: cleanups Hugh Dickins
2008-11-20  1:11 ` [PATCH 1/7] mm: remove cgroup_mm_owner_callbacks Hugh Dickins
2008-11-20  1:23   ` Paul Menage
2008-11-20  1:26     ` Hugh Dickins
2008-11-20 16:41       ` Balbir Singh [this message]
2008-11-20  1:14 ` [PATCH 2/7] mm: remove AOP_WRITEPAGE_ACTIVATE Hugh Dickins
2008-11-20  1:14   ` Hugh Dickins
2008-11-20  1:16 ` [PATCH 3/7] mm: remove GFP_HIGHUSER_PAGECACHE Hugh Dickins
2008-11-20 16:43   ` Mel Gorman
2008-11-20 18:58     ` Hugh Dickins
2008-11-21 10:46       ` Mel Gorman
2008-11-20  1:17 ` [PATCH 4/7] mm: add Set,ClearPageSwapCache stubs Hugh Dickins
2008-11-20 18:08   ` Christoph Lameter
2008-11-20  1:20 ` [PATCH 5/7] mm: replace some BUG_ONs by VM_BUG_ONs Hugh Dickins
2008-11-20 18:09   ` Christoph Lameter
2008-11-20  1:22 ` [PATCH 6/7] mm: add_active_or_unevictable into rmap Hugh Dickins
2008-11-20  2:08   ` Rik van Riel
2008-11-20 15:18     ` Lee Schermerhorn
2008-11-23 21:51   ` [PATCH 8/7] mm: further cleanup page_add_new_anon_rmap Hugh Dickins
2008-11-23 21:56     ` Rik van Riel
2008-11-23 22:18       ` Hugh Dickins
2008-11-23 22:41         ` Rik van Riel
2008-11-20  1:24 ` [PATCH 7/7] mm: make page_lock_anon_vma static Hugh Dickins
2008-11-21  8:29   ` KOSAKI Motohiro

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=49259354.2030604@linux.vnet.ibm.com \
    --to=balbir@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=hugh@veritas.com \
    --cc=linux-mm@kvack.org \
    --cc=menage@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.