diff options
author | Peter Zijlstra <peterz@infradead.org> | 2024-11-22 14:47:48 +0300 |
---|---|---|
committer | Peter Zijlstra <peterz@infradead.org> | 2024-12-02 14:01:37 +0300 |
commit | 7528585290a1a1d4e0fb4b72261eb2d8c85de2d7 (patch) | |
tree | 8d640bc221ea48fac281b5a838c5160ff3f9eb89 | |
parent | 96450ead16527cbef559b5bd046182e731228f95 (diff) | |
download | linux-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.c | 3 |
1 files changed, 1 insertions, 2 deletions
@@ -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; } |