Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_RED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9FC60C433B4 for ; Sat, 8 May 2021 22:46:30 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8444C61426 for ; Sat, 8 May 2021 22:46:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229648AbhEHWrb (ORCPT ); Sat, 8 May 2021 18:47:31 -0400 Received: from mail.kernel.org ([198.145.29.99]:58526 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229602AbhEHWra (ORCPT ); Sat, 8 May 2021 18:47:30 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 85C50613C5; Sat, 8 May 2021 22:46:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1620513988; bh=177QMBR8s7K1nEaAo63AuncB0R3ZN7MpPXvt7zcNBtM=; h=Date:From:To:Subject:From; b=v48pal8I1Ih8MqAxOhx2sqMgcIp/LT53dbOlkTUWu3wfZEKnh+o7JmtItzNlA0487 F22BNQ3MaL2dqaJoxQm1ovwAF3E/bRABjcF9clrrAIvhavqyBdQsosgvUaV+0i/Cwr mtvyU4zn1n5dJw+Hb0Xt3R1I/O/ojOFa8aRaVhR0= Date: Sat, 08 May 2021 15:46:28 -0700 From: akpm@linux-foundation.org To: linmiaohe@huawei.com, mike.kravetz@oracle.com, mm-commits@vger.kernel.org Subject: [merged] mm-hugetlb-use-some-helper-functions-to-cleanup-code.patch removed from -mm tree Message-ID: <20210508224628.k9TUk02B8%akpm@linux-foundation.org> User-Agent: s-nail v14.8.16 Precedence: bulk Reply-To: linux-kernel@vger.kernel.org List-ID: X-Mailing-List: mm-commits@vger.kernel.org The patch titled Subject: mm/hugetlb: use some helper functions to cleanup code has been removed from the -mm tree. Its filename was mm-hugetlb-use-some-helper-functions-to-cleanup-code.patch This patch was dropped because it was merged into mainline or a subsystem tree ------------------------------------------------------ From: Miaohe Lin Subject: mm/hugetlb: use some helper functions to cleanup code Patch series "Some cleanups for hugetlb". This series contains cleanups to remove unnecessary VM_BUG_ON_PAGE, use helper function and so on. I also collect some previous patches into this series in case they are forgotten. This patch (of 5): We could use pages_per_huge_page to get the number of pages per hugepage, use get_hstate_idx to calculate hstate index, and use hstate_is_gigantic to check if a hstate is gigantic to make code more succinct. Link: https://lkml.kernel.org/r/20210308112809.26107-1-linmiaohe@huawei.com Link: https://lkml.kernel.org/r/20210308112809.26107-2-linmiaohe@huawei.com Signed-off-by: Miaohe Lin Reviewed-by: Mike Kravetz Signed-off-by: Andrew Morton --- fs/hugetlbfs/inode.c | 2 +- mm/hugetlb.c | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) --- a/fs/hugetlbfs/inode.c~mm-hugetlb-use-some-helper-functions-to-cleanup-code +++ a/fs/hugetlbfs/inode.c @@ -1435,7 +1435,7 @@ static int get_hstate_idx(int page_size_ if (!h) return -1; - return h - hstates; + return hstate_index(h); } /* --- a/mm/hugetlb.c~mm-hugetlb-use-some-helper-functions-to-cleanup-code +++ a/mm/hugetlb.c @@ -1273,7 +1273,7 @@ static void free_gigantic_page(struct pa static struct page *alloc_gigantic_page(struct hstate *h, gfp_t gfp_mask, int nid, nodemask_t *nodemask) { - unsigned long nr_pages = 1UL << huge_page_order(h); + unsigned long nr_pages = pages_per_huge_page(h); if (nid == NUMA_NO_NODE) nid = numa_mem_id(); @@ -3267,10 +3267,10 @@ static int __init hugepages_setup(char * /* * Global state is always initialized later in hugetlb_init. - * But we need to allocate >= MAX_ORDER hstates here early to still + * But we need to allocate gigantic hstates here early to still * use the bootmem allocator. */ - if (hugetlb_max_hstate && parsed_hstate->order >= MAX_ORDER) + if (hugetlb_max_hstate && hstate_is_gigantic(parsed_hstate)) hugetlb_hstate_alloc_pages(parsed_hstate); last_mhp = mhp; _ Patches currently in -mm which might be from linmiaohe@huawei.com are