From patchwork Fri Feb 4 17:57:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12735412 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 3A320C433F5 for ; Fri, 4 Feb 2022 17:57:06 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id C94DB6B007B; Fri, 4 Feb 2022 12:57:05 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id C1C5A6B007D; Fri, 4 Feb 2022 12:57:05 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id ABD2C6B007E; Fri, 4 Feb 2022 12:57:05 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0226.hostedemail.com [216.40.44.226]) by kanga.kvack.org (Postfix) with ESMTP id 9D74B6B007B for ; Fri, 4 Feb 2022 12:57:05 -0500 (EST) Received: from smtpin26.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 64559181F5FFF for ; Fri, 4 Feb 2022 17:57:05 +0000 (UTC) X-FDA: 79105853610.26.81EC836 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf01.hostedemail.com (Postfix) with ESMTP id 02F2540002 for ; Fri, 4 Feb 2022 17:57:04 +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 6115561B49; Fri, 4 Feb 2022 17:57:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 86FE5C004E1; Fri, 4 Feb 2022 17:57:02 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1643997423; bh=MDHhps9eYNeO/cKBYWhXRHb++o+a0biupbPiV5wilT0=; h=Date:To:From:In-Reply-To:Subject:From; b=yXuE4lfRaXcYFYVr51iwEB8rRXAZHvdMod62wlg2NKww9Y532DBCEdT2liumH2Rnt GawJB4yxNLlfPQUoJOn8AmC0RBddUn7XcHWH7DW1iPMMxn4ZNjmxSwt7lB+QLSGwKM 3tmdfbicYFUi2n+VEmsQCDzxOtUKKn7nWLr0Ukz8= Received: by hp1 (sSMTP sendmail emulation); Fri, 04 Feb 2022 09:57:02 -0800 Date: Fri, 04 Feb 2022 09:57:02 -0800 To: stettberger@dokucode.de,stable@vger.kernel.org,khalid.aziz@oracle.com,rppt@linux.ibm.com,akpm@linux-foundation.org,linux-mm@kvack.org,mm-commits@vger.kernel.org,torvalds@linux-foundation.org,akpm@linux-foundation.org From: Andrew Morton In-Reply-To: <20220203204836.88dcebe504f440686cc63a60@linux-foundation.org> Subject: [patch 06/10] mm/pgtable: define pte_index so that preprocessor could recognize it Message-Id: <20220204175702.86FE5C004E1@smtp.kernel.org> X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 02F2540002 X-Stat-Signature: jt8mnuh5iunm8mqmqje9acz1ibyrdapu Authentication-Results: imf01.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=yXuE4lfR; dmarc=none; spf=pass (imf01.hostedemail.com: domain of akpm@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@kernel.org X-Rspam-User: nil X-HE-Tag: 1643997424-10169 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 Subject: mm/pgtable: define pte_index so that preprocessor could recognize it 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 a 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. Link: https://lkml.kernel.org/r/20220111145457.20748-1-rppt@kernel.org Fixes: 974b9b2c68f3 ("mm: consolidate pte_index() and pte_offset_*() definitions") Signed-off-by: Mike Rapoport Reported-by: Christian Dietrich Reviewed-by: Khalid Aziz Cc: Signed-off-by: Andrew Morton --- include/linux/pgtable.h | 1 + 1 file changed, 1 insertion(+) --- a/include/linux/pgtable.h~mm-pgtable-define-pte_index-so-that-preprocessor-could-recognize-it +++ a/include/linux/pgtable.h @@ -62,6 +62,7 @@ static inline unsigned long pte_index(un { 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)