lkml.org 
[lkml]   [2013]   [Dec]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -mm 7/7] mm: thp: introduce compound_head_put_tail(), change get_futex_key() to use it
On Wed, Dec 18, 2013 at 08:20:08PM +0100, Oleg Nesterov wrote:
> +struct page *compound_head_put_tail(struct page *page)
> +{
> + struct page *page_head;
> + unsigned long flags;
> +
> + if (!PageTail(page))
> + return page;
> +
> + page_head = compound_trans_head(page);
> +
> + if (!__compound_tail_refcounted(page_head)) {

This barrier is missing a comment describing the ordering and the
pairing.

> + smp_rmb();
> + if (likely(PageTail(page)))
> + return page_head;
> + else
> + return page;
> + }
> +
> + if (likely(get_lock_thp_head(page_head, page, &flags))) {
> + if (put_page_testzero(page_head))
> + VM_BUG_ON(1);
> + atomic_dec(&page->_mapcount);
> + compound_unlock_irqrestore(page_head, flags);
> +
> + return page_head;
> + }
> +
> + return page;
> +}


\
 
 \ /
  Last update: 2013-12-18 21:01    [W:0.157 / U:3.232 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site