linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH-next] mm/mempolicy: use PAGE_ALIGN instead of open-coding it
@ 2022-09-13  1:55 Ze Zuo
  2022-09-13 13:02 ` Muchun Song
  0 siblings, 1 reply; 2+ messages in thread
From: Ze Zuo @ 2022-09-13  1:55 UTC (permalink / raw)
  To: akpm; +Cc: linux-mm, linux-kernel, wangkefeng.wang, ze zuo

From: ze zuo <zuoze1@huawei.com>

Replace the simple calculation with PAGE_ALIGN.

Signed-off-by: ze zuo <zuoze1@huawei.com>
---
 mm/mempolicy.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/mm/mempolicy.c b/mm/mempolicy.c
index 143e2eaaa6ec..a937eaec5b68 100644
--- a/mm/mempolicy.c
+++ b/mm/mempolicy.c
@@ -1270,7 +1270,7 @@ static long do_mbind(unsigned long start, unsigned long len,
 	if (mode == MPOL_DEFAULT)
 		flags &= ~MPOL_MF_STRICT;
 
-	len = (len + PAGE_SIZE - 1) & PAGE_MASK;
+	len = PAGE_ALIGN(len);
 	end = start + len;
 
 	if (end < start)
@@ -1507,7 +1507,7 @@ SYSCALL_DEFINE4(set_mempolicy_home_node, unsigned long, start, unsigned long, le
 	if (home_node >= MAX_NUMNODES || !node_online(home_node))
 		return -EINVAL;
 
-	len = (len + PAGE_SIZE - 1) & PAGE_MASK;
+	len = PAGE_ALIGN(len);
 	end = start + len;
 
 	if (end < start)
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH-next] mm/mempolicy: use PAGE_ALIGN instead of open-coding it
  2022-09-13  1:55 [PATCH-next] mm/mempolicy: use PAGE_ALIGN instead of open-coding it Ze Zuo
@ 2022-09-13 13:02 ` Muchun Song
  0 siblings, 0 replies; 2+ messages in thread
From: Muchun Song @ 2022-09-13 13:02 UTC (permalink / raw)
  To: Ze Zuo; +Cc: Andrew Morton, linux-mm, linux-kernel, wangkefeng.wang



> On Sep 13, 2022, at 09:55, Ze Zuo <zuoze1@huawei.com> wrote:
> 
> From: ze zuo <zuoze1@huawei.com>
> 
> Replace the simple calculation with PAGE_ALIGN.
> 
> Signed-off-by: ze zuo <zuoze1@huawei.com>

Reviewed-by: Muchun Song <songmuchun@bytedance.com>

Thanks.


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-09-13 13:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-13  1:55 [PATCH-next] mm/mempolicy: use PAGE_ALIGN instead of open-coding it Ze Zuo
2022-09-13 13:02 ` Muchun Song

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).