From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pj1-f49.google.com (mail-pj1-f49.google.com [209.85.216.49]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 277FA154C0C for ; Mon, 6 Jan 2025 03:53:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.49 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736135632; cv=none; b=IfOgj4IDn+ZQnH5cl6DZ7LDNwnts2VveiPtaS/UI4Y80fWx1lC9ANEcw4v4N1Nt6xn1RXyBLesPeWLYbQrs/yt3dU5uXGkqBuhAlM+qIAroOKdC6drFggkEOxvAch9WhWIP2sl+n+0APy7bMwX8gGIijvT7xCnnQNWO1yGhHmhM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1736135632; c=relaxed/simple; bh=W5R5SVhoruE2dQ0Ov21TCrDEEfRfDgUrkE/35gJj4fs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=bvX82mu09iGR/ImOeHwMfvaeTjZacNODngDmEAgUNpkwT0hpsyfPu/5gAW22XtUrBQvrVI0EZw0hhU+DOdkEVWxROzmLD5CNoWKPlwPz5Q6OPvW1IgPHOSyb+R/y4pWgIFWJ5fD1T+WzuCR6NzW/KcVh7U8xcdmXfh7aa6fzbBw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com; spf=pass smtp.mailfrom=bytedance.com; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b=JbpcXk5V; arc=none smtp.client-ip=209.85.216.49 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=bytedance.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=bytedance.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=bytedance.com header.i=@bytedance.com header.b="JbpcXk5V" Received: by mail-pj1-f49.google.com with SMTP id 98e67ed59e1d1-2f441904a42so20367444a91.1 for ; Sun, 05 Jan 2025 19:53:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance.com; s=google; t=1736135630; x=1736740430; darn=lists.linux-m68k.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=/q466ctbH84kLf48L1cXJtHFTRzDl7be/n0cI3LGmOM=; b=JbpcXk5V/5odVan/AHF2hA5N7qV1HMVwSvur9GwtCOwsd27JXdQyx7GBQzVhsCndi+ r7ysa5aI0c+IqMSTYQI4MVqPTi814fhnN67sSIZkgKRijigBsAPuReB74YF4zuUCh87v YVsq1qZkPML5200tbxhLH6N3TD3Qq+01/O2qT1bW0YBZN3LhNyZqs6Ce2lcNgmy+Z0UW 5ucZV4JAXMOpiQp/dzC1MSjEnAdB765Rmok3y23yCHf4IpI5ioKJlr3GXXYdAZV7iWfK YkJMx9SJ7LThgyU3q+E85cMUpizyvb29/WreUTi9mzekBkw/q/b3B2cVrZbJK8r8eUbN cQbA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1736135630; x=1736740430; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=/q466ctbH84kLf48L1cXJtHFTRzDl7be/n0cI3LGmOM=; b=cLaLFNqQ3in8Qj8BLCZYy+cDAZfL+oOrvDY3Woo9inSY6EG/4+Bg61aToT+6aVjfeu HU6X87nNaiMvQfoXPwExzo8Avo1EChz2ufwPZ+3jMrAZALv2CVQkU1ZjE1Nqu3ZX3yUG kNnLJVbb+8Qo1t4HBd8OPcW/Y3usR5HabC9mPqj0dFtoMlq9uqYR+T8rAkWXgrE545P9 5VdxsanALzM1TmxP+li57g6pkDtbxD1rqMpfCWaPZNmBK8/qCAo2HGR5Z88H8Cy9Vrcj 6CR5kC3yEcWcuisv0OulvAVhSzmYZbAsP/zNVk7/SpiZz6xtrfTw2fbSIUcEUTQkHkSj 2Fqg== X-Forwarded-Encrypted: i=1; AJvYcCU6j8cKeYqUbyIBgWbJRZHASxRbe602NLb1h6BZiCSaH7CQUEw7nr3wMbGZ1DOCsVUzrkJ5QFjawPZP@lists.linux-m68k.org X-Gm-Message-State: AOJu0YxI8LWGhGmGTWB14S+uRWIxrjUt1RF0ZwDKd7uMP4R6FHBYP3LB 20NOeWhTHNvm/FrhGFm/8wcafLLbWIAx+5dZATJNvHOHGRZgeu6EHoQubE56Lhg= X-Gm-Gg: ASbGncvr2AdqglwG28H2mI/xyT1gZ/3FPqjY7MxBqEZbVrUyifizMs2DO6201mnsNJy OxVAcAuLHL7Ye3rYahNpqlo833YpB64Q3DghLVCB6A4lXIdQWl/otq+L5XW5htyrPpByrq7/dNl 5L0hgeZin0IhvhUsZmHz3iuQgTrWzzr0NUgiQHWT58POBygeCPMTpjRxokpftUyYVL9fQoGMs5C JfMggRRNgtOe59BHzGMtDeN5jHa5xWHo05a5cKSh5bkEblbwMne1w+LlzvL3DZV5olVijsNCgab 3GXjAw== X-Google-Smtp-Source: AGHT+IE2eKUVGb+J7TSGZASTVnkByt6mt8YLIy++PUNY+VFfsnF7zlybMe8WL3Umwm8kwi4ry/BkkA== X-Received: by 2002:a17:90b:54c3:b0:2ee:a127:ba8b with SMTP id 98e67ed59e1d1-2f452ee83d9mr71788615a91.36.1736135630440; Sun, 05 Jan 2025 19:53:50 -0800 (PST) Received: from [10.84.148.23] ([203.208.167.150]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-219dca02f72sm283551435ad.249.2025.01.05.19.53.38 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 05 Jan 2025 19:53:49 -0800 (PST) Message-ID: Date: Mon, 6 Jan 2025 11:53:36 +0800 Precedence: bulk X-Mailing-List: linux-m68k@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 15/17] mm: pgtable: remove tlb_remove_page_ptdesc() Content-Language: en-US To: Peter Zijlstra , Mike Rapoport Cc: agordeev@linux.ibm.com, kevin.brodsky@arm.com, tglx@linutronix.de, david@redhat.com, jannh@google.com, hughd@google.com, yuzhao@google.com, willy@infradead.org, muchun.song@linux.dev, vbabka@kernel.org, lorenzo.stoakes@oracle.com, akpm@linux-foundation.org, rientjes@google.com, vishal.moola@gmail.com, arnd@arndb.de, will@kernel.org, aneesh.kumar@kernel.org, npiggin@gmail.com, dave.hansen@linux.intel.com, ryan.roberts@arm.com, linux-mm@kvack.org, linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, linux-riscv@lists.infradead.org, linux-s390@vger.kernel.org, sparclinux@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, linux-arch@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 References: <20250103111457.GC22934@noisy.programming.kicks-ass.net> From: Qi Zheng In-Reply-To: <20250103111457.GC22934@noisy.programming.kicks-ass.net> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 2025/1/3 19:14, Peter Zijlstra wrote: > On Sat, Dec 28, 2024 at 11:26:22AM +0200, Mike Rapoport wrote: >> On Mon, Dec 23, 2024 at 05:41:01PM +0800, Qi Zheng wrote: >>> Here we are explicitly dealing with struct page, and the following logic >>> semms strange: >>> >>> tlb_remove_page_ptdesc((tlb), (page_ptdesc(pte))); >>> >>> tlb_remove_page_ptdesc >>> --> tlb_remove_page(tlb, ptdesc_page(pt)); >>> >>> So remove tlb_remove_page_ptdesc() and make callers call tlb_remove_page() >>> directly. >> >> Please don't. The ptdesc wrappers are there as a part of reducing the size >> of struct page project [1]. >> >> For now struct ptdesc overlaps struct page, but the goal is to have them >> separate and always operate on struct ptdesc when working with page tables. > > I don't see how the current idiotic code helps with that at all. > > 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. > > So no, please keep these patches and kill this utterly idiotic code. > > The only thing that should eventually care about page-tables is > tlb_remove_table(), and that takes a 'void *' and is expected to match > whatever __tlb_remove_table() does. > > Flipping those to pgdesc, once its actually a thing, should be fairly > straight forward. Well, since I've already sent v4, and that patch series is mainly for bug fix, I'll send a separate patch series to do this. Thanks!