From patchwork Mon Nov 14 07:07:36 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Huang Shijie X-Patchwork-Id: 9426669 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 E677D60484 for ; Mon, 14 Nov 2016 07:12:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D7DF4288FA for ; Mon, 14 Nov 2016 07:12:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CB2722890F; Mon, 14 Nov 2016 07:12:31 +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 68399288FA for ; Mon, 14 Nov 2016 07:12:31 +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 1c6BPc-0003Kn-A0; Mon, 14 Nov 2016 07:10:40 +0000 Received: from mail-eopbgr10072.outbound.protection.outlook.com ([40.107.1.72] helo=EUR02-HE1-obe.outbound.protection.outlook.com) by bombadil.infradead.org with esmtps (Exim 4.85_2 #1 (Red Hat Linux)) id 1c6BOP-0000wL-TM for linux-arm-kernel@lists.infradead.org; Mon, 14 Nov 2016 07:09:34 +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=9rZHXhza9MzjRj7OhuODzdDnij/mhxRndBNVawyrSic=; b=cdgMRk8rGg6CWKE9VYycWceMsuXh0trYguqwzgJqW3YGpPdXTqMA0jO1p/HJ+f3A+6TUi8Dj9GT1ejqQ4oooDZBQPs2ASCUFfH+l0il/FYmDeduMmn9WoutBrjK0s9LDnj/2uJq3/vKT5A0utzNSax5XSgyLOMT9r8qPHy/9Dp4= Received: from AM2PR08CA0040.eurprd08.prod.outlook.com (10.162.32.50) by VI1PR0801MB1790.eurprd08.prod.outlook.com (10.168.67.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.721.10; Mon, 14 Nov 2016 07:09:00 +0000 Received: from DB3FFO11FD015.protection.gbl (2a01:111:f400:7e04::172) by AM2PR08CA0040.outlook.office365.com (2a01:111:e400:843e::50) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.707.6 via Frontend Transport; Mon, 14 Nov 2016 07:09:00 +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:08:59 +0000 X-IncomingTopHeaderMarker: OriginalChecksum:; UpperCasedChecksum:; SizeAsReceived:1089; 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:41 +0000 From: Huang Shijie To: , Subject: [PATCH v2 3/6] mm: hugetlb: change the return type for alloc_fresh_gigantic_page Date: Mon, 14 Nov 2016 15:07:36 +0800 Message-ID: <1479107259-2011-4-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)(189002)(199003)(36756003)(33646002)(2906002)(246002)(50226002)(626004)(356003)(586003)(26826002)(92566002)(5001770100001)(47776003)(76176999)(50986999)(8676002)(5660300001)(4326007)(106466001)(6636002)(8936002)(189998001)(77096005)(87936001)(6666003)(86362001)(7846002)(305945005)(2950100002)(50466002)(5003940100001)(104016004)(48376002)(309714004); DIR:OUT; SFP:1101; SCL:1; SRVR:VI1PR0801MB1790; H:nebula.arm.com; FPR:; SPF:Pass; PTR:fw-tnat.cambridge.arm.com; MX:1; A:1; LANG:en; X-Microsoft-Exchange-Diagnostics: 1; DB3FFO11FD015; 1:lNyk+3EdylCUicWevctrwFKiRVOpyoanuWIHIMFGhUU9+8ZT+3UexN0nrSO61JeB9FvPUOhql5fOYkP9m7O6+wv3jxR0cBtTiixa1i9GvaiuJLBA6Tk4wX43zarcD7LNg7IxycEzfEzxKCKYROek4rO/hml8nh0RLbd7vkxdAWjq2hWi0wK5lyRDSD7JhObnJGQVdQdebH5Yl/yhT6yIiMDJi7C2Dhn6cBgqcsUvLKUCehyOAcPahVxLcnVuhhS1JalLTFjwF382WrCO8ujQx5IxE53WbEeNOauH7ud13McXjW8eyrmvsc01Nv+LsDgnupz9loiWNo55Xl4nqHOAuTYccCwdLX8vUii2sC4yZenNoZ/PE3dlPqY/wEwQmyTa8lcMCbeQDjEaQdlJcGG1rSgx3F8P+vpbSsMDIHXynoHwsMN8vy6wX8F/IWxWJqOILw4BldjrJte0q60n6/zD/BzTzLInggFjtrOnnBukiN2+uywE2j0wNuyGnD7/8RhxAMS+SR3zjFdKDP1AtqkYwZY//HQc/EwwmPLb1gnPbilOb1IFD584dReBOhqGt/FpT3uHnoAs7qrJsjx8ZrgSrMEkaOlH6B+StXaOmwBl3NBBOOQkVO79o44h+Oll84p70nznHbJYDPf4m0kj6TRkKlUCphZOcOrr4UROXszvf/s= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1790; 2:IfEwJTTLfczXL4ME+w0X6eeckHU/1tExK4EbMwzviEoqoDliJwnud1DkNn3cvaKP98hPZPsfNcowsrCG21v9AUkrEgqLiig6AED9mBHMORoodmbHzcb6j4Pw0bUjhUyU99oyj1TVQ9dLr7MyhxpY+oVuUROLX6ZwPOt0GDtQotw=; 3:4MiVZZ1agkRptrYAQlseqCHHOtgQw41qWl2SYV3G3TZ4anRAAmXax756UC6avrzRQRcZto6GHtn76w2+2mZ3YDNOeJw2sq+G+7Ma/bZNfaXi9MxAHxWxEaazwaQscKd0z5UxZaCjeqZlJ1J4xmEEbA9eQWoN/N+mc/LSsKQ3Hx7l8xT31lUDycNe41XQqndyskvvjRJ0OsqLqw6jX9xppOrkNORDennlKqCdEyltnldTPpk8bb/so2GInyxrfK+GhBfZKO/n0jz2UL7FvWQDnG3e7LAuQ61yi4euqztJ3Gs= X-MS-Office365-Filtering-Correlation-Id: 1d6ba3a6-c2c5-47fc-0473-08d40c5d1b9c X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(8251501002); SRVR:VI1PR0801MB1790; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1790; 25:ezMMYiK9SiY8kkOutO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; 20:jymew5Do6MlKOjdFXx1x9ciaC4YY4cnr/DnqW8vc+R/tNRYByoMzYGRm5Hd2sNortVa36b3zWe0NYr8XvbKV+dEjS8BpMct9mKqBRniNE8tgjNLnvM+L4b8RxGNWOJ4xWVzZjkpyCWwswzIdh0qN2mr09pIM2kgYxNtBK7Af0ElSWAyWpynMorbUpj4TZtC9P5jYtvZDPsFwhlPD68DDGxLb8pJPkciCOWFoEfRWnE8f0aMG2y+zyoDxWuHbVp6y 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)(8121501046)(5005006)(13024025)(13020025)(13013025)(13023025)(10201501046)(3002001)(6055026)(6061317); SRVR:VI1PR0801MB1790; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1790; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1790; 4:Mra8Ong3rLlsX3NMJ86NoBKX0UnUBPK0OYFNFcEgn9pDh/Sdv8o9HaixNhSadyTgIaxwNqFH7OkSC7meBZb+bIHiu0Jdyh9di3vUvisKiaOwaheIBUiXe8mwdG5oDoOy/cVJ+Bgpr4BS3XWzQevWKDSS9rT0FCaHqmgKdza6VIyiVDpVLW13Y6cALL10UW5FOw2igmHkR8Q8+bZwG3ylLnxjYX+1sEv7tOhmDjQieYadM+fSWip247RFAO86lFnhHdnAr1OzWglZwzTr24snCXtfwlQII8UkN4vp9EtcGLeYxH53STr9RffS7l9o3Xq70kw8ypDvcC4U0YtdY1LZ3rqTuJKvilkXScyen3/73A23i45f8GXl1RuEU65xvi6tqGNRiWcyad03ZUanhQjY87mB38IExkxmUhPdAgJEYhM4eVydfyx3XCuyWhPM8vA4ePWhXdFwrMB5seW9Iseo26phcXPBpZlfkaVHIXqohLz0nyRgwDTzrnPMoJeMzn61xIdSsyeSk5mHbDwBMHxuq5chZZFMqhp5g1NhqKj8yNSLw0VOEvabrCH2q1ML23lQ X-Forefront-PRVS: 0126A32F74 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1790; 23:H1XyrWVulc2VKtb5dCP4N5vL6sEZuxx3ksxjJpX?= =?us-ascii?Q?k4BwPWC5CZp0vpiNBtK9Bro0hzXrgi1wap6aqOE4hEBg6169RVFxKALu/GfV?= =?us-ascii?Q?J1Aa2TPmOp1sHsmp5Xu7gXtYBQ841gnqjuG1dNoI4TF7/BOMedS7YJR/hLWT?= =?us-ascii?Q?fI/nZIAI+be4fltA71RWAYQr5SXuMFWY7UA17wWX1lpsQ0TMzLR8t+3/oJFi?= =?us-ascii?Q?dHRuGlfGtCv2B83gsNfu3RiXxScQgA6PqxHj+ybGTOpATwAewMwGtX0MsLFa?= =?us-ascii?Q?UuiHihkHaN5bTqg+zw4+ClyjHWBLlAhaGEaVYGfmILOyMqFxt4Nsu+akabk4?= =?us-ascii?Q?8mVO4EcNgcf0H4elHpmqo5Vr42SY5QVyrOtAtmW3NpCYKaDeQWoE2eST6VPQ?= =?us-ascii?Q?nMrMUiaV9c+e++Ksr/47DCoxsrgmqiVP+a2Hl+o/wCFmjMzm69w6XKIb9gYm?= =?us-ascii?Q?xHazJoNd53M9TGFCW7to91eyw7NSPi2CnfPgNRqXxtGNjTTzhmkGlCFBQUYd?= =?us-ascii?Q?kc7FGjootC2z+shRUAProV6cKUZxeHFB/gp8/DkD8KpljWeRpf7EUSQbiVU/?= =?us-ascii?Q?/4bBYXJq42B7FoaoOZfovTKBvmNaWe4hi3cNy673m4uEwVauuXBWJMO8+eRi?= =?us-ascii?Q?jJHQ9OUsO1jTVhLp2n4TvpWT1zV4nLfpqRJbJxNlC3it85QJ9aiNilOIBwFR?= =?us-ascii?Q?pbbAqGDflTwogC6Ia8Drqb+dH2E8GbyEsCjpvqM3zSFsfU327WH9Rxfz17FS?= =?us-ascii?Q?hLnbYJTBr6nevEYQocXW6ubULS6ZqI4quaJsXCONfIufg1MUjj84BKDXQ7PM?= =?us-ascii?Q?6JFaFfWYuTjjiKV40e3H8LMcdBcjfSoOlXevtyNKWxpuo6WOlYhWA/CAe73A?= =?us-ascii?Q?ihNLF28N8uvRePBgSMRgFe3tGc181P9VEwWe7o6PJqd26/P3sFeVhgDhnSGs?= =?us-ascii?Q?CtmCLt60sytHC9vGAepqQG1mKjo0kwbB+u9lXfPFKlzQASc/H5LtHEjnR7Xq?= =?us-ascii?Q?bN9X/PdL7QLujMw16a18wxKco?= X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1790; 6:3VeNnnmd9Dw6Tj0VXeKXJ4u4/abfbl90S1FoArpbtSx6znCfUHlKcytOV0bHJXwUgf6RB/X5eM/Dq6h8umrdTi5+mz3nqft08/I/b2Hs2WsRcE/sLlwUv9b1MleDMq92KGk5YiMKA3FS654UKo/Fly9NfIiZ8eDTOCEcAF8GPbli7Av5+RkFRE/Kw86KlklCQnBCDy/q2hA5EHXS0f3fAoT0aqih6BlBYAACya7bsYCL4oSB6HI31+ba0AsZSx6lZheu8zLuyITNaB5bUxjUGMmcvOepnQ69qk8co73feHqT0HgsAPuNbzajwUsGlX+95t3h+2RthTbpjy3oiVtRNoKqtBBxiL2nTCKrKimsx+Pu8uR0b7PfGR56y+fQuA/E; 5:+DKVJNGZwjLEkqZvxIHMI1W2H7ELtlvNMERgpijINbd5CkmRVQ+b5eJjDJvdq8QxUVebqY55Gm/O/zcZxz0/zWyyzr2LoOeBlrY45QN5eogkFhDd1wivKpp2VNiO5f+mQI84PBH7otderliKwHAo/Q==; 24:5K4gcDuezfxO2/kwfKzVUnTx11NeGeP8WIuaIvTURn3N3f+T3nYWBdmQcq7YzUikKGlXTYG4NqIwvHdVUnZhh70rbpVxO6OCiIZSWurEpVM= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1790; 7:dIPlZ3E9+azSFDNpecxhBnEnv3mwRP6VkPdPMWw1QSg/NsLWnqlAhm9WM2mQcsQRTQXPhBDVO+Ytd6h2AhnyBi1NOxTZYbWoTOd4nfnyQmOJ3sSsNfizaFkd4R+UUTy9jfwD8kzRJ1sAZ+rAw1gZ03yYdFOuTz82XhACj7iBTIBRpe4ANDBNaVzlMIvPAbO+LaBZMlzWxjyGdLG887qdFaqHeG0jDXBforK66fstN2NyFvvFh851emKHTpSE2hlt7OdL+cJ+aHNUCgP6j3VY4J6lxBodwnKEqKjFfWeDBTrpkyNROkoccFEhGZd3Qaf8F95pjjNBMzIQbLt/Jot4Y0neJ2gYxbNaIz+t+JMifuo= X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 14 Nov 2016 07:08:59.8131 (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: VI1PR0801MB1790 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20161113_230926_716313_2BD59DF6 X-CRM114-Status: GOOD ( 10.67 ) 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 This patch changes the return type to "struct page*" for alloc_fresh_gigantic_page(). This patch makes preparation for later patch. Signed-off-by: Huang Shijie Acked-by: Michal Hocko --- mm/hugetlb.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/hugetlb.c b/mm/hugetlb.c index db0177b..6995087 100644 --- a/mm/hugetlb.c +++ b/mm/hugetlb.c @@ -1142,7 +1142,7 @@ static struct page *alloc_fresh_gigantic_page_node(struct hstate *h, return page; } -static int alloc_fresh_gigantic_page(struct hstate *h, +static struct page *alloc_fresh_gigantic_page(struct hstate *h, nodemask_t *nodes_allowed, bool no_init) { struct page *page = NULL; @@ -1151,10 +1151,10 @@ static int alloc_fresh_gigantic_page(struct hstate *h, for_each_node_mask_to_alloc(h, nr_nodes, node, nodes_allowed) { page = alloc_fresh_gigantic_page_node(h, node, no_init); if (page) - return 1; + return page; } - return 0; + return NULL; } static inline bool gigantic_page_supported(void) { return true; } @@ -1167,8 +1167,8 @@ 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, unsigned int order) { } -static inline int alloc_fresh_gigantic_page(struct hstate *h, - nodemask_t *nodes_allowed, bool no_init) { return 0; } +static inline struct page *alloc_fresh_gigantic_page(struct hstate *h, + nodemask_t *nodes_allowed, bool no_init) { return NULL; } #endif static void update_and_free_page(struct hstate *h, struct page *page) @@ -2315,7 +2315,7 @@ static unsigned long set_max_huge_pages(struct hstate *h, unsigned long count, cond_resched(); if (hstate_is_gigantic(h)) - ret = alloc_fresh_gigantic_page(h, nodes_allowed, + ret = !!alloc_fresh_gigantic_page(h, nodes_allowed, false); else ret = alloc_fresh_huge_page(h, nodes_allowed);