lkml.org 
[lkml]   [2019]   [Dec]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v16 13/25] mm: pagewalk: Don't lock PTEs for walk_page_range_novma()
Date


> On Dec 11, 2019, at 10:54 AM, Steven Price <Steven.Price@arm.com> wrote:
>
> I believe this is a false positive (although the trace here is useless).
> This patch adds a conditional lock/unlock:
>
> pte = walk->no_vma ? pte_offset_map(pmd, addr) :
> pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
> ...
> if (!walk->no_vma)
> spin_unlock(ptl);
> pte_unmap(pte);
>
> I'm not sure how to match sparse happy about that. Is the only option to
> have two versions of the walk_pte_range() function? One which takes the
> lock and one which doesn't.

Or just ignore the sparse false positive without complicating the code further.
\
 
 \ /
  Last update: 2019-12-11 18:20    [W:0.054 / U:4.388 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site