linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Peng Zhang <zhangpeng362@huawei.com>
To: <linux-mm@kvack.org>
Cc: <akpm@linux-foundation.org>, <wangkefeng.wang@huawei.com>,
	<sunnanyong@huawei.com>, ZhangPeng <zhangpeng362@huawei.com>
Subject: [PATCH 6/7] mm/mmap.c: use helper macro K()
Date: Fri, 4 Aug 2023 09:25:58 +0800	[thread overview]
Message-ID: <20230804012559.2617515-7-zhangpeng362@huawei.com> (raw)
In-Reply-To: <20230804012559.2617515-1-zhangpeng362@huawei.com>

From: ZhangPeng <zhangpeng362@huawei.com>

Use helper macro K() to improve code readability. No functional
modification involved.

Signed-off-by: ZhangPeng <zhangpeng362@huawei.com>
---
 mm/mmap.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/mm/mmap.c b/mm/mmap.c
index bc91d91261ab..35b6bc9c7c95 100644
--- a/mm/mmap.c
+++ b/mm/mmap.c
@@ -3785,7 +3785,7 @@ static int init_user_reserve(void)
 {
 	unsigned long free_kbytes;
 
-	free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
+	free_kbytes = K(global_zone_page_state(NR_FREE_PAGES));
 
 	sysctl_user_reserve_kbytes = min(free_kbytes / 32, 1UL << 17);
 	return 0;
@@ -3806,7 +3806,7 @@ static int init_admin_reserve(void)
 {
 	unsigned long free_kbytes;
 
-	free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
+	free_kbytes = K(global_zone_page_state(NR_FREE_PAGES));
 
 	sysctl_admin_reserve_kbytes = min(free_kbytes / 32, 1UL << 13);
 	return 0;
@@ -3850,7 +3850,7 @@ static int reserve_mem_notifier(struct notifier_block *nb,
 
 		break;
 	case MEM_OFFLINE:
-		free_kbytes = global_zone_page_state(NR_FREE_PAGES) << (PAGE_SHIFT - 10);
+		free_kbytes = K(global_zone_page_state(NR_FREE_PAGES));
 
 		if (sysctl_user_reserve_kbytes > free_kbytes) {
 			init_user_reserve();
-- 
2.25.1



  parent reply	other threads:[~2023-08-04  1:26 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-04  1:25 [PATCH 0/7] cleanup with " Peng Zhang
2023-08-04  1:25 ` [PATCH 1/7] mm: remove redundant K() macro definition Peng Zhang
2023-08-07  8:31   ` Kefeng Wang
2023-08-07 15:20     ` David Hildenbrand
2023-08-08 10:44     ` zhangpeng (AS)
2023-08-04  1:25 ` [PATCH 2/7] mm/swapfile.c: use helper macro K() Peng Zhang
2023-08-07 15:18   ` David Hildenbrand
2023-08-04  1:25 ` [PATCH 3/7] mm/swap_state.c: " Peng Zhang
2023-08-07 15:19   ` David Hildenbrand
2023-08-04  1:25 ` [PATCH 4/7] mm/shmem.c: " Peng Zhang
2023-08-07 15:19   ` David Hildenbrand
2023-08-04  1:25 ` [PATCH 5/7] mm/nommu.c: " Peng Zhang
2023-08-07 15:19   ` David Hildenbrand
2023-08-04  1:25 ` Peng Zhang [this message]
2023-08-07 15:19   ` [PATCH 6/7] mm/mmap.c: " David Hildenbrand
2023-08-04  1:25 ` [PATCH 7/7] mm/hugetlb.c: " Peng Zhang
2023-08-07 15:20   ` David Hildenbrand
2023-08-04  3:39 ` [PATCH 0/7] cleanup with " Matthew Wilcox

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20230804012559.2617515-7-zhangpeng362@huawei.com \
    --to=zhangpeng362@huawei.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=sunnanyong@huawei.com \
    --cc=wangkefeng.wang@huawei.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox