From: Peter Zijlstra Date: Fri, 22 Nov 2024 11:47:48 +0000 (+0100) Subject: mm/gup: Use raw_seqcount_try_begin() X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=7528585290a1a1d4e0fb4b72261eb2d8c85de2d7;p=users%2Fjedix%2Flinux-maple.git 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 Signed-off-by: Peter Zijlstra (Intel) Reviewed-by: David Hildenbrand --- diff --git a/mm/gup.c b/mm/gup.c index 746070a1d8bf..81ffbd8fec9c 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -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(¤t->mm->write_protect_seq); - if (seq & 1) + if (!raw_seqcount_try_begin(¤t->mm->write_protect_seq, seq)) return 0; }