Message ID | 20240814-fix_vmap_unlikely-v1-1-cd7954775f12@gmail.com (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 7CF86C52D7C for <linux-mm@archiver.kernel.org>; Tue, 13 Aug 2024 17:12:25 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 170AF6B008A; Tue, 13 Aug 2024 13:12:25 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 0D22F6B0092; Tue, 13 Aug 2024 13:12:25 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E8D356B009A; Tue, 13 Aug 2024 13:12:24 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id C601C6B008A for <linux-mm@kvack.org>; Tue, 13 Aug 2024 13:12:24 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 5E8641409E9 for <linux-mm@kvack.org>; Tue, 13 Aug 2024 17:12:24 +0000 (UTC) X-FDA: 82447865808.06.0F67D4A Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf07.hostedemail.com (Postfix) with ESMTP id B80B540012 for <linux-mm@kvack.org>; Tue, 13 Aug 2024 17:12:21 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XMnbDAr6; spf=pass (imf07.hostedemail.com: domain of devnull+shankerwangmiao.gmail.com@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=devnull+shankerwangmiao.gmail.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723569106; a=rsa-sha256; cv=none; b=EKi1CoFvRES0SDtM/Ur8MMoh7IoXpGFasHyz775Dt5j15uozZwrRtOK1KVcqrRZOy5oSNr JEtClRgoMV5Du+L/+kUAUepyB/OU99sRknwMrmT/FTglV/OJlXoJ3/WGrFnrwoI20qdvI0 AZurlaOBY4F4+BGpFzKyX/Nnu1DRE0o= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=XMnbDAr6; spf=pass (imf07.hostedemail.com: domain of devnull+shankerwangmiao.gmail.com@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=devnull+shankerwangmiao.gmail.com@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723569106; h=from:from:sender:reply-to: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:dkim-signature; bh=ibetxZcuEkw1mVST4BMyURM/sT+TIu2zkxWLpiEA6/Q=; b=ahqKQocw/q46pfqTme/zBkNqLrk4wIcc9Zl975ljE9aL4Wc8P/0oHIUNnCLkFkgCxLlFAT UMK1r9W5xmdeYEOV1qs9nGNQQSdWNWkb3FvQKQtlF9oXinT9ptHm0NTQKL9o4mB5YsvnkX vxxDXFrjj+5S+PCiV/Hs5Q4W14BQK7M= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id 5ADECCE166B; Tue, 13 Aug 2024 17:12:17 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPS id 1C618C4AF0B; Tue, 13 Aug 2024 17:12:16 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1723569136; bh=0ErpuWWSPnpaojgHN11TgqxPDqy80549EkewgFkL670=; h=From:Date:Subject:To:Cc:Reply-To:From; b=XMnbDAr6OJ4ZfBkMdfT9QJfBYxeQ6SyhoRHnPK7K/VlF8J1EkoPLi1SABf+wfzMSY jCAXM456Ba559AcTyN5PitxPB5EvTRDWtg1sIx0M+/0bEhi4rIfjlWirinqMMpkFgm yN12l66ERVzvm8vzwWyZ1+j6OTtdnWLwz2IUJVzeuqn1JP0B5NjdfkPVLaUuLc2V2N E3vvvQaAilxhxl3NEBaKVdFa4jn7d+CqSEQPKnaT9KEYnHUEreacKpOUauPGCbsOlj K81/2ClgqJeZl+TjhSLm5KfIQfnfaIQWN8mBlG5xqItvDgh71pr6PbJUrY39jmAc4v hp//iU75Ska8g== Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id EF4CFC52D7C; Tue, 13 Aug 2024 17:12:15 +0000 (UTC) From: Miao Wang via B4 Relay <devnull+shankerwangmiao.gmail.com@kernel.org> Date: Wed, 14 Aug 2024 01:12:13 +0800 Subject: [PATCH] mm: vmalloc: add optimization hint on page existence check MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Message-Id: <20240814-fix_vmap_unlikely-v1-1-cd7954775f12@gmail.com> X-B4-Tracking: v=1; b=H4sIAOyTu2YC/6tWKk4tykwtVrJSqFYqSi3LLM7MzwNyDHUUlJIzE vPSU3UzU4B8JSMDIxMDC0MT3bTMiviy3MSC+NK8nMzs1JxKXSNLc+MUo+QkSwOTJCWgvoKiVKA isJnRsbW1AH/FfypjAAAA To: Andrew Morton <akpm@linux-foundation.org>, Uladzislau Rezki <urezki@gmail.com>, Christoph Hellwig <hch@infradead.org>, Hariom Panthi <hariom1.p@samsung.com> Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Miao Wang <shankerwangmiao@gmail.com> X-Mailer: b4 0.14.1 X-Developer-Signature: v=1; a=openpgp-sha256; l=1127; i=shankerwangmiao@gmail.com; h=from:subject:message-id; bh=aKT10OS/EIu/f+l3Yr9+KAyeKsqSPbtIB3kaInDaHw8=; b=owEBbQKS/ZANAwAKAbAx48p7/tluAcsmYgBmu5Pu3nSA77waXX7mNuwFc+0VAxl78qImyULQr uXa9ljONeOJAjMEAAEKAB0WIQREqPWPgPJBxluezBOwMePKe/7ZbgUCZruT7gAKCRCwMePKe/7Z bnjMD/4xPtGTC99xAoo1V0wlI+UMEiaSAmgH/aqfr4Mzmt+XgAIRz5yHddKDAq2Dbc22YEH3Y3Z UqKupngslY6Y4qlv6Ufozw2o7NmTI8dojgtLPIbPfBslKNQW28V7qqLCEN01tsYQm2SFFDq7Jo1 wG1WyGkMyMrflLEKVTONBBCelhFpyZq2cRmwqmVb6+wsm3oA47ueQFRupufsjM6UnpUWMJX0G7h Q+CG+Be/JuRiu7YwkIl8H1HgSYzcQz6Djk+l6YUUSgeM72nFkLfoYqh29EXJI4FGiOFdvdMl8NB 1XSDmkAxh4Ab3IeUg7fMkBqloVUWAGRUpOIslIV+INdzgzmsFldHmjK3eaXw/lY1JCqBOYHc8PE ytCf6MopH/QfvvkIc4zcczvG3cRCOHLOVm3EnUt48JyqOLYM7mI1yl5WKpTNxKe0gF0SK56jjgZ ign8iHfC5yeenD0FA7kqOoh7laVOHS4B4jDDU1LsNCaU/LuFwsUkG1+WC4IuPpTkVutPi2fYjBL pstgO1VJ08V2U46aue7dv+yB/PAcWMwgM98SYKp+poQ9T/umAl0FetGEkuRJcb8dMkN3jYRgV81 YzdiC71umtNVsSis9HZBH5+U2p9PlC/VkWi1jTNLcS4IIRKskEkuFwbJ1CMrh7FAZ161XOblLx3 5Ry2VNwZwvx5eaA== X-Developer-Key: i=shankerwangmiao@gmail.com; a=openpgp; fpr=6FAEFF06B7D212A774C60BFDFA0D166D6632EF4A X-Endpoint-Received: by B4 Relay for shankerwangmiao@gmail.com/default with auth_id=189 X-Original-From: Miao Wang <shankerwangmiao@gmail.com> Reply-To: shankerwangmiao@gmail.com X-Stat-Signature: byeoz3wrzhobhcddjxfi3qqiuqfm4eq4 X-Rspamd-Queue-Id: B80B540012 X-Rspam-User: X-Rspamd-Server: rspam10 X-HE-Tag: 1723569141-909654 X-HE-Meta: U2FsdGVkX18cU2gs0ddkJSWbSAXN/5r8ZKusrVuiZz2tPTdOQoWks/vXNpNnEp2PZpbw4Pg7rxgh0bzl9sCLMYu6VVqNen8o41G8PaLsnItjyRPKMJjazh1KBLmrlQ8C4VmKgUEvLO6VyEFpakvOmWTEG1gX2LsS+4EXzDs4cg/0gJdT3DDDk7lW/WCIHffmUsQ8abWiezEeaJ4uXmjZXQqSN3wEvzC3kG3HasrMZufWqAgmf2e2ipGXMGavvhhH4qMPoUk3yONbuOkpob6Zw4RF/1MH63VK0FXlJb3iTKrWzYJwJKJZBDySgUcugF3IiSI2LTARxk713mKdfYnoDt/Sr0mKX2jI7cFbPH8eGjmRpM/qckS7SyXrNcfwohSWcZT4JXMjpIIr/GrRqy7Qr80CMX/JtBH2yLaSxjhChSU045RGZYiJOgHTiBqKIWCz7LUOxV2gnaWwK/ByRbiur44q91Of7FkjZrfDRxrorS9mmUSBfM/OI2giKN+379jI4RUjmetoHe8Xbq5njBmALvdqzgyVOelglOJgk48wsujUcKBCXJ/7G53tQ/ML3VrRBl1z6VMAQwhfPIcyraxwKNY/yvxH1oImX+oYj3ToXHcLzPrK8MJmVwI/++cw/9f27jG+NYu8iggi97umqaL9QufqKCEtj2PP6D0RH189tRLijQ943iJkyAAI2cNXH3m0MVblg5w2fFkFk62SukBQhp/5yLib+goJbkjEtFzo1nHacC7DIuqwQSktbNaXnmgqGYv+5eIx9nL3zXV76cyOmVX+klcb+63jbHerye5UnIqVk5wi2rqGjN8NQQTnfDURFCjL6PJQZNP/DA6Jjf3xSmsV0V4NBRO1o2cYLZS80pWaLn+ZpM85avZt/TyB/BAcqtQ36Z6Nyc4l34qWYcSibkd/AY1bzwFmMr00tn5WIyispA/7lN+1IygFMrXaN4ZE3PS4MGegxaZ2tu4hAjZ gy6F/NUw HHI2ZN4EcrerowqoE/KapfQuk+3UO+BVpCiH+MduZpvs4afD9+xqRxLnnbVqynZWEMn07Ega/7f3H43CErt9MHwTs6hLLhi5vzV1UsE5WVfURZQMGkO0OksOJSi/d/MCHh+4i+gs8mOAipCPIbb2WlmS4Etv2soYjfPkYWnK1r1vboXaLQQ44Jg6j79z49c5URaxS0zeR18/CMDVf7lcsvNNq85QV+g5cAYISsEMhxjrNdjsgdtN43VBkU6aI3arOEVK734qKzadWjCs2Rdjv8pcJttILtpilu5WQ6srY9orSEaP7TvCPJfTkzH0bLrow5u5svO1jnXQJcR9+7/CFR6/JtKdU8uwuo1Cb2/2FGR39j+h6gLuL3SuozGHk8fN/dviJ0ad8gv3XZF89X7kipNGRPc22J+X6Mpnv52zqZE+P98c= 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
mm: vmalloc: add optimization hint on page existence check
|
expand
|
diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 6b783baf12a1..5d031fc83f04 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -105,7 +105,7 @@ static int vmap_pte_range(pmd_t *pmd, unsigned long addr, unsigned long end, if (!pte) return -ENOMEM; do { - if (!pte_none(ptep_get(pte))) { + if (unlikely(!pte_none(ptep_get(pte)))) { if (pfn_valid(pfn)) { page = pfn_to_page(pfn); dump_page(page, "remapping already mapped page");