Thread (37 messages) 37 messages, 6 authors, 2019-12-12

Re: [PATCH v16 13/25] mm: pagewalk: Don't lock PTEs for walk_page_range_novma()

From: Luc Van Oostenryck <hidden>
Date: 2019-12-11 17:12:58
Also in: linux-mm, lkml

On Wed, Dec 11, 2019 at 03:54:06PM +0000, Steven Price wrote:
On 10/12/2019 11:23, kbuild test robot wrote:
quoted
quoted
quoted
include/linux/spinlock.h:378:9: sparse: sparse: context imbalance in 'walk_pte_range' - unexpected unlock
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.
Yes.

-- Luc

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help