Received: by 2002:ab2:6816:0:b0:1f9:5764:f03e with SMTP id t22csp1392122lqo; Sat, 18 May 2024 00:52:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCVkd7OjkU2oEVI1V8D9UvA4PY/RDga+TWFhyzWJw26SU1F7YC6u59f5QtMSgYENKKWYl/BQhvqOXYEwwY6Avo3K4nSYxuvh+42klmxznQ== X-Google-Smtp-Source: AGHT+IH7tchO7YHI8xn6SpvOusNyZFx6mrOjRJhV7xkO4Age8D3alB7BQN+nfG48Dz40lKFvpi9u X-Received: by 2002:a17:903:22c9:b0:1f2:f1b5:f116 with SMTP id d9443c01a7336-1f2f1b5f63fmr7815735ad.23.1716018741905; Sat, 18 May 2024 00:52:21 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1716018741; cv=pass; d=google.com; s=arc-20160816; b=CESN9W3nLEHbaABGoAXTTyPK1f9hUH1pHTGHexDyvzvzTr2HwmJVULK6jw1C22uX6N OvqOOQYPDExKRfc9UdJpYAIjUuFzMn5nK5iwqVHO35gWJIKLqjr5fUoXror32S1MU3Lc B1CjJr2GA7TkhYKM+zDzMV5Uokd3knZclgUCxdapdbJeov5m4TpLoCYzFCtBK3ifk9o/ t7iijDI8xeiOEYCC7P/8YF9wdvi5xmK9vk6hvsyW30rMW428F+i8+7dKCWBoP7E4RXWc hN2VG04FPXBbREY9m7vIHJb3JERdZPaypHMiLmd5nW7daa7NyZ3FFZgSHn9qiXIjyj70 0RnQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from:dkim-signature; bh=GQ8XlBmX7iG6Cx7KU2H5vSERCOEK8rIAF03pf3vdLkg=; fh=ZaPvTvk3greVAhtlw/faBL7y/bcze5JBULOYO1tsevI=; b=ghJNvAWHacnm/SAZz1PARPMkYdttwLP3XEcf2QQehEIs6rKyoRrVh40RXshpNciQB+ msf0zXcGhNher6rVtvkt4xwpdkVbodorW1RNKjbtZVWTkHcwYtAE8uaXZ0GJeL3qaCSJ cTd9jnHRqhf8NoZKsLipLrayWN9ZAKguMtl0X6dK2xf1kMZPUO4odV7FR4cEYLryaVCS wdzu5w9FQaYKrRMvrXeR8VV7HhHvOUlSU77Pfj1IrQhrOPhhFN8Hyqs4B1K7oTuDh8kp gypciTGI0b62KPp+HRWXquJgL1w+BEosnlmjZemPy+pGOZ/7ryl/CnWZyfOoA0XH/vec jYVw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=0dcyiLFC; arc=pass (i=1 spf=pass spfdomain=antgroup.com dkim=pass dkdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-182793-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id d9443c01a7336-1ef0c36a487si192119975ad.635.2024.05.18.00.52.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 May 2024 00:52:21 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-182793-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@antgroup.com header.s=default header.b=0dcyiLFC; arc=pass (i=1 spf=pass spfdomain=antgroup.com dkim=pass dkdomain=antgroup.com dmarc=pass fromdomain=antgroup.com); spf=pass (google.com: domain of linux-kernel+bounces-182793-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-182793-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=antgroup.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 000512830AC for ; Sat, 18 May 2024 07:52:19 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 92463D53B; Sat, 18 May 2024 07:51:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b="0dcyiLFC" Received: from out187-24.us.a.mail.aliyun.com (out187-24.us.a.mail.aliyun.com [47.90.187.24]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DCE5A101CE for ; Sat, 18 May 2024 07:51:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=47.90.187.24 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716018715; cv=none; b=kB2uFs2tX8pjXonFwR8WPjgA73SUIrnMwCoJj8EAKvh2sINCSbTtKhsfySVQVwXKy3+rhHClXayANJuOeSa+wOGIiiyo5/lP3P9Ma4NGBF+ii/ZN1ylL0CO5xuWuLYYad0Ilz9MOe+ONIuw8b6h/YHhfij0pu9FPNXw18+2r0q4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1716018715; c=relaxed/simple; bh=nifAML72DAg47mSHoyFc+yQB6k76eOuWitHSpVdE7/4=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=rmwFhCjuVevAROMM1RXcjOs/e2UBlEukRBxxS76bMZvfUzx/XemNgP9w8py5yY5ytyV5fMS+LGJCTKWEMvKs5a8CPrs1j0rGa6sG1R773l12xtMmummf9H5NYsDRa3ddLdnAPT0s6ixqneqOWc5tRSQQuHqii8FmTmT5sS6tHbM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com; spf=pass smtp.mailfrom=antgroup.com; dkim=pass (1024-bit key) header.d=antgroup.com header.i=@antgroup.com header.b=0dcyiLFC; arc=none smtp.client-ip=47.90.187.24 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=antgroup.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=antgroup.com DKIM-Signature:v=1; a=rsa-sha256; c=relaxed/relaxed; d=antgroup.com; s=default; t=1716018695; h=From:To:Subject:Date:Message-Id:MIME-Version; bh=GQ8XlBmX7iG6Cx7KU2H5vSERCOEK8rIAF03pf3vdLkg=; b=0dcyiLFC2zql6jJtan25xhQ+Z/jI7/b/bYg5dlrsMst1A9CP+QcuCju/vmSQU29Y2k3iAszzCFfsB3KUocgJMNOHM3GrJ69Rl0ti5xZOC27rLl4/cg3qb7YLpOT0qJW4kou9YRplkXunPkg/aVKxE3vpYDfLur2yu7zz2TZjfzM= X-Alimail-AntiSpam:AC=PASS;BC=-1|-1;BR=01201311R191e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=maildocker-contentspam033037067116;MF=libang.li@antgroup.com;NM=1;PH=DS;RN=16;SR=0;TI=SMTPD_---.Xg9HuaJ_1716018692; Received: from localhost(mailfrom:libang.li@antgroup.com fp:SMTPD_---.Xg9HuaJ_1716018692) by smtp.aliyun-inc.com; Sat, 18 May 2024 15:51:33 +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 v3 0/3] Add update_mmu_tlb_range() to simplify code Date: Sat, 18 May 2024 15:49:11 +0800 Message-Id: <20240518074914.52170-1-libang.li@antgroup.com> X-Mailer: git-send-email 2.19.1.6.gb485710b Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit This series of commits mainly adds the update_mmu_tlb_range() to batch update tlb in an address range and refactor the update_mmu_tlb(). 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. Thanks, Bang Changes since v2 [2]: - Use generic architecture to implement update_mmu_tlb() (per Ryan) Changes since v1 [1]: - Add __HAVE_ARCH_UPDATE_MMU_TLB_RANGE macro (per Lance Yang) [1] https://lore.kernel.org/linux-mm/20240429103346.59115-1-libang.li@antgroup.com/ [2] https://lore.kernel.org/linux-mm/20240506155120.83105-1-libang.li@antgroup.com/ Bang Li (3): mm: Add update_mmu_tlb_range() mm: Refactor update_mmu_tlb() mm: Use update_mmu_tlb_range() to simplify code arch/loongarch/include/asm/pgtable.h | 4 ++-- arch/mips/include/asm/pgtable.h | 4 ++-- arch/riscv/include/asm/pgtable.h | 4 ++-- arch/xtensa/include/asm/pgtable.h | 6 +++--- arch/xtensa/mm/tlb.c | 6 +++--- include/linux/pgtable.h | 11 ++++++++--- mm/memory.c | 4 +--- 7 files changed, 21 insertions(+), 18 deletions(-) -- 2.19.1.6.gb485710b