diff options
author | Hui Su <sh_def@163.com> | 2020-12-14 19:06:58 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2020-12-15 12:13:40 -0800 |
commit | 13064781304eb544066b9da403c95d05c0ea3624 (patch) | |
tree | 714b9bd61444c8a61b7579b2a52c4a3693446a93 /mm/page_counter.c | |
parent | 9d9d341df4d519d96e7927941d91f5785c5cea07 (diff) | |
download | linux-stable-13064781304eb544066b9da403c95d05c0ea3624.tar.gz linux-stable-13064781304eb544066b9da403c95d05c0ea3624.tar.bz2 linux-stable-13064781304eb544066b9da403c95d05c0ea3624.zip |
mm/page_counter: use page_counter_read in page_counter_set_max
Use page_counter_read() in page_counter_set_max().
Link: https://lkml.kernel.org/r/20201113141048.GA178922@rlk
Signed-off-by: Hui Su <sh_def@163.com>
Reviewed-by: Pankaj Gupta <pankaj.gupta@cloud.ionos.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm/page_counter.c')
-rw-r--r-- | mm/page_counter.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/mm/page_counter.c b/mm/page_counter.c index b24a60b28bb0..c6860f51b6c6 100644 --- a/mm/page_counter.c +++ b/mm/page_counter.c @@ -183,14 +183,14 @@ int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages) * the limit, so if it sees the old limit, we see the * modified counter and retry. */ - usage = atomic_long_read(&counter->usage); + usage = page_counter_read(counter); if (usage > nr_pages) return -EBUSY; old = xchg(&counter->max, nr_pages); - if (atomic_long_read(&counter->usage) <= usage) + if (page_counter_read(counter) <= usage) return 0; counter->max = old; |