From patchwork Mon Nov 14 07:07:39 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 9426675 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 F08E360484 for ; Mon, 14 Nov 2016 07:13:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E1DE3288FA for ; Mon, 14 Nov 2016 07:13:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D40B92890F; Mon, 14 Nov 2016 07:13:49 +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 444EC288FA for ; Mon, 14 Nov 2016 07:13:49 +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 1c6BQq-0004HT-T9; Mon, 14 Nov 2016 07:11:56 +0000 Received: from mail-ve1eur01on0043.outbound.protection.outlook.com ([104.47.1.43] helo=EUR01-VE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6BOX-00012Z-KB for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 07:09:52 +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=KHMjsLn58gAhBWHLK6rCtJ9+zAlps3SN2mNVXC1Rv7c=; b=HRqHpjhGCXsazvAws4dtU2NieVvebYf5/tc+zJ6JfpdrExxbT3wpJ4cCbo8+4LH17ov325UQja2aZ1iSkR1FDixVdEJplXgtI6Qj24nW/44AbM6v1pvSSYOBrWjq+6GN+auBdP56IeVFCXABx74rPsFNPi3rET1qxAHqpNOPDqQ= Received: from DB6PR0802CA0042.eurprd08.prod.outlook.com (10.172.252.156) by AM2PR08MB0563.eurprd08.prod.outlook.com (10.163.149.149) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6; Mon, 14 Nov 2016 07:09:09 +0000 Received: from DB3FFO11FD015.protection.gbl (2a01:111:f400:7e04::145) by DB6PR0802CA0042.outlook.office365.com (2603:10a6:4:a3::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10 via Frontend Transport; Mon, 14 Nov 2016 07:09:09 +0000 Authentication-Results: spf=pass (sender IP is 217.140.96.140) smtp.mailfrom=arm.com; oracle.com; dkim=none (message not signed) header.d=none;oracle.com; 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 DB3FFO11FD015.mail.protection.outlook.com (10.47.216.189) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.721.5 via Frontend Transport; Mon, 14 Nov 2016 07:09:08 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1067; 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, 14 Nov 2016 07:08:54 +0000 From: Huang Shijie To: , Subject: [PATCH v2 6/6] mm: hugetlb: support gigantic surplus pages Date: Mon, 14 Nov 2016 15:07:39 +0800 Message-ID: <1479107259-2011-7-git-send-email-shijie.huang@arm.com> X-Mailer: git-send-email 2.5.5 In-Reply-To: <1479107259-2011-1-git-send-email-shijie.huang@arm.com> References: <1479107259-2011-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)(336003)(199003)(189002)(5003940100001)(86362001)(305945005)(586003)(626004)(356003)(7846002)(5001770100001)(5660300001)(50986999)(106466001)(76176999)(189998001)(26826002)(92566002)(33646002)(8676002)(6666003)(2950100002)(6636002)(246002)(104016004)(50466002)(87936001)(8936002)(50226002)(36756003)(48376002)(4326007)(47776003)(77096005)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM2PR08MB0563; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD015; 1:9W5qR7vVmKSjLA+4chGD5ZWG2KJ0qJ1YyKm47ETY+TjfAiFq3Lc5uFc93YVMUR8g55cX0Uk/YugeO+Mx5rCxNQ2c0L+llRiyiyFe77vTlihkZTaeULFJzTQnQr03Ada7vegi8E20UV//Dt5yuJsUT0D+icdlMlX1+qRegnCiZb93vt0S3k4M8d1lk4dcEe2T+pB3+Qay2SHJ0fqaGte9MyzC4/vvUEJlHNLA/A028LX6j7NGGkn4PQfjvHeMJ+Rnx5QbQ03nfrYt3f6qZjPq0hDRP0Azr2b7BQmW300AHVpbC2hiEmR0TqyEVU7gTPNNto6/SOcj49PVL37EGhEZ1aijzox6mzRu8Bysj2Y7wp3n48hviAuafEWZjNKv0u2jPDT3Bx0pwa8IDrGXN/O7gzclNVvm8LquVrfVgJ7qzM+k+LwUv7g4W5FxwWAL23OhbgrxWkP7kLxlGbCDJ6NiJd/Hf3t784HMGXYJYgc1GKXsgzphyxjkUo/Y5aLZjzpRTLrjoLA9iFpEnRdHdYEDFB1sF1jYTKknl13HOCMavQnXuILikqojt1NR+HHGnEOmmJwnR+CDfc8HxejxJuEs0Sl83Nfj3cYuzX71AC1s0s8MWL8OCWq6Ne4tP3YTt0tFPYeV8HUkSwMOpAsOCdh+1I2+/DTySUJNDizcCvDbcbY= X-Microsoft-Exchange-Diagnostics: 1; AM2PR08MB0563; 2:T0rU1ZnnLqVzU09YvHh/D2AwGri0SLpuZslm3TLHf07nrTuMts+qiZWENZlpQCBDOQashHtc+aSxjYBFWGQmuzdFS5ir68kHr6FmPoJcG7KntjZP5lbFkku5yKkEen8+Ya22NTkPisluw+TPRG9Oh5g1Bg627n5kGqcQxH5sKfs=; 3:GA4uu1pOCKuQ+55tsIX3gUcbZ1PKKDVsi4BfTSAqUGiEH7rpCaXpvTUQ3MD0xv3gn6dQsKoU4wOS+XXq4TqQwovVMaoYGx6xlBbOjuFJs3YzsIBV160LOzr5PG+qpnZuUJd8RrV15cXr9EH+6vbq7u2rjURpLwOsTtlc6/CKpkfMl1AsNB+ptczW9ZE+HXFXOPN2y3ljWFwoh66e7rolwP8r0tuwHhGoSIJMpPWmwWGJ44GT7a0V1Wx82ZZTQ02zmoEMMw5zdJ6RPAlHGX1FZrlcybQaqzqx2+jzU1qhPBs= X-MS-Office365-Filtering-Correlation-Id: 23ef0a3b-5c8b-4add-bb13-08d40c5d20f4 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:AM2PR08MB0563; X-Microsoft-Exchange-Diagnostics: 1; AM2PR08MB0563;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w3; 20:jv9gFYqKjAXhvX9b8C6gKuSuJcLk3m5iVekNFRp/tAm6Ysi/4kyYeuNgxEPwFF1Hx4ha037+yblTtuIeJSWlssTlMMvwlc4x9Ay5LCUz26x1DKj5jB35WCsShufu5G4e9lk+rzGPtwOv2COaGeFmBCJ4AmW5Q5jOLjCaaVmy764aGZAm7OrJ1enapoXYnnVm5yxaDNX4FuS65WMbeHfnxxLniHzIVEQ0v0EDx266tNSajc25MH5B4hctbcM/g0EB NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6060322)(601004)(2401047)(13024025)(13020025)(13023025)(13013025)(8121501046)(5005006)(10201501046)(3002001)(6055026)(6061317); SRVR:AM2PR08MB0563; BCL:0; PCL:0; RULEID:; SRVR:AM2PR08MB0563; X-Microsoft-Exchange-Diagnostics: 1; AM2PR08MB0563; 4:8LmpjSd93hzr39sh4fwc8br7sqj3PEj0/kzqegEfd6zMe4t3UvtoFTvLbJ/CF4XEtyEBEU1oiCmiEb4DRrJ/sPqL2kL1gHwv6qQ5d1m53gVoz/k5CPB+HC+M6Gl287gYzVnCr/apAO5SsOmgseOPDqLSKPq9xEYtlsTKMIQFMRmgF4SlvoJmFXg+CLWpqBOSqwxaPqO5O6rHMiMGjEWrIWyEMJv7+NMOpKVSkHzQWhlj5aqkkG714tAOy/3Yfwe9WI7ct54V4DHOdXsaQBaIVeFsPFb/x4uSJQaQd6aCpYxJiNZB6Pv/kV3YtapPnP/QDMCqP9b5Me/7quufTx3Zfh/yiU8OBxud+T/uo3ZNgqT+EYGODSBJKo95Tl02liKiQicWPnGZa4dukK+EzUXc91lzGtldaVnSJlZF9ixFJ5m4g6rA71UMpZTB8F2arcPc0VcI2bq8dIrbwcyeRs/xGhxPeb5Ms+l6VIh40te6IQ+xZBML7RlpLHQFF3W+WPmkUrhUX/k09vDklYFmXmwRXcjDyIj+5s5GYel95pWfcwhIXzd82gswqJG92VwGUkX9 X-Forefront-PRVS: 0126A32F74 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM2PR08MB0563; 23:6863fNcL5VbrGoUrpDp6BPQ2z5m0xpGDvDCMlXVed?= =?us-ascii?Q?ySo9VNUBndDE14gPrEGgVQ+HXueK04fGyD7KWyiuW2w8JG7F0lfErCj3wDq5?= =?us-ascii?Q?6Kl7zr5NcYGiQD6E/MwGA2dU/IqLClj9TFx/FHU5NziuPPtaS2tQomuXtTqA?= =?us-ascii?Q?VhhI8q6Xzs7paLlLsi5ncCeGtqPwVSs9cEBPhYee9kaV71IsxykTx9PZ+qd/?= =?us-ascii?Q?rfn7foHfZwAAkRbn6aDVXwL19R5pOmW18Sp/qPIqTx+QWVd6RHluXm7thPHw?= =?us-ascii?Q?aCKsdd9oVkUukoWFLRvItI3nuarQmzr30tSjFVTgbstYICjzm5Kr1p/IuVvf?= =?us-ascii?Q?Dit8jWqee504ZdSlqcUj70bNoGDG5n+hmQkHwTEiFyqDsW9g6fpZ06IjYD/D?= =?us-ascii?Q?ki5u+0Y4h6XNQusTOa+wVrqTJ+ULUI7J4sarNl9ZZadVpJKb+VtjzlNCXA0X?= =?us-ascii?Q?QGWtMqzOog4IVkvtwl35wEBf418QHrfAR1Nd2E0zNEdVQVhApxG2vE6KFDC1?= =?us-ascii?Q?WUut+MXSSvIty3Li7aXs3QaIDjKP+YEbWt5D5XyUNpyfcroMtOj8w1z+V4PQ?= =?us-ascii?Q?9XUYz1XD5lnx5RrF4+MsFdlfs2GWcs0j4BdFKWAjBdlptAEyZUEq9f2lQyKA?= =?us-ascii?Q?ranVSpuzL6IMXa5JKlYvxpruD2W+jbwi+8f86hrt26Zk4v+hnno4lIqeUApw?= =?us-ascii?Q?vt08n1PMtshLRBMI02Estx9/6BBW3yeVQZxPOLhis8k0FkrQBLdyt9XFmhlb?= =?us-ascii?Q?W+xCdt4BgNxVFQ/WvG2nUKYeB3pbLgYtgCcVrK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PF4Pd2c1T7a5gUfomaRE6Ue2ky2MdvE9Y0MutZDDmEQYQwpyBDiJyXN7D/WUUUXk0FQft14w2+Uab/hTK1b37rcRcs4Xl73Rec6WO1kAHBNalleSBK8vYR2snVc2K+GS5rTZelgMFFI6a6F2ceOGgFlilLjp2HeJlXfMkHeN6nNu5xu+fE/pRRpF4az5X2OYw8HFeMEqKo5gc9IwzNELdg+RfZoj1BUD3dunbx0YTahT/iAKA5pmw/8LIhu4w96ZPOg4iTNlumOjWCDIF88DvixRcgmwjC+BUHqdf3Pj4DqXuO5mdE4XC6h96jBNxfcIt6fpgREnpYgYiMw= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2016 07:09:08.7207 (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: AM2PR08MB0563 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161113_230934_293918_3B429837 X-CRM114-Status: GOOD ( 11.43 ) 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, 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 When testing the gigantic page whose order is too large for the buddy allocator, the libhugetlbfs test case "counter.sh" will fail. The failure is caused by: 1) kernel fails to allocate a gigantic page for the surplus case. And the gather_surplus_pages() will return NULL in the end. 2) The condition checks for "over-commit" is wrong. This patch uses __hugetlb_alloc_gigantic_page() to allocate the gigantic page in the __alloc_huge_page(). After this patch, gather_surplus_pages() can return a gigantic page for the surplus case. This patch also changes the condition checks for: return_unused_surplus_pages() nr_overcommit_hugepages_store() hugetlb_overcommit_handler() After this patch, the counter.sh can pass for the gigantic page. Signed-off-by: Huang Shijie --- mm/hugetlb.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 58a59f0..08e66ca 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1647,7 +1647,7 @@ static struct page *__alloc_huge_page(struct hstate *h, struct page *page; unsigned int r_nid; - if (hstate_is_gigantic(h)) + if (hstate_is_gigantic(h) && !gigantic_page_supported()) return NULL; /* @@ -1692,7 +1692,10 @@ static struct page *__alloc_huge_page(struct hstate *h, } spin_unlock(&hugetlb_lock); - page = __hugetlb_alloc_buddy_huge_page(h, vma, addr, nid); + if (hstate_is_gigantic(h)) + page = __hugetlb_alloc_gigantic_page(h, vma, addr, nid); + else + page = __hugetlb_alloc_buddy_huge_page(h, vma, addr, nid); spin_lock(&hugetlb_lock); if (page) { @@ -1859,8 +1862,7 @@ static void return_unused_surplus_pages(struct hstate *h, /* Uncommit the reservation */ h->resv_huge_pages -= unused_resv_pages; - /* Cannot return gigantic pages currently */ - if (hstate_is_gigantic(h)) + if (hstate_is_gigantic(h) && !gigantic_page_supported()) return; nr_pages = min(unused_resv_pages, h->surplus_huge_pages); @@ -2577,7 +2579,7 @@ static ssize_t nr_overcommit_hugepages_store(struct kobject *kobj, unsigned long input; struct hstate *h = kobj_to_hstate(kobj, NULL); - if (hstate_is_gigantic(h)) + if (hstate_is_gigantic(h) && !gigantic_page_supported()) return -EINVAL; err = kstrtoul(buf, 10, &input); @@ -3018,7 +3020,7 @@ int hugetlb_overcommit_handler(struct ctl_table *table, int write, tmp = h->nr_overcommit_huge_pages; - if (write && hstate_is_gigantic(h)) + if (write && hstate_is_gigantic(h) && !gigantic_page_supported()) return -EINVAL; table->data = &tmp;