mm/gup: Use raw_seqcount_try_begin()

David pointed out that gup_fast() does exactly what the new
raw_seqcount_try_begin() does -- use it.

Suggested-by: David Hildenbrand <david@redhat.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: David Hildenbrand <david@redhat.com>
This commit is contained in:
Peter Zijlstra 2024-11-22 12:47:48 +01:00
parent 96450ead16
commit 7528585290

View File

@ -3351,8 +3351,7 @@ static unsigned long gup_fast(unsigned long start, unsigned long end,
return 0;
if (gup_flags & FOLL_PIN) {
seq = raw_read_seqcount(&current->mm->write_protect_seq);
if (seq & 1)
if (!raw_seqcount_try_begin(&current->mm->write_protect_seq, seq))
return 0;
}