mm/page_counter: use page_counter_read in page_counter_set_max
Subsystems (2)
PATCH 1/1 mm/page_counter: use page_counter_read in page_counter_set_max
use page_counter_read() in page_counter_set_max().
Signed-off-by Hui Su <[email protected]>
--- mm/page_counter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
mm/page_counter.c +2 -2
@@ -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;
Signature · 1 line
2.29.0
Quoted 18 lines
use
page_counter_read()inpage_counter_set_max().Signed-off-by Hui Su <[email protected]>--- mm/page_counter.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)mm/page_counter.c +1
-1@@ -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);
mm/page_counter.c int page_counter_set_max(struct page_counter *counter, unsigned long nr_pages) · line 196
Quoted 10 lines
mm/page_counter.c +1
-1if (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;
Reviewed-by Pankaj Gupta <[email protected]>