lkml.org 
[lkml]   [2022]   [Apr]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [RFC PATCH v2 0/6] hugetlb: Change huge pmd sharing synchronization again
From
On 4/20/22 15:37, Mike Kravetz wrote:
>
> Patch 5 in this series makes basic changes to page table locking for
> hugetlb mappings. Currently code uses (split) pmd locks for hugetlb
> mappings if page size is PMD_SIZE. A pointer to the pmd is required
> to find the page struct containing the lock. However, with pmd sharing
> the pmd pointer is not stable until we hold the pmd lock. To solve
> this chicken/egg problem, we use the page_table_lock in mm_struct if
> the pmd pointer is associated with a mapping where pmd sharing is
> possible. A study of the performance implications of this change still
> needs to be performed.

Sorry, this approach is totally wrong!!!

If sharing pmds, we MUST use the pmd specific lock as that is common
between processes. If we use the process specific lock in mm_struct
we are not synchronizing pmd updates between processes.

I am going to rethink the idea of a vma (process) specific synchronization
mechanism for pmd sharing. I abandoned this early because of some lock
ordering issues, but think there may already exist code to handle situations
where we run into trouble with lock order.
--
Mike Kravetz

\
 
 \ /
  Last update: 2022-04-22 18:39    [W:0.070 / U:1.848 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site