From patchwork Mon Apr 29 10:33:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bang Li X-Patchwork-Id: 13646586 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 22B6AC4345F for ; Mon, 29 Apr 2024 10:35:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 26FFF6B007B; Mon, 29 Apr 2024 06:35:59 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 220246B0083; 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 10EB46B0085; Mon, 29 Apr 2024 06:35:59 -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 E7B436B007B for ; Mon, 29 Apr 2024 06:35:58 -0400 (EDT) Received: from smtpin10.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 3F77B1A1955 for ; Mon, 29 Apr 2024 10:35:58 +0000 (UTC) X-FDA: 82062213996.10.2699E3D Received: from out0-218.mail.aliyun.com (out0-218.mail.aliyun.com [140.205.0.218]) by imf24.hostedemail.com (Postfix) with ESMTP id 6D9F618001E for ; Mon, 29 Apr 2024 10:35:55 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=ArUfwr12; spf=pass (imf24.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.218 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=1714386956; 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:references:dkim-signature; bh=dLJfLm6QSven/Kk0xr1PvysR3nscl1fg/cBxpNWoFzo=; b=HMzIT4hO4DWfuoQVBlp/gF4j+SYfyi5LUUfFXnkKUx5/OnntCbmCnKaL4RSPY2p+z9BfJi Ss979+ewHfdgJwFQ2QYXtZe6wz1KKTWwz7nZXKRP87Lnv47LUssxKW+LjPs/UXoz6asgDN YZD4XM/jCu9zhMQJC6gjy4ucj60zSpY= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=antgroup.com header.s=default header.b=ArUfwr12; spf=pass (imf24.hostedemail.com: domain of libang.li@antgroup.com designates 140.205.0.218 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=1714386956; a=rsa-sha256; cv=none; b=hYcraqK6121Uan+XHLggYFAFR6dl5Aah8rJw2K4kIXY3e2ngRilRV2XLNx2CEFnlLfKDf2 vBRVVFC/FmF8xrqAhA/ZRaUW34EGqffj/P6QRGjmoh/dGainLxTLogGm3MRbKyopyclaEC ZaUrEQh9MvLI0iu184UbitwTWX2rLgc= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1714386952; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=dLJfLm6QSven/Kk0xr1PvysR3nscl1fg/cBxpNWoFzo=; b=ArUfwr12m/13gjqdD/r0ZIsihv3TfM1SvtZhKzqB8oLUrgM+MhPWy/epJvVljTPbBazl7oTiWTXQVTASw8ZDs4B82BAUPaAsWC3jAAeNySLZoftkYm60t2tl5sDU/DG+1dp9xRsRyP2joXspahbGuXrjsXOgzYSdV0nJP74C7bw= X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R151e4;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_---.XOFewr4_1714386949; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.XOFewr4_1714386949) by smtp.aliyun-inc.com; Mon, 29 Apr 2024 18:35:50 +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 0/5] Add update_mmu_tlb_range() to simplify code Date: Mon, 29 Apr 2024 18:33:41 +0800 Message-Id: <20240429103346.59115-1-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 X-Stat-Signature: gx7xzji461nigo1ja9fpmkw74ezox9qn X-Rspam-User: X-Rspamd-Queue-Id: 6D9F618001E X-Rspamd-Server: rspam05 X-HE-Tag: 1714386955-884263 X-HE-Meta: U2FsdGVkX19/6WWqjWl0aY5GA4bYvgrM/e1twYLRUb8zqqmU+sGNOj8jhQMEodcHCRZmhpNcXU78KMArdv6SUQNrr/8b1mTSyQj+G0wzOJ2In9Vu1DhRT/qENnXCafZDPh6Ipxj2KJcVxTN6jtrOziVk92qDWuEGZpNUq8fQAAbHXx8N7jVJs5REHi+hrPOwLks6uezGqaa5JrFqNPl7EvGHVLMNizmSy6o6EfsXDWEseZCQ2hQU04iahDNoX2ypL1Kvo1cZJKZNujcPz4rtTENPH/g/RSeLqVMkvPueXKQYNbW1ngjKfdR60igZNOITdwJQ/OeUYfhhsHfgtOoPIifOBBuhrpV9K9unXYvfjAJc9nwlPVuDYdKvMDbUyP0XuSjvJJXTHY6ohHChvdAQs+D+yNWnw7ONq3ig53dEzs3d03i3Hb6gJIF6ekq81KF0FEaLjb789mUQfRUoHVBKn+to1wsTbAmY6nXjfeKU2Uq+9pMUolFip1Mx9d63IP89t/l0d4ASOsKGzVhbRcPWxodNCOAmF73IMsLxlDC+/r5h34vT8djA+G+mNNo4ompncpbQWGIWjjQXpUHRcUqAY6k2xFg+JAi+YJZNGPfnZPIfIMFo/lCnLOb1Db/Y5Ps01H6Hd6yw6AqwjVHKA21y+hjGXIym/QXJxcA/YT7wHy9SPBTX0RKRPVKWnWz65Jy1u81XIDnI0ImFopeWllAaqu/FBmq0usCj1dlbssVN+MSSlVBFuj12idpNQCd5lLbUqxJTMdBeuO6ZoZK2oQtBfs7Rh/oNup3UhoXPHxRlr8ocekfEs4wCL037uUEsZoIJFsiKviBaWUFry1W1M1yEWnDaU1l9swxAPWgHgN9zyyQCDIbblp/YnHGFZ9CjqstR+NouSLkWPPEAZTYy0Q+HaJSha0dp6q4Ljx+uY7/zkIxmHuGpoLIrXgK48qwzWylDI7AHJduZ/LmxkIhGKRy XBqBrGS1 Su1/7gy48G/Qf4MkZNQSgXlfNLPZ05OSBwyYLt/blzq6Rp7c= X-Bogosity: Ham, tests=bogofilter, spamicity=0.002613, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: This series of commits mainly adds the update_mmu_tlb_range() to batch update tlb in an address range. After the commit 19eaf44954df ("mm: thp: support allocation of anonymous multi-size THP"), We may need to batch update tlb of a certain address range by calling update_mmu_tlb() in a loop. Using the update_mmu_tlb_range(), we can simplify the code and possibly reduce the execution of some unnecessary code in some architectures. Bang Li (5): LoongArch: Add update_mmu_tlb_range() mips: Add update_mmu_tlb_range() riscv: Add update_mmu_tlb_range() xtensa: Add update_mmu_tlb_range() mm: Add update_mmu_tlb_range() arch/loongarch/include/asm/pgtable.h | 2 ++ arch/mips/include/asm/pgtable.h | 2 ++ arch/riscv/include/asm/pgtable.h | 2 ++ arch/xtensa/include/asm/pgtable.h | 2 ++ arch/xtensa/mm/tlb.c | 6 ++++++ include/linux/pgtable.h | 5 +++++ mm/memory.c | 4 +--- 7 files changed, 20 insertions(+), 3 deletions(-)