summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Zijlstra <peterz@infradead.org>2024-11-22 14:47:48 +0300
committerPeter Zijlstra <peterz@infradead.org>2024-12-02 14:01:37 +0300
commit7528585290a1a1d4e0fb4b72261eb2d8c85de2d7 (patch)
tree8d640bc221ea48fac281b5a838c5160ff3f9eb89
parent96450ead16527cbef559b5bd046182e731228f95 (diff)
downloadlinux-7528585290a1a1d4e0fb4b72261eb2d8c85de2d7.tar.xz
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>
-rw-r--r--mm/gup.c3
1 files changed, 1 insertions, 2 deletions
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(&current->mm->write_protect_seq);
- if (seq & 1)
+ if (!raw_seqcount_try_begin(&current->mm->write_protect_seq, seq))
return 0;
}