From patchwork Thu Nov 3 02:51:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 9410079 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 45AB0601C2 for ; Thu, 3 Nov 2016 02:55:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 360762A60A for ; Thu, 3 Nov 2016 02:55:01 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2A2822A6B9; Thu, 3 Nov 2016 02:55:01 +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 8F00E2A654 for ; Thu, 3 Nov 2016 02:55:00 +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 1c289m-0003SA-58; Thu, 03 Nov 2016 02:53:34 +0000 Received: from mail-he1eur01on0063.outbound.protection.outlook.com ([104.47.0.63] helo=EUR01-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c2894-00036S-N3 for linux-arm-kernel@lists.infradead.org; Thu, 03 Nov 2016 02:52: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=4T/O/5JIniKf4f/Yf/x7UG9ufHvzUr2bwAbn4SpPR9E=; b=QG5xLcCIln8Gvxt/WWsDG6vlecYxUsZNZO3vClNd8nPVQPlLQ7zTIgSHz+ZAqcXrfVLWyvWA15agva8GM6aZhxq4CgBd3zX6Wz6gHTltu4fiebvXzNzUEcbYsvm8xa4Qqmo27WzQQM7OQJbrP1rBuzAbVB1cw0gbs1p+MOnE1sA= Received: from HE1PR0801CA0006.eurprd08.prod.outlook.com (10.167.184.16) by VI1PR08MB1022.eurprd08.prod.outlook.com (10.166.144.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12; Thu, 3 Nov 2016 02:52:21 +0000 Received: from AM1FFO11FD047.protection.gbl (2a01:111:f400:7e00::159) by HE1PR0801CA0006.outlook.office365.com (2603:10a6:3:6::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.693.12 via Frontend Transport; Thu, 3 Nov 2016 02:52:20 +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 AM1FFO11FD047.mail.protection.outlook.com (10.174.65.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA_P384) id 15.1.693.6 via Frontend Transport; Thu, 3 Nov 2016 02:52:20 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1076; Count:13 Received: from ent-kernel-softiron-01.shanghai.arm.com (10.1.2.79) by mail.arm.com (10.1.106.66) with Microsoft SMTP Server id 14.3.294.0; Thu, 3 Nov 2016 02:52:18 +0000 From: Huang Shijie To: , Subject: [PATCH 2/2] mm: hugetlb: support gigantic surplus pages Date: Thu, 3 Nov 2016 10:51:38 +0800 Message-ID: <1478141499-13825-3-git-send-email-shijie.huang@arm.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1478141499-13825-1-git-send-email-shijie.huang@arm.com> References: <1478141499-13825-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)(199003)(189002)(229853001)(11100500001)(106466001)(77096005)(50226002)(8936002)(19580395003)(50986999)(19580405001)(8676002)(87936001)(104016004)(76176999)(246002)(33646002)(47776003)(5003940100001)(7846002)(189998001)(48376002)(50466002)(2906002)(5001770100001)(626004)(356003)(305945005)(6666003)(86362001)(26826002)(36756003)(92566002)(586003)(4326007)(5660300001)(6636002)(2950100002); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR08MB1022; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; A:1; MX:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; AM1FFO11FD047; 1:zS1c8K8aRZ1+zCKW+Qw4qrpBw8oSzuOWUbXZg1d0zg+lzrKxehsc2NRdb4aAMZQ6OdjALyZ++bm8g7uU7U2PhiGsTzBraP9FWDtwyP13c3zHPo5SmkJh4HK5E77g/EcOYvkX6/VpAZJh1vStnEJxm/gFg+xE7UvDQCMYBXkI/N9e8t0saFyLg47Iz1fsG1kdth94rB1ci77KjXdCyaQ2hHBVYTttWceIIT1JqeTJ0ZEfgyEpzBkXUdUaCtuN050EFtNiIcSOYjmugeT7yc9Db35AZHghO+L4AnPMh7hkD0avUhhhQK/eq1f++4DcToowhOenVOEpbz/2Q8zZB0B5yvkZ1tBszmDyCheaGh1XPIwKxBnffHne5dSSVEyX+9gMItJDdbTf3Vbcd9Iwqr7uXcDRPLjWEQm5fregndj9hWsb3invIvMMxMMVS7PEEoirmaydnhCF3sXzoSc+nSeHgCiwRLUkrN8auDDq+pbJ7mOOTudjCEq9SXzpyPJuXtyiH9RhDL00xXd6/vVI4UGrpLUSXplDJUYdDVp9YQaAl+SmnNuxub9U0WX3ESzoiDy70jLusgXmMYrea8ffKh/9zWDiT/LqQmZ/ofVgjX4tCJxzR3LLxwTHDDf+N4HcW2RhrOBIn9e2p9ZeWzPmZYTaLk+1HKcVwgM9kRhxnhjfODY= X-MS-Office365-Filtering-Correlation-Id: b7ac8104-ca3c-497e-49bf-08d403946e5f X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1022; 2:I7M3FCg172M9JNXXkTYMU2fe5oAtActxCHAF0qVIR4wL12xn4b/Q/j297YYg35gN90+gvbTBszRBAMYUH2HtFTZk6oMUKhCBP69cyjX+yMUHQHW4GMWEmqnceDlhJ/oqHAlrpAWVdMbeeKicPuIluhVrdTtDju7WRwF7AX7fgJkOufMelucS0mS11O3hSqXFYszQ+tPwQiNCrP4s3j9H0A==; 3:XgpzOpbu4wfeFXHjO3b6IkG3ArRM40H2HlIGt3+8sCjRtdJKNDssq4zWzqPRU2TqTv0/gFMcBAOhRCRW9YdKtz6k4wSx4rjF3qLK435SJ5wtJMxgq7R709fqUI9xr38qRXmy3ImtmKf1F24iH5wxbmbRFQ5wPBiD8woQPKts+C4PfM4aZyydS/tOJbTqwDAmKvQRRbc20NA6gRQB5XaeTT+RZPe+lLbJng0UI7wvBX4U87nCokKXJVUPpk3ylNzxeGRyH1WQD87FF9KPpUa2Q9smZBjuFwegHsGV7tELNnc= X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(8251501002); SRVR:V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NgBWgVEC+hzlK5iFLvhorkA0bUbZU+gHyjvfz4T4HDaaRFYjlb7/2hsqGW89WVX04wnKrQpkmgoe5LPgw==; 20:cbnGkouPgQObNIBmSEHAT/Vq/zr1paR5TMCsSOf5p/yuwbGcu1CSMkpYaIMDPF8ZUcFAaqcNbxmcDxmtg8QXH2WWWeFujCzzJ94xbdTTz9MjXbX3tCGGk28pTyz5gk1bC1aKO6C2XJSOSutTltuK0Ecnvmdi83yVO47ayCs3hmLG39AtmyKe8D13qc/v4M7T4Yllzfg/supWy2Bds1EWqZyNs3zzrjSG06yo+SlZ4j/DmfoGs02OpgP4h06PrYcO NoDisclaimer: True X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040176)(601004)(2401047)(13013025)(13020025)(13024025)(13023025)(8121501046)(5005006)(3002001)(10201501046)(6055026); SRVR:VI1PR08MB1022; BCL:0; PCL:0; RULEID:; SRVR:VI1PR08MB1022; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1022; 4:FfC8rLOJHxyWicddhEvYQBoQnE8d055npdubTyaoO8IX9Ci/unDmBYqUC/w994axKO8a4OwDpARdYGEJ0T0QC8z/U+uGTdT+KKuATEAxqiybP3C/u5sxMGANqfy/3GfcX8DULx32pwIUw26Itxkfwan5X6FHPoRsltAV9EOv3XKnqBoOnvtO28s0G4PSkKTCD+M6a5M6e5Z0+q69FjRkzg0sT6qE/DdjerX1Z/tlw8yT/7NBbz9CMZ6AUajp6rIUGQ8ctEfTNPkwrD3yvjt0iOLCR+FuN+8vb23/InPKNek4IH/LnG4nQsgL5OyPQ6mu4Tj16meTYuZUI2s+XnH2O2XilUMCsoC4rVsv4QljoMpVTHhDoK+kIsIM3eG1/XU9oUyiVjBzsZO0e++wtumyZc9bWFbSmmwCPHCHEe8le0UZQvOatWZBRMA6IzPCWfl9ntNNSiUGP8pGoaJwqTAuzlZ2Ds9HMoVtbthOdcnh3C9+K2/Q7RIyC41AKufgdG3ZeYsP4mrrf/fmBDvtwE0KC503ITCOGAIVuHVufUAC+ps= X-Forefront-PRVS: 011579F31F X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR08MB1022; 23:NwRizeujgLQ+XP+C6hgB5XD8Cs2XUSR3M4XeCk7zr?= =?us-ascii?Q?VthCjihknNSHWCDDSAQT2QEzQ1BiIRZiWXs4cFT7b70KKaswG47c040E2/cX?= =?us-ascii?Q?DcNKyvezen2oi/1ORy50yQ03r2dvraJrIa/SHw0f6V7iTpGxTbFy8KaxdqAa?= =?us-ascii?Q?eXKMMsiZL5hzSWK/zVIFIbawRtY6FppQ1UwWUI3q1W+ksg++UTTf5eQXUq00?= =?us-ascii?Q?b5pml87rh5aS0FI7KOWu1T668fGI9cAvLrdcRIP/ktZvmr+YuAj1/E21D6yd?= =?us-ascii?Q?yahM1oR3Tiw+sR9VVimbyzCBMi0OZjU7+HpE7/OGbu5m9UVdGQJqvrPhJH9/?= =?us-ascii?Q?Lafoowooj7hTXmoDTbO00dv0Vy5pfNwLvGpRhHeXWwU2ViTDiWzA/3HVkfXV?= =?us-ascii?Q?iWTPNFNBzqiIT1yjn+reP9DWdMYyN4mO5hza7DUnbGIdNpV9yDkc3vqrUkcs?= =?us-ascii?Q?a6Iwivyk8f1GX+DeJ9MKw4ueRTsl3vL2EAs8fwE7h6ES/InifQvawq7fVjOQ?= =?us-ascii?Q?V/8JI2UTvAY5qtucRP8sg4kfk7pbntZNPVToCn1BUPyOtGndXkQlOjMtkKIN?= =?us-ascii?Q?2V6QVqgmNxDBLvf4jd3Y1pyGGPjpUGsdYZlBtMqWUzO3TJ073CYbfLoR33j7?= =?us-ascii?Q?Y9dU6bTpiPGNzLmSKLBW1LLJWx3d7lXK7+bIYCdy0OeToDOA+cXrdxiL1gyl?= =?us-ascii?Q?FhEmIXYEPobZ9DNrYGFbHDM9SGd088Uaj9NKuCUfKxBHI4GXBD2dWd9sF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SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB1022; 7:BNWSSa+yewx4jnMD6QyMfbk5b3dWCX95ssD/8YV15DxukUO8MdSVJueyIFTbM4WaMEXmx0ID0WvXMUC/9ztCZCnJNsijlMznXgmpGG29MlKyLr8MS3zlBfZFy3+wfHFq4BsHZoaGIuYIYCUgEMZPdNLgSjSoEGhAxc6MkQyS++e+Y/7Z/9Mxvdt7cVvAVTS+s5bp0xEfqVqfnlkkvtDt2obfctvCiUPoJIGZsHVX1KkyNRP64EMFBBmKUliQxMBX7rOE3VwDtVJAnhDLWvfQTWsupaecGp4XwrJ3E6v3Pg79GhnInlhN5aDNFP8M1W3RcP2PyhpYxzY0UEGE77/b56AQV9I5Sgl8f6oMnXdh4Ho= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Nov 2016 02:52:20.5524 (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: VI1PR08MB1022 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161102_195251_470289_221672A2 X-CRM114-Status: GOOD ( 12.04 ) 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 adds code 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() After this patch, the counter.sh can pass for the gigantic page. Acked-by: Steve Capper Signed-off-by: Huang Shijie --- mm/hugetlb.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index 0bf4444..2b67aff 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1574,7 +1574,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; /* @@ -1619,7 +1619,13 @@ 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 = alloc_gigantic_page(nid, huge_page_order(h)); + if (page) + prep_compound_gigantic_page(page, huge_page_order(h)); + } else { + page = __hugetlb_alloc_buddy_huge_page(h, vma, addr, nid); + } spin_lock(&hugetlb_lock); if (page) { @@ -1786,8 +1792,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); @@ -2439,7 +2444,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);