From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 65FFFC54EE9 for ; Tue, 13 Sep 2022 23:33:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229569AbiIMXdI (ORCPT ); Tue, 13 Sep 2022 19:33:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50746 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229521AbiIMXdI (ORCPT ); Tue, 13 Sep 2022 19:33:08 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5065171724 for ; Tue, 13 Sep 2022 16:33:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 1A376B8117D for ; Tue, 13 Sep 2022 23:33:06 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id ACD24C433C1; Tue, 13 Sep 2022 23:33:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1663111984; bh=Jr8wXZOOA2rLZgAlELf7tcMFWmp1vlo1zkYIqdLO1/Y=; h=Date:To:From:Subject:From; b=HHx7JQnJ4B/cu7dd5akazMrZIuEw0qmY4nMHTKkgDi810W516wzpMjVZZV6MmJXXv 9kt2GjSzvMZSTN2p7hjQJ5DfvGmRz+FCg/SJjK2Gy4cWt29ViUG+SY/3Brw/CNPmot dQ5mgUFUoFSetDs/+nBqFVVsau5MnKJriZQs7WlU= Date: Tue, 13 Sep 2022 16:33:03 -0700 To: mm-commits@vger.kernel.org, songmuchun@bytedance.com, zuoze1@huawei.com, akpm@linux-foundation.org From: Andrew Morton Subject: + mm-mempolicy-use-page_align-instead-of-open-coding-it.patch added to mm-unstable branch Message-Id: <20220913233304.ACD24C433C1@smtp.kernel.org> Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm/mempolicy: use PAGE_ALIGN instead of open-coding it has been added to the -mm mm-unstable branch. Its filename is mm-mempolicy-use-page_align-instead-of-open-coding-it.patch This patch will shortly appear at https://git.kernel.org/pub/scm/linux/kernel/git/akpm/25-new.git/tree/patches/mm-mempolicy-use-page_align-instead-of-open-coding-it.patch This patch will later appear in the mm-unstable branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/process/submit-checklist.rst when testing your code *** The -mm tree is included into linux-next via the mm-everything branch at git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm and is updated there every 2-3 working days ------------------------------------------------------ From: ze zuo Subject: mm/mempolicy: use PAGE_ALIGN instead of open-coding it Date: Tue, 13 Sep 2022 01:55:05 +0000 Replace the simple calculation with PAGE_ALIGN. Link: https://lkml.kernel.org/r/20220913015505.1998958-1-zuoze1@huawei.com Signed-off-by: ze zuo Reviewed-by: Muchun Song Signed-off-by: Andrew Morton --- mm/mempolicy.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) --- a/mm/mempolicy.c~mm-mempolicy-use-page_align-instead-of-open-coding-it +++ a/mm/mempolicy.c @@ -1270,7 +1270,7 @@ static long do_mbind(unsigned long start 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, 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) _ Patches currently in -mm which might be from zuoze1@huawei.com are mm-mempolicy-use-page_align-instead-of-open-coding-it.patch