From: Mel Gorman <mgorman@suse.de>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm: hugetlbfs: Close race during teardown of hugetlbfs shared page tables
Date: Fri, 20 Jul 2012 14:43:44 +0100 [thread overview]
Message-ID: <20120720134344.GF9222@suse.de> (raw)
In-Reply-To: <ju8iqh$vvl$1@dough.gmane.org>
On Thu, Jul 19, 2012 at 09:08:34AM +0000, Cong Wang wrote:
> On Wed, 18 Jul 2012 at 10:43 GMT, Mel Gorman <mgorman@suse.de> wrote:
> > + if (!down_read_trylock(&svma->vm_mm->mmap_sem)) {
> > + mutex_unlock(&mapping->i_mmap_mutex);
> > + goto retry;
> > + }
> > +
> > + smmap_sem = &svma->vm_mm->mmap_sem;
> > + spage_table_lock = &svma->vm_mm->page_table_lock;
> > + spin_lock_nested(spage_table_lock, SINGLE_DEPTH_NESTING);
> >
> > saddr = page_table_shareable(svma, vma, addr, idx);
> > if (saddr) {
> > @@ -85,6 +108,10 @@ static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
> > break;
> > }
> > }
> > + up_read(smmap_sem);
> > + spin_unlock(spage_table_lock);
>
> Looks like we should do spin_unlock() before up_read(),
> in the reverse order of how they get accquired.
>
Will fix, thanks for pointing this out.
As an aside, I would prefer if you did not drop people from the CC list. I
would have missed this mail for a long time if it hadn't been pointed out
to me privately.
--
Mel Gorman
SUSE Labs
--
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>
WARNING: multiple messages have this Message-ID (diff)
From: Mel Gorman <mgorman@suse.de>
To: Cong Wang <xiyou.wangcong@gmail.com>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [RFC PATCH] mm: hugetlbfs: Close race during teardown of hugetlbfs shared page tables
Date: Fri, 20 Jul 2012 14:43:44 +0100 [thread overview]
Message-ID: <20120720134344.GF9222@suse.de> (raw)
In-Reply-To: <ju8iqh$vvl$1@dough.gmane.org>
On Thu, Jul 19, 2012 at 09:08:34AM +0000, Cong Wang wrote:
> On Wed, 18 Jul 2012 at 10:43 GMT, Mel Gorman <mgorman@suse.de> wrote:
> > + if (!down_read_trylock(&svma->vm_mm->mmap_sem)) {
> > + mutex_unlock(&mapping->i_mmap_mutex);
> > + goto retry;
> > + }
> > +
> > + smmap_sem = &svma->vm_mm->mmap_sem;
> > + spage_table_lock = &svma->vm_mm->page_table_lock;
> > + spin_lock_nested(spage_table_lock, SINGLE_DEPTH_NESTING);
> >
> > saddr = page_table_shareable(svma, vma, addr, idx);
> > if (saddr) {
> > @@ -85,6 +108,10 @@ static void huge_pmd_share(struct mm_struct *mm, unsigned long addr, pud_t *pud)
> > break;
> > }
> > }
> > + up_read(smmap_sem);
> > + spin_unlock(spage_table_lock);
>
> Looks like we should do spin_unlock() before up_read(),
> in the reverse order of how they get accquired.
>
Will fix, thanks for pointing this out.
As an aside, I would prefer if you did not drop people from the CC list. I
would have missed this mail for a long time if it hadn't been pointed out
to me privately.
--
Mel Gorman
SUSE Labs
next prev parent reply other threads:[~2012-07-20 13:43 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-18 10:43 [RFC PATCH] mm: hugetlbfs: Close race during teardown of hugetlbfs shared page tables Mel Gorman
2012-07-18 10:43 ` Mel Gorman
2012-07-19 9:08 ` Cong Wang
2012-07-20 13:43 ` Mel Gorman [this message]
2012-07-20 13:43 ` Mel Gorman
2012-07-19 12:38 ` Hugh Dickins
2012-07-19 12:38 ` Hugh Dickins
2012-07-19 14:16 ` Mel Gorman
2012-07-19 14:16 ` Mel Gorman
2012-07-19 14:42 ` Michal Hocko
2012-07-19 14:42 ` Michal Hocko
2012-07-19 14:49 ` Mel Gorman
2012-07-19 14:49 ` Mel Gorman
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=20120720134344.GF9222@suse.de \
--to=mgorman@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=xiyou.wangcong@gmail.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.