From patchwork Mon Dec 5 09:17:08 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 9460681 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 3C13C60236 for ; Mon, 5 Dec 2016 09:20:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2813524EE5 for ; Mon, 5 Dec 2016 09:20:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1C7DE26246; Mon, 5 Dec 2016 09:20:26 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6A37826242 for ; Mon, 5 Dec 2016 09:20:25 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.85_2 #1 (Red Hat Linux)) id 1cDpQ6-0001Wh-Hc; Mon, 05 Dec 2016 09:18:46 +0000 Received: from mail-db5eur01on0069.outbound.protection.outlook.com ([104.47.2.69] helo=EUR01-DB5-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1cDpPk-0001MO-HF for linux-arm-kernel@lists.infradead.org; Mon, 05 Dec 2016 09:18:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector1-arm-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=auvIU4QEedBJq+OOYmYFUjDZvD2IiT4TesiduynZReQ=; b=TlS/4zhV0KgaMGy9Alm/+rCkZyB0DEE0BvPJSYepCb7Ic2ib2GqeqQZREColiddupgKOxm2+s72Q0qzmE7peb64VaYbeKyj7g4P9hnYo86tYb/WCJBvm84B/cSWzcnbkSORZzxQpJFU7oOtbGsHhFtbH1xRUXAylMSvMT+EUPxc= Received: from HE1PR0801CA0029.eurprd08.prod.outlook.com (10.167.184.39) by DB6PR0801MB1845.eurprd08.prod.outlook.com (10.169.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9; Mon, 5 Dec 2016 09:18:01 +0000 Received: from DB3FFO11FD017.protection.gbl (2a01:111:f400:7e04::100) by HE1PR0801CA0029.outlook.office365.com (2603:10a6:3:6::39) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.761.9 via Frontend Transport; Mon, 5 Dec 2016 09:18:00 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; kvack.org; dkim=none (message not signed) header.d=none; kvack.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 217.140.96.140 as permitted sender) receiver=protection.outlook.com; client-ip=217.140.96.140; helo=nebula.arm.com; Received: from nebula.arm.com (217.140.96.140) by DB3FFO11FD017.mail.protection.outlook.com (10.47.217.48) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.734.4 via Frontend Transport; Mon, 5 Dec 2016 09:18:00 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1088; Count:13 Received: from sha-win-210.shanghai.arm.com (10.1.2.79) by mail.arm.com (10.1.105.66) with Microsoft SMTP Server id 14.3.294.0; Mon, 5 Dec 2016 09:17:53 +0000 From: Huang Shijie To: , Subject: [PATCH v3 1/4] mm: hugetlb: rename some allocation functions Date: Mon, 5 Dec 2016 17:17:08 +0800 Message-ID: <1480929431-22348-2-git-send-email-shijie.huang@arm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1480929431-22348-1-git-send-email-shijie.huang@arm.com> References: <1480929431-22348-1-git-send-email-shijie.huang@arm.com> MIME-Version: 1.0 X-IncomingHeaderCount: 13 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:217.140.96.140; IPV:CAL; SCL:-1; CTRY:GB; EFV:NLI; SFV:NSPM; SFS:(10009020)(6009001)(7916002)(2980300002)(438002)(189002)(199003)(39450400002)(106466001)(92566002)(77096006)(246002)(7846002)(38730400001)(39410400001)(26826002)(33646002)(356003)(39850400001)(86362001)(7416002)(189998001)(104016004)(5003940100001)(626004)(36756003)(5001770100001)(50226002)(4326007)(47776003)(76176999)(48376002)(5660300001)(50466002)(39840400001)(50986999)(2906002)(2950100002)(6666003)(8936002)(305945005)(8676002)(6636002); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0801MB1845; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD017; 1:Z13trdyQWsUr6Hxn4bvy9/fiuxYbDGuL2HmbiLmZmSTWfH/C2GlUBiEII3d12Bh6RNruz3PofkL+auMBze5jU8ZOVkK9JvdnQojeJsJTYWzcDb9r7aG7wmHjFxMvjj9jVST0ILQAAOI1q77nr0Qt6HdrYYFUoe+a2ml2H7qJLG2yiuwC1edKp6f8MSnM4epbLv7r4CnHHI+I8QsBdyTZ0IkJP+austkLzO1vcrwAVQBV3jmYxZ7uuXAPVg64OThrTlWBWsL2Qa67OzRPiib0ykmQNvTnAYFIUY7kzQLSUBvIgWKHSuH/lzKSbrFYAPG2yQkC4mG86dMS+Off7iACaMKdRQEZMam+N8Ig8UsZjp9mJTqaf912zhn8BD1e0nppHKVXUuPD9DPvJvWfIkUpB/qEKmgsS59VIADQEmjubdf6VT4aF1hKsCv3l2g9NBeBbKkoP2tHyAv+cyfkfcUx+Wo62IP7xB/Y9lPaddpNFwmRi3qvDJaLWNqvkUp8GMTNOC0aH5/ml7eNxRIsAlBo5nJeR9WNXnDE4jwaK8jL5X7aTNxERn7N6O6tw1EGNEosVJuoMbY6OsAZFQ0ZjXCJJaGQdbnxOCVVGgO1aZMLJM30J6CuivVNC0vlNqxYTkby8fNcpdIwA72XrtQyH5MhPaSPy8zfuTSKKUPs84z0/dA= X-MS-Office365-Filtering-Correlation-Id: 1aab37ed-4548-4641-633a-08d41cef9bf2 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:DB6PR0801MB1845; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1845; 3:UupmnJgLpuLS32c4jWgQhpQuR9NEftZ/6sxQoJjtHb0SrcOZHp3sS/xYoYeCJDX3gxmP3mHPukqmjXUf3kNxuR+34tk/iWv0qs1ggGRKv3B2ft27pTLHxohGy5rKEgf0fjBGhZoif5JDkRlH74eJJ93HCNQg1NeYXzXA1N1Zm5q31m/xdqZkHQYTfuzSWIk7bzcS/AU6WIOmGhyvc+Q1n1j7r6kDJ6270ahPOvJ8wIY4+d/y+5re6gUtjcihXPCPKNp/sVGTybV36yDykVR5BpPx1kR6Iht+544bmjz8b92z71/8MuTlRK+CvFLwlYA4Fh1N/s4zeDRp9QlErtrIVOpMWqW87L63Td7ixRPm6rVReGXDvJ3i7JPeD/gYCNEnGXQZqon25uPiJMfQohBrbQ== X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1845; 25:xqS19wprLo1HtZNBjZqW4PYgQrDXTMF6fHqdmIlOSUZL7Gaurq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MvVfsqpAEoq0g==; 20:vhy4oY4mRWDXv+UNp8FB91JW8KPRJ7unH1e4E2ifIpr6HnmtBAJDiejLbFRt7ce8bzEj8fwbn/T2yIItJOBBbJZ3iOsar2sQQM4Neitin5xFcy7hiSmr593o6GSBXk78J4p63nckXziZs10CAEgB2zVgsqf1hclgUNzXUMlUrgIu0A2x7wvmSyT2+3Wd97SSrmFnCKS1YVUItoI/U26ZRiYlCTkOWthFDPs3SnOc+TZXyjZvtuxB6/kR+yY9j8D2 NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(13023025)(13013025)(13024025)(13020025)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123562025)(20161123564025)(20161123560025)(6072148); SRVR:DB6PR0801MB1845; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0801MB1845; X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1845; 4:Dw2x8hKmw8HKtKDfHkfn79vFVrrwgSPL0OsoFekK3/XmBcow7sg09U5F9RD5QWxRbHaIXxtzsEnSoAG9f0ODCSvGKrlqL3TOmsCNwauwXVilqWvXPr0jyIkn/RDurs+yxYM6dWkbfe/12i3pLyOKlzN2IIdmGEqPVBLjtgCdaK0uyUFYo+ghDWRCg7m0UGRAXQ/Gbj3SGe6s3H4wqL/aWzfbYnPPtTy3Rk+phfgRm37lXXAZSy3Chsr2+XSsgOrJVomKBfSfSFpsWJWS9HniUOdg7hk0OVx+82+3Bxnxsezrmyn5JIG4x2FX8IMQltZBSh+gkeyP2rtt371ZcNRBbh2MIDT9qSTEqDDCdQJS1ss41LErnFqtfP9wFCxmcrqctaz9l3UKOZL53zwaIfCaRMJ7TzQXBU1Z6rWGQHbaJNoI35BW+2Q2N6jP8rBYTeVI2V6t1HDpk0A3lRh1ZYGIDRdkZczIMQwYkfpg7BC1paOd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90d/sxJv/rp1ZbQRlm7u9nMAeNF0LR4icG6X9wcV/M44LZd0Kom1iFJdzTw6bF/f1JyHhFjz3cEtXGwgGnbYYQQnneIDUoLTaUx3iHudBMbQ4K85d2cyEXh9ra9sBnyssu+PJzCUiV++WE5CIWCfRDNjDb2RxKUw=; 24:avf4cf+kzEM/tZgwOJaxaMahr5Ludcb4Fs9MNZK3RCUv7g4xyJhicBxb+QxC7o4shLhL3WbuUHvCZLyEWbMfJt6AsFSh7xCcvX+dyqmw0Pg= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; DB6PR0801MB1845; 7:2bAhz2mud9BigdBim2jFxFT0K2Wj0mnn7PwsJRFvkTk2x3TiUM3xpq5K/m8g7GtJ/7ZRRrPLaHtU0tM5YPtXSzl3C6/8IbkrwJA/7l81AD0UQlE+b0/r1jk2Z6Ru1YJYy7eilcOVS8Ddaa+0piODRKaVOCEFjzgQDGSN6Ex8W0Qp846kvq4YqSNdeXse3SVF0x+x+RbY6Cr4gDf0d+6dtmZnu9mo73d/9+4OUnIOvQ2chm+Ba8Lxqbrx5fafHnw70xn+YlwViWGyT/+ePsY5DSBsJOqdZeIDR4kKMMT/h45AbKYwRffZyTQJFjcDjJLV+2OwXO2GPWk39V3W0m+Vl88NsaXLysX3oTvre0n4pDrb1gq6F8vkWbnkL6mfrlyBVyPHEayLAQeyXcM3VNjiZpLHIJqRIPxTVEr9Odl3oYOT2TyAklXvPW3FvnZVNAvkP8MKZytqgkDx7XePH0veOQ== X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Dec 2016 09:18:00.2701 (UTC) X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[217.140.96.140]; Helo=[nebula.arm.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0801MB1845 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161205_011825_006955_B704A5C0 X-CRM114-Status: GOOD ( 14.11 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, kaly.xin@arm.com, mhocko@suse.com, kirill.shutemov@linux.intel.com, steve.capper@arm.com, will.deacon@arm.com, linux-mm@kvack.org, vbabka@suze.cz, aneesh.kumar@linux.vnet.ibm.com, Huang Shijie , n-horiguchi@ah.jp.nec.com, nd@arm.com, gerald.schaefer@de.ibm.com, mike.kravetz@oracle.com Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP After a future patch, the __alloc_buddy_huge_page() will not necessarily use the buddy allocator. So this patch removes the "buddy" from these functions: __alloc_buddy_huge_page -> __alloc_huge_page __alloc_buddy_huge_page_no_mpol -> __alloc_huge_page_no_mpol __alloc_buddy_huge_page_with_mpol -> __alloc_huge_page_with_mpol This patch also adds the description for alloc_gigantic_page(). This patch makes preparation for the later patch. Signed-off-by: Huang Shijie --- mm/hugetlb.c | 30 ++++++++++++++++++++---------- 1 file changed, 20 insertions(+), 10 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 5f228cd..5f4213d 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1089,6 +1089,12 @@ static bool zone_spans_last_pfn(const struct zone *zone, return zone_spans_pfn(zone, last_pfn); } +/* + * Allocate a gigantic page from @nid node. + * + * Scan the zones of @nid node, and try to allocate a number of contiguous + * pages (1 << order). + */ static struct page *alloc_gigantic_page(int nid, unsigned int order) { unsigned long nr_pages = 1 << order; @@ -1157,6 +1163,10 @@ static int alloc_fresh_gigantic_page(struct hstate *h, static inline bool gigantic_page_supported(void) { return true; } #else +static inline struct page *alloc_gigantic_page(int nid, unsigned int order) +{ + return NULL; +} static inline bool gigantic_page_supported(void) { return false; } static inline void free_gigantic_page(struct page *page, unsigned int order) { } static inline void destroy_compound_gigantic_page(struct page *page, @@ -1568,7 +1578,7 @@ static struct page *__hugetlb_alloc_buddy_huge_page(struct hstate *h, * For (2), we ignore 'vma' and 'addr' and use 'nid' exclusively. This * implies that memory policies will not be taken in to account. */ -static struct page *__alloc_buddy_huge_page(struct hstate *h, +static struct page *__alloc_huge_page(struct hstate *h, struct vm_area_struct *vma, unsigned long addr, int nid) { struct page *page; @@ -1649,21 +1659,21 @@ static struct page *__alloc_buddy_huge_page(struct hstate *h, * anywhere. */ static -struct page *__alloc_buddy_huge_page_no_mpol(struct hstate *h, int nid) +struct page *__alloc_huge_page_no_mpol(struct hstate *h, int nid) { unsigned long addr = -1; - return __alloc_buddy_huge_page(h, NULL, addr, nid); + return __alloc_huge_page(h, NULL, addr, nid); } /* * Use the VMA's mpolicy to allocate a huge page from the buddy. */ static -struct page *__alloc_buddy_huge_page_with_mpol(struct hstate *h, +struct page *__alloc_huge_page_with_mpol(struct hstate *h, struct vm_area_struct *vma, unsigned long addr) { - return __alloc_buddy_huge_page(h, vma, addr, NUMA_NO_NODE); + return __alloc_huge_page(h, vma, addr, NUMA_NO_NODE); } /* @@ -1681,7 +1691,7 @@ struct page *alloc_huge_page_node(struct hstate *h, int nid) spin_unlock(&hugetlb_lock); if (!page) - page = __alloc_buddy_huge_page_no_mpol(h, nid); + page = __alloc_huge_page_no_mpol(h, nid); return page; } @@ -1711,7 +1721,7 @@ static int gather_surplus_pages(struct hstate *h, int delta) retry: spin_unlock(&hugetlb_lock); for (i = 0; i < needed; i++) { - page = __alloc_buddy_huge_page_no_mpol(h, NUMA_NO_NODE); + page = __alloc_huge_page_no_mpol(h, NUMA_NO_NODE); if (!page) { alloc_ok = false; break; @@ -2027,7 +2037,7 @@ struct page *alloc_huge_page(struct vm_area_struct *vma, page = dequeue_huge_page_vma(h, vma, addr, avoid_reserve, gbl_chg); if (!page) { spin_unlock(&hugetlb_lock); - page = __alloc_buddy_huge_page_with_mpol(h, vma, addr); + page = __alloc_huge_page_with_mpol(h, vma, addr); if (!page) goto out_uncharge_cgroup; if (!avoid_reserve && vma_has_reserves(vma, gbl_chg)) { @@ -2285,7 +2295,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, * First take pages out of surplus state. Then make up the * remaining difference by allocating fresh huge pages. * - * We might race with __alloc_buddy_huge_page() here and be unable + * We might race with __alloc_huge_page() here and be unable * to convert a surplus huge page to a normal huge page. That is * not critical, though, it just means the overall size of the * pool might be one hugepage larger than it needs to be, but @@ -2331,7 +2341,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, * By placing pages into the surplus state independent of the * overcommit value, we are allowing the surplus pool size to * exceed overcommit. There are few sane options here. Since - * __alloc_buddy_huge_page() is checking the global counter, + * __alloc_huge_page() is checking the global counter, * though, we'll note that we're not allowed to exceed surplus * and won't grow the pool anywhere else. Not until one of the * sysctls are changed, or the surplus pages go out of use.