From patchwork Sat Jul 9 09:24:40 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaohe Lin X-Patchwork-Id: 12912129 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 CB20CC433EF for ; Sat, 9 Jul 2022 09:25:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 508506B0072; Sat, 9 Jul 2022 05:25:01 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 4B83D6B0073; Sat, 9 Jul 2022 05:25:01 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 380DF940008; Sat, 9 Jul 2022 05:25:01 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id 21CD26B0072 for ; Sat, 9 Jul 2022 05:25:01 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id EB65E3430E for ; Sat, 9 Jul 2022 09:25:00 +0000 (UTC) X-FDA: 79667027160.21.2605242 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf02.hostedemail.com (Postfix) with ESMTP id 18F738001E for ; Sat, 9 Jul 2022 09:24:59 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4Lg4TW63PqzFq0t; Sat, 9 Jul 2022 17:23:59 +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.2375.24; Sat, 9 Jul 2022 17:24:50 +0800 From: Miaohe Lin To: CC: , , Subject: [PATCH] mm/page_vma_mapped.c: use helper function huge_pte_lock Date: Sat, 9 Jul 2022 17:24:40 +0800 Message-ID: <20220709092440.43018-1-linmiaohe@huawei.com> X-Mailer: git-send-email 2.23.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.27] X-ClientProxiedBy: dggems701-chm.china.huawei.com (10.3.19.178) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1657358700; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:in-reply-to: references; bh=qIRp5A1zE2N9asSbNRkoZgA/AxOuSgktym+5D/oISq8=; b=7BELeSu9uRIECDSGZbpFdYjArZIxYHQsZyQhHToGt/7gDpUE0qHtJZ+43/i6jAxJsn/S+x loqQakNOZIEO3Q0vnDeawWiSXPDRxHTaK3TCXUC5K8PTg2s5EnwywEDm1+4uoWzcGcn6it GFxbNlr9FihJnMDstRs0iUejpMjGZJ0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1657358700; a=rsa-sha256; cv=none; b=sj8uAYu4qTnqC5/PcOklwaWnp1cSPOTU3oWx/JTCvyriW5pvcYhh7fWyeAsAH+RSaLT8cS YaYZ4IHhDFP6miBT4cEN/dzCctxBdRnaN+eiFVb8X5toXku2IxSK6JSI0/WodSW1yVZFbx uvKjpoNFVcz+ZAnZB2qwltBE19sLBIY= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com Authentication-Results: imf02.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf02.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam02 X-Stat-Signature: y9hir8nrqh91io3oqp54iqg3anoo11s3 X-Rspamd-Queue-Id: 18F738001E X-Rspam-User: X-HE-Tag: 1657358699-355577 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: Use helper function huge_pte_lock to lock the huge pte to simplify the code a bit. No functional change intended. Signed-off-by: Miaohe Lin --- mm/page_vma_mapped.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/mm/page_vma_mapped.c b/mm/page_vma_mapped.c index e971a467fcdf..8e9e574d535a 100644 --- a/mm/page_vma_mapped.c +++ b/mm/page_vma_mapped.c @@ -174,8 +174,7 @@ bool page_vma_mapped_walk(struct page_vma_mapped_walk *pvmw) if (!pvmw->pte) return false; - pvmw->ptl = huge_pte_lockptr(hstate, mm, pvmw->pte); - spin_lock(pvmw->ptl); + pvmw->ptl = huge_pte_lock(hstate, mm, pvmw->pte); if (!check_pte(pvmw)) return not_found(pvmw); return true;