From patchwork Mon Apr 29 10:33:42 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646587 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 7945EC04FFE for ; Mon, 29 Apr 2024 10:36:01 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D94016B0083; Mon, 29 Apr 2024 06:35:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D43CB6B0085; Mon, 29 Apr 2024 06:35:59 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C0B816B0087; Mon, 29 Apr 2024 06:35:59 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A8BA36B0083 for ; Mon, 29 Apr 2024 06:35:59 -0400 (EDT) Received: from smtpin08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 52054A17BB for ; Mon, 29 Apr 2024 10:35:59 +0000 (UTC) X-FDA: 82062214038.08.B95943B Received: from out0-208.mail.aliyun.com (out0-208.mail.aliyun.com [140.205.0.208]) by imf02.hostedemail.com (Postfix) with ESMTP id 3A4D18000D for ; Mon, 29 Apr 2024 10:35:56 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=WiL+qiQq; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf02.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.208 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714386957; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6Lf/KTNGeV9HQ9Bw8oLzpkcGoRQJ7Qoem8o9ZsWDa00=; b=aXqRjE/lXlIYWbgCWcMA/oMDz4dPzqc6+XeD0x5GwrvGz3Xorlfc0HcViKg1Cht//xnrYI tUiDbeIWNKzXyVJ9qMCcBNKo8UEsSgA6deDu0S3lW8Du/FI5XI1d323f2LWiutid99U1Lw lzqOE4H9IGsh4IZUrw1HHZQJTcUMev8= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=WiL+qiQq; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf02.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.208 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714386957; a=rsa-sha256; cv=none; b=14oZ/mG9wNy8wvW7iudmY1SaxiR62NTFFw6N8qMX6b0//kZb9dM3wV7tC2lUM5s4xIFazy JTe69xz3/GanCdjccmfDwUH7++1Zu94dJESd7rEe36KTRh1O6TrBkHxjqlXuczi91lPxOC XSoyzY23yEMDX5XsNBNFG+rUiWAoTNc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386954; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=6Lf/KTNGeV9HQ9Bw8oLzpkcGoRQJ7Qoem8o9ZsWDa00=; b=WiL+qiQq5ggcx6KKouoOmmZdbRu4tyn6tVR+PSDU5+g4LD/aG7bh/F+kWEy0F1E9p8rWRXZiHBUAWW7PX579FC6dQiUgUk9xNK2yMzX3LUka9AgQPSqlKtbMXXHD0AU+0AS1Mpo/4+vlWn3JfM9lNMp2eHNxyknvhk/ymbLEbnc= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047203;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---.XOEanKl_1714386951; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOEanKl_1714386951) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:52 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , , "Bang Li" Subject: [PATCH v1 1/5] LoongArch: Add update_mmu_tlb_range() Date: Mon, 29 Apr 2024 18:33:42 +0800 Message-Id: <20240429103346.59115-2-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240429103346.59115-1-libang.li@antgroup.com> References: <20240429103346.59115-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Stat-Signature: 9187ymqb65xcdscuikg36jpz1mqg8q9y X-Rspam-User: X-Rspamd-Queue-Id: 3A4D18000D X-HE-Tag: 1714386956-460552 X-HE-Meta: U2FsdGVkX18hPDhT1DsWEZ8006kWswt3YXdUHj3lf5hWEVoxr836PgNyIhFkAOhUrecRad3imfiUZwHB1O/SuC1GXyUSB3RkRf5m2SAozdb19+tYXZieJTs68nM2E5FnkKRwKRnjD36S0amuPddbKu8PaiCdh3CUTi1p/mAqMQpwVV6eGCps2lHQoldBKwpJMivYH3yQpVcq2Dxtc/qnciHsYCtdDYazSU43jB1bqz5pruMkrrFr2CVN5j9OAQDQjcpS/1rjU7GIeeHq/wsgTmA3LgiYBHhqVTKMxa69CffYfjs4Zsyl7TMW9LVGADAR8h0AhW8py4+aNfTBHgJmimgyxTCJa11KI/yWd3q1B+gb7sANTQ82mC53V17S8vf/v+iX8nH9TbSWLR05KFplps+L2e8Wp1GFz5lTIi5L4Gos2ATnZ1OB06VM3u3BZoeUDxy3gbX9cldVewRzgcOuDIH/3XXVmJrIclLW0RYdgr00yjZy4XN+tkECUr3QbmnGLOGWzrXhjx7/PucQ/GHItYPIJkXEUKHulLqVMvK/XUMbe3F6y9ma4yATA0ovU+jcC8Iqt5hpgUUZFMaAP2+h1QM8hirjK9I3pM8xGQn95CB2vzv6S1lg1in8DlI8OyLQgCRYFSduo10Mdt3mlWjshWmhnzAu7pL7a6A1+zS90ScZ/cSTm2njG1E9plTkHP2I0BUM8pJTlkfQOA+c4gocV/+ZsSfT+jrdNA912UDnpDJ1lkategD8NYjPnNe7zpavfM6+5aBT990Sx83y4Jiu5rJ+tIaJvprb+MQEKIPzeT2W6cebHLPIYZ23ByaZuVGHWEuFScKbQ8/o+EpDOYzkCbKQcZGpzkxl+auXE0O/3uUSpWNq21oFNTBeh7xZ0oLWwgfT+FzmUxOKdhW3DLdgike+qjd4BbkEZBlKHPfhFGg0pz2pCbinjU10wssAqgdXmwKIcQsE8rGQ+qpog+M adXluenz ITWVkQAiSrXdJm3UVSdNZ/PZjakdulGMdoWpcaAqCZbGHPqInvfTGNAoL/Bpa07CS67pKVv/ps2cMUytIFfEZBukAyYo4S3c6xiJDK5AabyTQzrutb6VsSh3B7JQ4RSMikoZ35InjkH0M0tafj8ai2Q7BVaC6G3qBFfyrmSz3ZnfL+71UCn4iu9dB/Lj0UqHyIJJFyirLI/574OCYWoM5mBBr3R4Kp96XnpqvOPmo6kLerPEDueDlA6GLE9a74cC25DxaDeVbF4uHdLZ8GM+ILIKdVNyZol6XAy4Cibvzb/AGu7+mOcxuC8DNQYjETVKKaPtta+A5NBJEVqQ97qHbBYJJbgBFwztQtduIsbA4NiiVu94= X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Added update_mmu_tlb_range function, we can batch update tlb of an address range. Signed-off-by: Bang Li --- arch/loongarch/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/loongarch/include/asm/pgtable.h b/arch/loongarch/include/asm/pgtable.h index af3acdf3481a..5ccc2a3a6f7a 100644 --- a/arch/loongarch/include/asm/pgtable.h +++ b/arch/loongarch/include/asm/pgtable.h @@ -469,6 +469,8 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, #define __HAVE_ARCH_UPDATE_MMU_TLB #define update_mmu_tlb update_mmu_cache +#define update_mmu_tlb_range(vma, addr, ptep, nr) \ + update_mmu_cache_range(NULL, vma, addr, ptep, nr) static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) From patchwork Mon Apr 29 10:33:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646588 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 A8FE4C4345F for ; Mon, 29 Apr 2024 10:36:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EA8226B0085; Mon, 29 Apr 2024 06:36:00 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E55D96B0087; Mon, 29 Apr 2024 06:36:00 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CCF636B0088; Mon, 29 Apr 2024 06:36:00 -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 A83A36B0085 for ; Mon, 29 Apr 2024 06:36:00 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 4B2AE1C20B0 for ; Mon, 29 Apr 2024 10:36:00 +0000 (UTC) X-FDA: 82062214080.13.5A94019 Received: from out0-220.mail.aliyun.com (out0-220.mail.aliyun.com [140.205.0.220]) by imf14.hostedemail.com (Postfix) with ESMTP id 30C05100009 for ; Mon, 29 Apr 2024 10:35:57 +0000 (UTC) Authentication-Results: imf14.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=o5mE9Ja5; spf=pass (imf14.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.220 as permitted sender) smtp.mailfrom=libang.li@antgroup.com; dmarc=pass (policy=quarantine) header.from=antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714386958; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Zpq+IlpQptIiF+1qadAYLdyILX4yq5vgiQqk5YenteU=; b=q3Ck6LWwa8UpugI88pljHU6kunP+KxG569beL/xeUw5op90X8fye/DayMJFkHJPoxsCW1s bDQnxoKs1xU7r3UYM9TF5kGDxFC/yb7UlafTwj+8xxo3McXHFsNJKJaCf8RvlSuK5TR0Tq kMlAfx2PSaz32/F9buDHPk0G9ux3djM= ARC-Authentication-Results: i=1; imf14.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=o5mE9Ja5; spf=pass (imf14.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.220 as permitted sender) smtp.mailfrom=libang.li@antgroup.com; dmarc=pass (policy=quarantine) header.from=antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714386958; a=rsa-sha256; cv=none; b=UG4ZjE+Duc9Ua4Op23HWzwgRohmZEoJqGBmsvRGf9ecpn2wOYnEC76XjI+aGzah1TVbd+q vqIY9H+ikcB/Xk8aEkajJWXaTI4pwASLbS/v6Er71Vew0rzZFi69UT/6xmzC/8196JpMf4 JAwRTRHbtfc68xOggVFdqn8cwcuiyzY= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386955; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=Zpq+IlpQptIiF+1qadAYLdyILX4yq5vgiQqk5YenteU=; b=o5mE9Ja5J3pN0Bi+4o5rFp/KlRDFTPRc2br4GicCbAnaBGcavythIG3HPOGXZvB43DFDesx1sU6A22DQzpfGHj7MCunO1DWh7hlqO425wBInVf1kCaumJVPQvByUqLXQjUobhWlSojlM4rcr3luE1NuYa7uO+t0Rx/9zAa5adgE= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R171e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047205;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---.XOFQRPj_1714386953; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOFQRPj_1714386953) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:54 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , , "Bang Li" Subject: [PATCH v1 2/5] mips: Add update_mmu_tlb_range() Date: Mon, 29 Apr 2024 18:33:43 +0800 Message-Id: <20240429103346.59115-3-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240429103346.59115-1-libang.li@antgroup.com> References: <20240429103346.59115-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Stat-Signature: rpox4dumwgrkkesac3p4q8qjmhs59cfp X-Rspam-User: X-Rspamd-Queue-Id: 30C05100009 X-Rspamd-Server: rspam05 X-HE-Tag: 1714386957-342278 X-HE-Meta: U2FsdGVkX18YDeSKm1mWtyzlLMb05AsyIJPSONmKau97z8uct9CX75nC2kUdiqtZxSBuy8nUxPDEAMpayrxwVzytVF7uAI4u9HCKXjbR5MDX/5lkNza5CEzmGbxTpcgyF20bctqmsetE85I4Wjlddq34rN/foq8GguQxG6+mHUtQWOdD7QN4AO2O7NUcrpJ794jvjf9xh1y4k8K/XPb3KLKYywiogXQW92lT2MtzeO5ka+pU9OAY7awbGXeZ35pUZa7eB6fH9YVrHXt+olhppTuOm5cWB84wD1q2VoEsvroEcws2IrdtT0cem+PTd3qrNF21YmsT7qHZyhA3WFDyk/uSiFk6s3r7aWAOgcfrMJrtp6ITosnGlT9dqjsmVsJ+6PGA8oIOmM0cCxYOCox16RVf0+9NkStB1FWz7PClMfqmf4mEDdKH2kpSy3algx/sgG3b1bOGYcaJ8JZtyJ8RhwrfpgBfYUXHfUhHDIURG12TnWTYM25Xyf3jrGOcqAlNskFZpXr3jVXzN0uiw6ZkQbDOlPu2SVH+3HijpNQ9iOUywANlCVeDmFOeJstIutk0ZUX4gACL1oOH4Rvn2OxTDiyQiKsbEoEybTOmnx8EJOn5u3z30BcruVR53CVUQN6i7Oxp7IzfBQobo/Sb0/sEeNTvdGeaatEK/XREH2dIj5tnsIqYrtNdnsHIZqT2HaVU6YWAKhnevM8IDVngMNNSrdSo7rQBlzQ7Csbx47avwYdzvpoTyWue5H+8CurfU7AuvwMMX3QpOlirW1GuRBUU4FCsmd2XiDaFaF8YxoUG1KtNayy+CglPD7RKFS5eTfzPfnH3kFcpYn9i1Yxu3S+oXU6rRrSdmHoVOiBh/Rv2uM2hCTfrpEVsWhQwm0azdwmzo7OKu8PZw/80SbC/C4rcct4ngsNtI2ypUITI3m4oG02tF5y9k27G8CXpzRChCTC905up9HNqCV+7XabByRA 0OC8BOj3 Oa0boY4XrFWSqsSmt4mhbxZi0v5uzlQrtLZ4d4V03NYxqO7jiTeFsjhKpWRozXZ/V6CG5UV9poucg+yZRoyRsc/nAPqzsTXPpb3n/fR/+DlphzaFCBQBFOlrsiFBIr7vmAZQ/jooZz2DKTo15BSG1FPUYyHxSIYGMq1PuYA3T2hHL3DPDZ9y3BEzcmEYEniLa3Tjbr6hHgIGHccsrNbXy7F1aspcMWUui0JedDakypyGfTPZiaCTi45nURiCLPNoFOk7Xx2MriyXnr3U9PcfB7hE/gFuia4RBzMpAy38ENKLfDC4vI0MnJU76bI5T/97GQgz/eXqgZ6r0bEe1Tofm5lqwK+EOEVg5JwYX/UjsIBeh78otwmfURSbMcg== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000449, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Added update_mmu_tlb_range function, we can batch update tlb of an address range. Signed-off-by: Bang Li --- arch/mips/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/mips/include/asm/pgtable.h b/arch/mips/include/asm/pgtable.h index e27a4c83c548..0891ad7d43b6 100644 --- a/arch/mips/include/asm/pgtable.h +++ b/arch/mips/include/asm/pgtable.h @@ -596,6 +596,8 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, #define __HAVE_ARCH_UPDATE_MMU_TLB #define update_mmu_tlb update_mmu_cache +#define update_mmu_tlb_range(vma, address, ptep, nr) \ + update_mmu_cache_range(NULL, vma, address, ptep, nr) static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) From patchwork Mon Apr 29 10:33:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646589 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 262F6C4345F for ; Mon, 29 Apr 2024 10:36:08 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2E5FE6B0088; Mon, 29 Apr 2024 06:36:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 295C86B0089; Mon, 29 Apr 2024 06:36:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1106D6B008A; Mon, 29 Apr 2024 06:36:02 -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 E2D8C6B0088 for ; Mon, 29 Apr 2024 06:36:01 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id A0239140F7A for ; Mon, 29 Apr 2024 10:36:01 +0000 (UTC) X-FDA: 82062214122.07.84F4C68 Received: from out0-215.mail.aliyun.com (out0-215.mail.aliyun.com [140.205.0.215]) by imf13.hostedemail.com (Postfix) with ESMTP id 6EAA32001B for ; Mon, 29 Apr 2024 10:35:59 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=ibFPlMLI; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf13.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.215 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714386959; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=Wijyh1yP2Yf03/VPvTBn+/oZ8/jA626iTOgm2E3/T4s=; b=OQT6ooQm5sOWxf+5AFp5EQhIpiznDNBF4wpzKa/Uj/0b1FQ+V8fnRfUfFEGfl8WbFbuNGg PlZ6UdjC6m4IKfdbGnP2WVW3Y1+FcNhuXTNUKbRFgyCEuZPO0H1pbbETKW+GCfD7TVEJU2 kMRlT0swU8n1hQQKVKCvCGN54vttZew= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=ibFPlMLI; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf13.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.215 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714386959; a=rsa-sha256; cv=none; b=vUom93NhJXDzX/+qyGSaqpeQxD6JiBCEwdVwb880U6fn7rulJajyLqXoNb2YQnksttq1Se YS3ljutTCJHHTlwwzsMgE7kEBz6tewResm0MliQ0Jb/gyx9V78clZ3rIWL+SvkiepQvZfb jE6IzXF3F7ylGxdeuefszG62uFkugsU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386956; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=Wijyh1yP2Yf03/VPvTBn+/oZ8/jA626iTOgm2E3/T4s=; b=ibFPlMLIxO/WKit3I9vkg1+KEIajyOp6Xtr/aCqXjx1q/6k6jMkiQAc80fRe47229yKc1xdMm9t4dPvWFifVWMCEnEtTVKVb4WlA/iRUjsuYyJLHaTL3YrlaNMPQyzK+nlz1gbNR0bK63DPc+ORxfLpBn0fuDhuglt/2BZTWo80= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047193;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---.XOFQRQ6_1714386955; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOFQRQ6_1714386955) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:55 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , , "Bang Li" Subject: [PATCH v1 3/5] riscv: Add update_mmu_tlb_range() Date: Mon, 29 Apr 2024 18:33:44 +0800 Message-Id: <20240429103346.59115-4-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240429103346.59115-1-libang.li@antgroup.com> References: <20240429103346.59115-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Stat-Signature: xr3gyikzcgza3op8r5tdemizrg8wrfd3 X-Rspam-User: X-Rspamd-Queue-Id: 6EAA32001B X-HE-Tag: 1714386959-497345 X-HE-Meta: U2FsdGVkX1+h/uWNNTj1lVFNr3GCEE+Euw/3PUXkw1asnDarOKFlKmXMi5+KSL1H2It1nAmStP1IBZX/Ob3eokI+HZVDa2pI8Ohx+VLrQ6r6D4bABBII5bP6HtlvHgjnJmFCA45+bBEsP2nyfowaxKYbEqGqnufnTQULFEI6DTnf85ohsgilhDqpHmL4zPncNV7aGapAjV0FA6CDLffFaHsXBhuEapFubw5+PHf2Y8qQXjkv7EM/d3huwULVNP6uVw3Awrli6ENdpsNwCgB8ILId2myjbAsN0FHGgSH3Ts+saMcu1Wp46gxBeFtWRVohokh2gjwymrprPrV1n0oPRS1Ufbl+2KpddRlpzQGqtbRhTwPZOvkPyWQOSxvS1bIx6yGn8Cey1q9x0fJLlj5dfNTvRzdgQjX3SpXyxd/CdjLOzNnffTenU4eFelGtdOuDIFPCAAZwwczX4mNu5HMmcEuiReaZH+vz3d7YK7eUrrIgBrHDsA35dPC7V+k6rgi/8do09tQlsK8yMsZed3VMTp5r3R1dAISqzxdPIEDDAVWHk9dmsMtu+GKgK/sFLbDSIbNWCno4uewmGttG3s7c4G9tFI992BIjP7d5EsMRMpsmgAHbama3A7/sNSBCTNcKImU7Qt0So92Lod1Tv5WyVOBmFdvWC5TsKqeiTHfzhAXmTYjpgR+6GxNMJx4ly43IbP1I7AhjSaKpfN/mw34fPOdHPOsk5jnNEn7XxTJ22NjM08CkAT6dbIfAEjhLdxcahHnRlW9ieM6s9nLKAplokupia3IOvhd9zVme423sWGAOx2RQrLGkWrtsIgVBPgJ3eaSdMlipUXNlQ9Tz6lthStSJEcEbdMvwYiu4U+HxEPZH2tl/1xGDMdaOcfsZEzXsKSnkxiS/z54KLAyb9d+juF7oRfFclFkf6hXOTj1PZ45stJ0mQ9S+Zv+e5sIw5TLX8pvyz1M8/ZB//eqDzmN Lxoo1cmZ oQDqmdHFA4SSle8j+M7fP+a+lQ/WlyiIBy8phR2qQSk4WrYvtvF/yHbd3sQ== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000022, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: Added update_mmu_tlb_range function, we can batch update tlb of an address range. Signed-off-by: Bang Li --- arch/riscv/include/asm/pgtable.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h index f2d5973a011b..d515a11a52cd 100644 --- a/arch/riscv/include/asm/pgtable.h +++ b/arch/riscv/include/asm/pgtable.h @@ -488,6 +488,8 @@ static inline void update_mmu_cache_range(struct vm_fault *vmf, #define __HAVE_ARCH_UPDATE_MMU_TLB #define update_mmu_tlb update_mmu_cache +#define update_mmu_tlb_range(vma, addr, ptep, nr) \ + update_mmu_cache_range(NULL, vma, addr, ptep, nr) static inline void update_mmu_cache_pmd(struct vm_area_struct *vma, unsigned long address, pmd_t *pmdp) From patchwork Mon Apr 29 10:33:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646590 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 D2637C4345F for ; Mon, 29 Apr 2024 10:36:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7045A6B0089; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 669186B008A; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 494156B008C; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 1EEB86B0089 for ; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 93571C19B4 for ; Mon, 29 Apr 2024 10:36:04 +0000 (UTC) X-FDA: 82062214248.16.6AA0DA7 Received: from out0-201.mail.aliyun.com (out0-201.mail.aliyun.com [140.205.0.201]) by imf19.hostedemail.com (Postfix) with ESMTP id 90F931A000B for ; Mon, 29 Apr 2024 10:36:01 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=hQRNZFKo; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf19.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.201 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714386962; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=L9Nnq3jHrztC2V1l+aPsgS97TA5W6U5sPTcwdSCKib4=; b=3zSgppFIWCMpCiabcFzy6nudCJ4DCUBgWibhHORt8WWzVTlUqWK1b1PBLWumejQmNA1JDR JMUAmD3SSH3eufpxpRClgQlUPUIt0bmCDpOYsZmLDp9Kf/cyOsU5lpwDps2MFc4yuel4DB w9FSQcuE7WmWNuoqmTULk/IEuvC90Qo= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=hQRNZFKo; dmarc=pass (policy=quarantine) header.from=antgroup.com; spf=pass (imf19.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.201 as permitted sender) smtp.mailfrom=libang.li@antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714386962; a=rsa-sha256; cv=none; b=0tsPSDBXj3kMmN9z2p5Hf1e8T0+BcmzhHY6gZB/Mk8J5Cs0JPxaJuDeoXPCkT/iW+++A0d 4j5RmfEfprgR/aakH2rwLTFU1mjN7s2Bk2QOG5+9Q65kSnFu5oTNZ5Q1u957N3fXjP1UT0 GsSBAd2xYxPZB2l2zvR+eAxhV0+uBdM= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386958; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=L9Nnq3jHrztC2V1l+aPsgS97TA5W6U5sPTcwdSCKib4=; b=hQRNZFKoJR/Z6J/Mdjz/Rrc9wQNL40mP544JZi0WALMiuztrxwSk1dFqXvJAwaSMEccrE6bUsigtJFDjuiAHW8rxrtMjGCE1VUj2EAI6oWMIAf65hhwy9BocdI5bYn1D/FqrZvfd2wDHdULwl2LtfZXW8wQF/ZM2aXgSHix13kg= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R831e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047207;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---.XOEanMa_1714386956; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOEanMa_1714386956) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:57 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , , "Bang Li" Subject: [PATCH v1 4/5] xtensa: Add update_mmu_tlb_range() Date: Mon, 29 Apr 2024 18:33:45 +0800 Message-Id: <20240429103346.59115-5-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240429103346.59115-1-libang.li@antgroup.com> References: <20240429103346.59115-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 90F931A000B X-Stat-Signature: gpt8kxbjusmhkmg3uy5hxitmwgyp1gqq X-HE-Tag: 1714386961-379805 X-HE-Meta: U2FsdGVkX1/fxHAsPcMvz5+ymaFRNUEv8iIXpalqO/guRmR0Tco4jNVcQE09dAYuE12F3ah+KtQ0av5b0isJJFoPEO1/2pbXMNbPNHwQs5AUqU73cvm+hYs3DeWf1iLyv0reJNEfRvGVPYo/pe1GRuHGAvsc75oqipBQSkVbf20j6cxWhs/NT0eTmfAYJfPcK55tB12MYNsjY8jRE27z5uBlx7yDh1qOaKXhueToJ/5KBbyZkCHejT+i6iI8UzU48wsbAIZW6S8/gFZK2Tm1BMtvx5f3tI3l/S5Z8toN308AmN9lPA5NHvRhv3/gnVv6fQhy0Nqbb1fdxbNSf0UWVU+kQKreb/PUR6yRyO+hqjTv9GugDlZaECG9wZLK3gr4vGCiLAE7mX+FbFqQXBNrwkhi6t0nYwFAr9WC5wZxYlbUr1qhsy4ESRowzH/GJ/lkXELyx8SjZpsrcu+/urahkAKcVWNPS1f6BM4RoCJShr5UOiFMt1EJSaCeQzqn5ad8xo0LpwuZf7jTdl4ftmqiV/eciNLxGDQok7N4qY+wkaSEReO72SzGBigbyZhgM3kqrm54jTD+icOZ0r3+u/dDjCiMpnGHbM05ncJweKss1e0/AHf21wRzSe3oFESqTDddx0IgppHApIgeoNFkqzxpAlbN3TtnOQmAG3r3f6e50EbrpqiEC0WcoPG/CpUSMRSSqBW84/ouU8U3ybUSOi2agrGVUZ4VzG/wbHklknuYBWZicT/1C/YuIPraiqAHTSLY0j3r8DNZAT0ZMjvXepTmu4niLkKehG/J3FF525KViEY4Bs8Qc4YPQsH+3ADJ2+8DsmIuRB8iHHpBNtepCgRjsDiKqlct1XrCu1dofKdEshzSAdX8Mq78IIr3XqzisEoF5gZM0nQ0LfipMceR22FscHabPAcLSOOjwu4ShGCLdLa+W/NGN6VJ4zD5+2bnQGDFRGRsucnN+Na8yloE4d9 Ic3dunF2 mSXU7ttO8Qh5o1rv5XQIxgSNzwCAI5dpnKBCpv7oKftKxYaCUxJDCf79J0ISP0sVny00YZZJDGq3LDPTGaapx9T/o2uNEQHrd4QgEYEkOI6ZWYNtALNtXaW+byQiVWbJDT1CBZ/s9e+up0fPSYg7CFQhrMR7l9Che6NId5KJSn+q5RNPOUU9v4iN1HE+YPY/mCj6BDGHKLYHMtiMJ1Mwf/caOTcPCbtdCtJqNRke8JiVrqypchN7ckG+4k6VJVnGG9G6r0Mpbw4jw3ATE8Fmb8e6A1lCMBQ7IdYUVATi32h4QdCxJXKeM7+xy1VwNNH2IPGCSV4jT8XqBG0a6OxijE74Kcws2P+mHky1VZNDAesuMvto= 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: List-Subscribe: List-Unsubscribe: Added update_mmu_tlb_range function, we can batch update tlb of an address range. Signed-off-by: Bang Li --- arch/xtensa/include/asm/pgtable.h | 2 ++ arch/xtensa/mm/tlb.c | 6 ++++++ 2 files changed, 8 insertions(+) diff --git a/arch/xtensa/include/asm/pgtable.h b/arch/xtensa/include/asm/pgtable.h index 9a7e5e57ee9a..50ccfc988256 100644 --- a/arch/xtensa/include/asm/pgtable.h +++ b/arch/xtensa/include/asm/pgtable.h @@ -412,6 +412,8 @@ typedef pte_t *pte_addr_t; void update_mmu_tlb(struct vm_area_struct *vma, unsigned long address, pte_t *ptep); +void update_mmu_tlb_range(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep, unsigned int nr); #define __HAVE_ARCH_UPDATE_MMU_TLB #endif /* !defined (__ASSEMBLY__) */ diff --git a/arch/xtensa/mm/tlb.c b/arch/xtensa/mm/tlb.c index d8b60d6e50a8..05efba86b870 100644 --- a/arch/xtensa/mm/tlb.c +++ b/arch/xtensa/mm/tlb.c @@ -169,6 +169,12 @@ void update_mmu_tlb(struct vm_area_struct *vma, local_flush_tlb_page(vma, address); } +void update_mmu_tlb_range(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep, unsigned int nr) +{ + local_flush_tlb_range(vma, address, address + PAGE_SIZE * nr); +} + #ifdef CONFIG_DEBUG_TLB_SANITY static unsigned get_pte_for_vaddr(unsigned vaddr) From patchwork Mon Apr 29 10:33:46 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646591 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 0C0E5C4345F for ; Mon, 29 Apr 2024 10:36:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F1B306B008C; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E55066B0092; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CA8216B0093; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id AA8236B008C for ; Mon, 29 Apr 2024 06:36:05 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id 4978240B55 for ; Mon, 29 Apr 2024 10:36:05 +0000 (UTC) X-FDA: 82062214290.18.CC9AD04 Received: from out0-221.mail.aliyun.com (out0-221.mail.aliyun.com [140.205.0.221]) by imf25.hostedemail.com (Postfix) with ESMTP id 30CD7A0012 for ; Mon, 29 Apr 2024 10:36:02 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=YOwVAoZk; spf=pass (imf25.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.221 as permitted sender) smtp.mailfrom=libang.li@antgroup.com; dmarc=pass (policy=quarantine) header.from=antgroup.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714386963; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MCByWayo1rTtWGbtdA4qwJOFgDYVs7q3tTYHIInGmHY=; b=X0zuvuXREiAAo77TmQuc6USRGBEtGKR7NoL/qiMIlud1ueOKA+3t/xcfd+TSWbRP79vOlD bHB16COJKcS/M3jZ0IS+o0ta9+O3gMi/AxfruZNFC4eZh84r6riYP73CwisdUXtExBIDkx DspAV22/4ImhkmsjJkF1K891t+QkPGc= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=YOwVAoZk; spf=pass (imf25.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.221 as permitted sender) smtp.mailfrom=libang.li@antgroup.com; dmarc=pass (policy=quarantine) header.from=antgroup.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714386963; a=rsa-sha256; cv=none; b=WLXna4iu+ROJWr0FCtTS6EOA3f70EHq+HbOtohZwxzLrIQ9OkeDlVQhomqQIEb+2RTK9nc Nv2u0xL42T2ROSBNXSxOZWualuwEoVFKKH/kH9s4+YNI9oEmPUuh+wp0epUKq2C6a7BDIy 9GBGKkjXMEXWkzvLieMsqdQckx2FC1k= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386960; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=MCByWayo1rTtWGbtdA4qwJOFgDYVs7q3tTYHIInGmHY=; b=YOwVAoZk8FqMSrg8/9ps1rdKpTCIBOfsvyANgI3kLYOVTsvcYX7glFlsHS8M9hqn6NOyXE6+H9eCI4aEqGZH76h3zDuxSTkI/Rl2/yA56vfx+h+sfA1zCcbCvvXLJgQ6N99votAuMlSHmBy9gL3zl6kd4v4+YbPtoGeWyHWKg1o= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018047192;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=17;SR=0;TI=SMTPD_---.XOEanMm_1714386958; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOEanMm_1714386958) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:59 +0800 From: "Bang Li" To: akpm@linux-foundation.org, chenhuacai@kernel.org, tsbogend@alpha.franken.de, paul.walmsley@sifive.com, palmer@dabbelt.com, chris@zankel.net, jcmvbkbc@gmail.com Cc: , , , , , , , , , "Bang Li" Subject: [PATCH v1 5/5] mm: Add update_mmu_tlb_range() Date: Mon, 29 Apr 2024 18:33:46 +0800 Message-Id: <20240429103346.59115-6-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b In-Reply-To: <20240429103346.59115-1-libang.li@antgroup.com> References: <20240429103346.59115-1-libang.li@antgroup.com> MIME-Version: 1.0 X-Stat-Signature: k518o1wamqhipk1jctnuowo69tzukcp5 X-Rspam-User: X-Rspamd-Queue-Id: 30CD7A0012 X-Rspamd-Server: rspam05 X-HE-Tag: 1714386962-713004 X-HE-Meta: U2FsdGVkX19IYVdWmQk7/CJiizM36PFk/ZR/vMIxeONtquAyQlJw7k3d33cKrexDYd0T4WehDhrSMLFaQdzS9ZOn+EnMex2wcUPRM4WsenM865HuMjj/o3Ghq2R9pU0Ul2Rs4hcb7XzcgyYhIJN4fSCfz7x75pE0uqCqHu80FnR1jIbV36kNmXfrJ/BqynG/0XJTBYhAJLbZlo+CGjv9WlBDrWod1IovDKSLAIH//OIUPd4R1S6ycuZD6P+d8RIVOmHlKQgTNq3L0PJsmlsUbVEU4pC0WQnljTcfFNs2DWuEuF4ZDKTk/RKy2XCNyWSnhZGsvsFECr9Fhb2yXZsFJ3vvAK8q/jVVl6kiOmEYQ6x9S4tQzoAT+26xIQldKPGPdUDN+1ch4gRWM7G902k2X9/67Cd53Nkruh0qWjuv5sE34L9ydWLE8E8KL0uAWFcsOJMZmkVh/H8pg7PKwuvNmwgZ4AQxgDRhfzGch5GezSw/Bo2qVhBbA8VPRuU0eF4ZyLpiNz95ynEjZuo1c6cy4URZDVboaKlhnfY4gJ1OQYwf6k5YwC07p2j+q15XYHrzdCWSNmuNClPFvJpMmkEcTGsfe8LuhHhst73MV3dIusenG1jPbuxyZGAyMEooTxe2j7PW4PJ0vF7mKi2jk30qegVrsneTNhle9EWtKVDpBWsUUvohvX7thpwJRoZRaXofLsfSK/H2zYkjyxTpIGm5bbnXQuleZyqGil+GKQFjeR6mMmMJDZddERIexxx1j028Cp2qfjwkckto24qaBns7vbyUqX83UdtKeq5h1LAorWsikT1rzewCjjiw7vvtggGUIFYy5QHJFfotDNgIwqHn+bDrJ3wdmBRi0Xrn9bXP8lYQny7Hl5RyZPmRdcDXVVa8DleRvnG1Jcq5YEShnNbXEy72eneTAC+tZyWDG3bu1BIHdAcXUMHjmBCXErcAfSRv1fthaUyG2iZu1w3ialf 3h7q0/ST 8Va5+LTOxBT5RN1boBDnfch9M8ONrXP1NE558+2HBRxd5kAkpOrDDLytLWWIdF2rVWJ1e2xZxOHlksFVkhFc+j8lOZ3khNtpR6XqkpXsyRNdawuo6qWFz7avvhxXR4TgufD98cWP8Gh0bNx7mTfpR57AYOjY/+6rPN3kT4XzUtJw7i8iyqccT0fWXv1YxfvUQppZjgxD8Md1HDJdHVPvDpJwPr6pomNSoN8ZJ5r/6qjqQ/vLwAeF4vN+Oh+jWtwcQ61gQySdEnI+hiefjIw7+yMkLs3o2KFF8v2OFWqChEZ1Jyo5Z5i9AlKB4WsqSyvv2KN1YIrQkBtRMnfJeewBNlKyA2pU1YpA0P0t8MmXzDVy/5qi/ZFpuCoGiMg== 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: List-Subscribe: List-Unsubscribe: After the commit 19eaf44954df ("mm: thp: support allocation of anonymous multi-size THP"), it may need to batch update tlb of an address range through the update_mmu_tlb function. We can simplify this operation by adding the update_mmu_tlb_range function, which may also reduce the execution of some unnecessary code in some architectures. Signed-off-by: Bang Li --- include/linux/pgtable.h | 5 +++++ mm/memory.c | 4 +--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/include/linux/pgtable.h b/include/linux/pgtable.h index 18019f037bae..73411dfebf7a 100644 --- a/include/linux/pgtable.h +++ b/include/linux/pgtable.h @@ -734,6 +734,11 @@ static inline void update_mmu_tlb(struct vm_area_struct *vma, unsigned long address, pte_t *ptep) { } + +static inline void update_mmu_tlb_range(struct vm_area_struct *vma, + unsigned long address, pte_t *ptep, unsigned int nr) +{ +} #define __HAVE_ARCH_UPDATE_MMU_TLB #endif diff --git a/mm/memory.c b/mm/memory.c index 6647685fd3c4..1f0ca362b82a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -4396,7 +4396,6 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) vm_fault_t ret = 0; int nr_pages = 1; pte_t entry; - int i; /* File mapping without ->vm_ops ? */ if (vma->vm_flags & VM_SHARED) @@ -4465,8 +4464,7 @@ static vm_fault_t do_anonymous_page(struct vm_fault *vmf) update_mmu_tlb(vma, addr, vmf->pte); goto release; } else if (nr_pages > 1 && !pte_range_none(vmf->pte, nr_pages)) { - for (i = 0; i < nr_pages; i++) - update_mmu_tlb(vma, addr + PAGE_SIZE * i, vmf->pte + i); + update_mmu_tlb_range(vma, addr, vmf->pte, nr_pages); goto release; }