lkml.org 
[lkml]   [2012]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH 2/6] thp: optimize away unnecessary page table locking
From
On Fri, Jan 13, 2012 at 11:14 PM, Naoya Horiguchi
<n-horiguchi@ah.jp.nec.com> wrote:
> Hi Hillf,
>
> (1/13/2012 7:04), Hillf Danton wrote:
> [...]
>>> +/*
>>> + * Returns 1 if a given pmd is mapping a thp and stable (not under splitting.)
>>> + * Returns 0 otherwise. Note that if it returns 1, this routine returns without
>>> + * unlocking page table locks. So callers must unlock them.
>>> + */
>>> +int pmd_trans_huge_stable(pmd_t *pmd, struct vm_area_struct *vma)
>>> +{
>>> +       VM_BUG_ON(!rwsem_is_locked(&vma->vm_mm->mmap_sem));
>>> +
>>> +       if (!pmd_trans_huge(*pmd))
>>> +               return 0;
>>> +
>>> +       spin_lock(&vma->vm_mm->page_table_lock);
>>> +       if (likely(pmd_trans_huge(*pmd))) {
>>> +               if (pmd_trans_splitting(*pmd)) {
>>> +                       spin_unlock(&vma->vm_mm->page_table_lock);
>>> +                       wait_split_huge_page(vma->anon_vma, pmd);
>>> +                       return 0;
>>> +               } else {
>>
>>                             spin_unlock(&vma->vm_mm->page_table_lock);     yes?
>
> No. Unlocking is supposed to be done by the caller as commented.
>
Thanks for correcting /Hillf
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2012-01-14 04:27    [W:0.050 / U:1.964 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site