From patchwork Fri Mar 18 11:17:00 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12784169 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 59526C433EF for ; Thu, 17 Mar 2022 14:42:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 301A98D0007; Thu, 17 Mar 2022 10:42:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 264D36B0074; Thu, 17 Mar 2022 10:42:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 0DB7C8D0007; Thu, 17 Mar 2022 10:42:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0097.hostedemail.com [216.40.44.97]) by kanga.kvack.org (Postfix) with ESMTP id E72A06B0073 for ; Thu, 17 Mar 2022 10:42:02 -0400 (EDT) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9032418289580 for ; Thu, 17 Mar 2022 14:42:02 +0000 (UTC) X-FDA: 79254142884.21.BFD5AE4 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf29.hostedemail.com (Postfix) with ESMTP id DF4A6120009 for ; Thu, 17 Mar 2022 14:42:01 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4KK8q52n25zcb7Z; Thu, 17 Mar 2022 22:36:49 +0800 (CST) Received: from huawei.com (10.175.124.27) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.21; Thu, 17 Mar 2022 22:41:48 +0800 From: Miaohe Lin To: CC: , , , , , , , Subject: [PATCH v2 02/11] mm/migration: remove unneeded out label Date: Fri, 18 Mar 2022 19:17:00 +0800 Message-ID: <20220318111709.60311-3-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 In-Reply-To: <20220318111709.60311-1-linmiaohe@huawei.com> References: <20220318111709.60311-1-linmiaohe@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: DF4A6120009 X-Stat-Signature: 3jxd6t841jmheyea4qg7eaw713a1z3id Authentication-Results: imf29.hostedemail.com; dkim=none; spf=pass (imf29.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-HE-Tag: 1647528121-331891 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: We can do prep_transhuge_page when newpage is not NULL. Thus we can remove out label to simplify the code. Signed-off-by: Miaohe Lin Reviewed-by: Muchun Song --- mm/migrate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 50bc62d85eaf..bc1867a5706c 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -2025,12 +2025,9 @@ static struct page *alloc_misplaced_dst_page_thp(struct page *page, newpage = alloc_pages_node(nid, (GFP_TRANSHUGE_LIGHT | __GFP_THISNODE), HPAGE_PMD_ORDER); - if (!newpage) - goto out; + if (newpage) + prep_transhuge_page(newpage); - prep_transhuge_page(newpage); - -out: return newpage; }