From patchwork Thu Jan 23 13:26:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Qi Zheng X-Patchwork-Id: 13948260 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 90D4BC02182 for ; Thu, 23 Jan 2025 13:28:24 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id DDD966B007B; Thu, 23 Jan 2025 08:28:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id D8CE46B0083; Thu, 23 Jan 2025 08:28:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C2ED26B0085; Thu, 23 Jan 2025 08:28:23 -0500 (EST) 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 A43006B007B for ; Thu, 23 Jan 2025 08:28:23 -0500 (EST) Received: from smtpin12.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 1C667141051 for ; Thu, 23 Jan 2025 13:28:23 +0000 (UTC) X-FDA: 83038795686.12.383A7FA Received: from mail-pl1-f172.google.com (mail-pl1-f172.google.com [209.85.214.172]) by imf26.hostedemail.com (Postfix) with ESMTP id 61C97140004 for ; Thu, 23 Jan 2025 13:28:20 +0000 (UTC) Authentication-Results: imf26.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=G01AvDTk; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1737638901; 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=fcMJmKKEtX+iYg+m7hTSfwAHD3Zpn1mRc3DXgtsxucU=; b=ENdSeigJHQfjbIQNozgtHUx3czmaDznW0fAq5hVDmSynZUCH2tPnwCBXrRcOMJhRBp6G7f b6M2W7mF67oXE3CE+UINqu7q/sWAh0xkdJ7P9CR8WuQOmEyzcyT8cl6H3v+5vBRZI/sGGf T9C/EGnExEGcJpOu7COaI5MUjhxyiRY= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=pass header.d=bytedance.com header.s=google header.b=G01AvDTk; spf=pass (imf26.hostedemail.com: domain of zhengqi.arch@bytedance.com designates 209.85.214.172 as permitted sender) smtp.mailfrom=zhengqi.arch@bytedance.com; dmarc=pass (policy=quarantine) header.from=bytedance.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1737638901; a=rsa-sha256; cv=none; b=flH3F2ZEyLudEsspqELLiTKc+uji9Td0L7up+oV3lpDBXcPpOWn7QpS6Q5yMVVJ/D+FNfE I8VU7F7Ebl3LRyrDMkPbV0dSINaPpz2G0yCkln8Ruoaykm4IKRCsdwW52eBsD6/iniOP/r PalDFFSWplcVsxod9mTWxDJyR55hZww= Received: by mail-pl1-f172.google.com with SMTP id d9443c01a7336-21670dce0a7so17928855ad.1 for ; Thu, 23 Jan 2025 05:28:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1737638899; x=1738243699; darn=kvack.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=fcMJmKKEtX+iYg+m7hTSfwAHD3Zpn1mRc3DXgtsxucU=; b=G01AvDTkS9UZIOR6pFGRz0DQ82Vb/CmT0Mei5ojVSiNqo6eIvS3qHjDmSOAxICkk1U 5TbR475MKMT/xVQXxSV61Q/TunvUQSzWEm12wLHJ28nQRDmfi7ARnhP4Q/lEujOhr8ZK TQok1BTTMXQ/mN16e814Xmrbj5b66rFtIMMQpnFjVucpZKzu1cfG1miwrmURlrGw3yaO iONuukVbyMd3wnEWymveDiw+mGKcI1/BQWAXPehGp2Z0Bqz+4bsjKXGVe83USuzbFG5h 3HZ0xYo7SXCQdsJCdN32iaGxX1XPAVK1G/MAaRN3Cd51no7kGrAfJz6LRDgKwLJNm5sg E0kQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737638899; x=1738243699; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=fcMJmKKEtX+iYg+m7hTSfwAHD3Zpn1mRc3DXgtsxucU=; b=MxiWsYmlr6YVd6XxuUia70zOtgDqWGhoHAuF9/Hy5DacpGciPV1BHodtibGIa6wnrB qJUbNf7XhhEgrX4pCtV9HOna/zAYEDr9Ucm6K5bdhyKPK0XF27TQdtwwveu82HT1Ke9b V7d3rYEIflD7cEqvNW82Ea1Yk9yH4QBwqTBsB0lzi6+Sv9yHJVugtfoSzNKMOIs/sBx8 jPH9cQz1CUn7vaSUD9DwVVKkIndICW6/O2OeUnj0cf9jLOab6WR58n4woSayAjRuGhCB HHIQVwf5jAMPZEKb76Khe2tYU2q9PSge6MIJXNNaq1butUzQaHbSWfQA1jUXK57Y+yb3 ddZA== X-Gm-Message-State: AOJu0YzBgDqRNSh7TOEljjwLZC0qw69UXldhkNYOPgw1ElKDKTt7HUee aVnBuXzZ+6jQuo3WTrfYGVhcVBjLElmS/VlsIG7XCpeUpQX2ugTkweuFW8KCRQ0= X-Gm-Gg: ASbGnctFk0kh2jHmbEzk1O4KQenOKCacNed5IxssN96Lbck6kTGXjK/MDAMpV0Rweju de3WnuyFUNUeLOQEe/x+tkiW8KIECm+QemcIA/zIpyBH/QFpIB/RyC+/DLLqTMD+3K0KjxBeIDs nsE2TfSXBk1XFj4scjYcdOmyozEFjRkVecGtbuGp401AzYEUdVdRwmWtmqpymY4OjZLIzfltBnn CV+wwWKSZbGmiaSKfO6ea+xIk7Kj70iC0FHkSWNC8rf2F5dcfKZ2uGTYyo+2/qRD97F6hpvfBqc 67hfjBfchX1k6thTOo7h93+ubggqk+4hrSNtkbyWtkvu X-Google-Smtp-Source: AGHT+IEganAe939WGDJlfH9nAWVZpA3TvM5SaYn7UYpmBsqsQlG5HSrZSGt5JfnUpmvzTx71ZR7Ekg== X-Received: by 2002:a17:902:f545:b0:215:6e01:ad19 with SMTP id d9443c01a7336-21c35587f37mr410676135ad.29.1737638898793; Thu, 23 Jan 2025 05:28:18 -0800 (PST) Received: from C02DW0BEMD6R.bytedance.net ([63.216.146.178]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-21c2d3ac3e2sm111583655ad.139.2025.01.23.05.28.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 23 Jan 2025 05:28:18 -0800 (PST) From: Qi Zheng To: peterz@infradead.org, kevin.brodsky@arm.com, riel@surriel.com, vishal.moola@gmail.com, david@redhat.com, jannh@google.com, hughd@google.com, willy@infradead.org, yuzhao@google.com, muchun.song@linux.dev, akpm@linux-foundation.org, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, arnd@arndb.de, dave.hansen@linux.intel.com, rppt@kernel.org, alexghiti@rivosinc.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-csky@vger.kernel.org, linux-hexagon@vger.kernel.org, loongarch@lists.linux.dev, linux-m68k@lists.linux-m68k.org, linux-mips@vger.kernel.org, linux-openrisc@vger.kernel.org, linux-sh@vger.kernel.org, linux-um@lists.infradead.org, x86@kernel.org, linux-riscv@lists.infradead.org, Qi Zheng Subject: [PATCH 0/5] remove tlb_remove_page_ptdesc() Date: Thu, 23 Jan 2025 21:26:13 +0800 Message-Id: X-Mailer: git-send-email 2.24.3 (Apple Git-128) MIME-Version: 1.0 X-Rspamd-Queue-Id: 61C97140004 X-Stat-Signature: 14muapkgz9cx3df5wzsqu7zxfnhqoc5w X-Rspamd-Server: rspam08 X-Rspam-User: X-HE-Tag: 1737638900-650842 X-HE-Meta: U2FsdGVkX18HC3fTZhI4YJDoaZllbfD/Yvb+12DPKCKr8dP2UJWvNT2vUrnHkbYiFyR2AcMSP5ClCgrjhu/Gh4MaKJ3OxvXi5Jn9pRGDey8Ymr4tG3USI+b+8dqUuMRCqdaFCS0S1BVu/B3gtqxejaXp6/onLREpmVXGGQ1UYoOfAeBArASVmMDLU/vGevWKmI7x5LpeK/+CZ9ZOc20Yl+stJXito3J1eTNf0i09LzkRcLq/p3e8qjD1fC7gYtVwxA66c4bTwd9Pnb4xIs2RWLmi8hYyrv5+PJpLP2yxdFB1GY9R0icFSkXK0F5JT0QU9nj2PnHHgDzdNhn8za4DDBWGKqLEydh9FXIW7a4VZqF0aeccifQ3LQe++0jlJX1tFqvNfwnbIILYGyPegH+rG011QuSPfLvb/29lPYsHPZSYH6Mfrp5/6HkFdmQaM6P9Kz3+1j2d5U3WkJUUpj/Ruwk4HL8ampt8+1Ss2+PkGAGkvt98aZzSjTAVoXOB/IzLt3pHSFZhdfmQTyMXIZIgR/fcZyDAKbuePh8s5EykXtCU6766vO//FvS7iBOWsZ4nnJAMcQ5YIVrBoQ+ZbY3I5cg9OBezue6Dspe/GHRWlvUAaceUIy3RF8s2XxJAaIPnubeoaSybn19jn24cJfdNYkJPZurCUfHrrsll2Yfk4IKSKFKXOqzUgpKYTiY+S2YRgtFalswK3rB1ZP3tge1Z7xNajVlYZZyw0geDcrgPMpYj1rKlzqa5+A9H4/GGslGRME0gfBV1LrTpHgJaoqq05xlwI3leUapUkyVIZ2nK0Pm3kdV3dnrZTa59Grfe68kFZ6rOsauCDEIcgSyrnwwB+KWs6PV+nqQGu2iKjdy8CHl0fG56eVtkSlti3/Rq3pLG4E8Gs/zgcWvIIqx75/N4pof4nwpbjv/T7OnaenmSr/r0PXR+ikMnTz89CH4xt+0vgLW9EYbFIgF/Mb+DG64 n170n7YW tdpELAv7Vh6M1BCvIllhyFNV1FXhaIv3KJJPdA0WE09IARsQFXbPGB2SuYxqwpdXJ67T3cRpH/ECWBspNEyAOA1uNKTeX7cj5xiS+bsyaYP1mxEzXJkbSz4xdQ7PqmmVZM1c2aY74/Wu26GTV4xzglGrwP5qAgT4Xi3q2mhmBaqiY53empzSp9siI3BAhzf8U9o6cCX72BA5/VwRnbxrifUnbhWdSrC6LOpD1VzLd1El3PIMJuumf2G1001VOtv+Oiuvane+5kT2KnUfW+//cSdFSKoE/s6mle7BImAbmLWiSxXcFZh3V8NqH9Zuvbzcq+vPvdx1SNWhbLqFwEWiMApy+937wVukNEDkCUEbgt+IvyTJlDG3tFPgCY47PUEiamPJKfJ4s9075/75VzujYRut+FYMki/QNYQIfCPhATsNJrFU01mRIUAvme4WgDxsUcIprLbtZtwm0muC1s0Jpybr5c8ItjuQcsFtnc9xC6tNVqUGwGhVit2ivDk/lNlQpO+ujvrxCyigbXGUS5HGRFsHjKNgaM3+v9KA6c53G10oG4+I= 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: Hi all, As suggested by Peter Zijlstra below [1], this series aims to remove tlb_remove_page_ptdesc(). : Fundamentally tlb_remove_page() is about removing *pages* as from a PTE, : there should not be a page-table anywhere near here *ever*. : : Yes, some architectures use tlb_remove_page() for page-tables too, but : that is more or less an implementation detail that can be fixed. After this series, all architectures use tlb_remove_table() or tlb_remove_ptdesc() to remove the page table pages. In the future, once all architectures using tlb_remove_table() have also converted to using struct ptdesc (eg. powerpc), it may be possible to use only tlb_remove_ptdesc(). Note: there will be some overlap between my patch #4 and Rik van Riel's patch #1 [2], once his patch is merged into the next branch, I can rebase onto his patch. And patch #4 can actually make x86 use tlb_remove_ptdesc(), but due to the above situation, I have not done so yet. This series is based on next-20250122. Comments and suggestions are welcome! Thanks, Qi [1]. https://lore.kernel.org/linux-mm/20250103111457.GC22934@noisy.programming.kicks-ass.net/ [2]. https://lore.kernel.org/lkml/20250123042447.2259648-2-riel@surriel.com/ Qi Zheng (5): mm: pgtable: make generic tlb_remove_table() use struct ptdesc mm: pgtable: convert some architectures to use tlb_remove_ptdesc() riscv: pgtable: unconditionally use tlb_remove_ptdesc() x86: pgtable: unconditionally use tlb_remove_table() mm: pgtable: remove tlb_remove_page_ptdesc() arch/csky/include/asm/pgalloc.h | 3 +-- arch/hexagon/include/asm/pgalloc.h | 3 +-- arch/loongarch/include/asm/pgalloc.h | 3 +-- arch/m68k/include/asm/sun3_pgalloc.h | 3 +-- arch/mips/include/asm/pgalloc.h | 3 +-- arch/nios2/include/asm/pgalloc.h | 9 ++++----- arch/openrisc/include/asm/pgalloc.h | 3 +-- arch/riscv/include/asm/pgalloc.h | 26 ++++---------------------- arch/sh/include/asm/pgalloc.h | 3 +-- arch/um/include/asm/pgalloc.h | 9 +++------ arch/x86/kernel/paravirt.c | 17 +---------------- arch/x86/mm/pgtable.c | 11 ----------- include/asm-generic/tlb.h | 12 +++--------- 13 files changed, 22 insertions(+), 83 deletions(-)