From patchwork Tue Jan 11 14:54:57 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mike Rapoport X-Patchwork-Id: 12709920 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 814C3C433F5 for ; Tue, 11 Jan 2022 14:55:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C0C616B0072; Tue, 11 Jan 2022 09:55:06 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id BBB976B0073; Tue, 11 Jan 2022 09:55:06 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A83236B0074; Tue, 11 Jan 2022 09:55:06 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0241.hostedemail.com [216.40.44.241]) by kanga.kvack.org (Postfix) with ESMTP id 95A016B0072 for ; Tue, 11 Jan 2022 09:55:06 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 3F929181CEE84 for ; Tue, 11 Jan 2022 14:55:06 +0000 (UTC) X-FDA: 79018303812.06.2087182 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf24.hostedemail.com (Postfix) with ESMTP id C52C118000D for ; Tue, 11 Jan 2022 14:55:05 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id D96226168C; Tue, 11 Jan 2022 14:55:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7C8D1C36AED; Tue, 11 Jan 2022 14:55:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1641912904; bh=rdtKFzk5rkjL2CZWYI4wv3pYeOQVX9D847F/Fb8v8Iw=; h=From:To:Cc:Subject:Date:From; b=MPn0zXl+8gwVJwRSd0q+l1incPABWS8960L8naJ1GcZ0OnU8/3pwzqiA/BiS94w+u vlB5WlIzAOwSBzazOYqjbBmHKSsh7Jrhqe6oyxPMgIs0uk9OvTIRwR5T4995DlivgQ z/wCEGanaHI8Jw4ipUa9+FhTTwQuIQR/oTGvKVPCqmdFfntOMeP2uoCTYOHii5La0v wVdxa4cS9OWkrKJzJEHTp0Lfg8j8D0CPRYGfAUuiHyrhmsqPFRM8BKXhRRgeLsd37s WJ0ag9giM8uGDpqxuQOmwqw7EBvlKG4D74628aVOHVKkwLf9vqkTw1LkFEfkroLJOG hP6XrSpXPZ90g== From: Mike Rapoport To: Andrew Morton Cc: Christian Dietrich , Mike Rapoport , Mike Rapoport , linux-mm@kvack.org, linux-kernel@vger.kernel.org, stable@vger.kernel.org Subject: [PATCH] mm/pgtable: define pte_index so that preprocessor could recognize it Date: Tue, 11 Jan 2022 16:54:57 +0200 Message-Id: <20220111145457.20748-1-rppt@kernel.org> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 X-Rspamd-Queue-Id: C52C118000D X-Stat-Signature: zzrbey67bc7ky6itfwixzum51cr7hqy9 Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MPn0zXl+; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf24.hostedemail.com: domain of rppt@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=rppt@kernel.org X-Rspamd-Server: rspam06 X-HE-Tag: 1641912905-642968 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: From: Mike Rapoport Since commit 974b9b2c68f3 ("mm: consolidate pte_index() and pte_offset_*() definitions") pte_index is a static inline and there is no define for it that can be recognized by the preprocessor. As the result, vm_insert_pages() uses slower loop over vm_insert_page() instead of insert_pages() that amortizes the cost of spinlock operations when inserting multiple pages. Fixes: 974b9b2c68f3 ("mm: consolidate pte_index() and pte_offset_*() definitions") Reported-by: Christian Dietrich Signed-off-by: Mike Rapoport Cc: stable@vger.kernel.org Reviewed-by: Khalid Aziz --- include/linux/pgtable.h | 1 + 1 file changed, 1 insertion(+) base-commit: 2585cf9dfaaddf00b069673f27bb3f8530e2039c diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index e24d2c992b11..d468efcf48f4 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -62,6 +62,7 @@ static inline unsigned long pte_index(unsigned long address) { return (address >> PAGE_SHIFT) & (PTRS_PER_PTE - 1); } +#define pte_index pte_index #ifndef pmd_index static inline unsigned long pmd_index(unsigned long address)