From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 4E47B23E32D; Sat, 8 Nov 2025 18:01:06 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762624869; cv=none; b=suRqTtrUSpZUffQEBhKixh3yUwAD3ClNdWvPE8ymFhrANcB1hB/TTlpM9zb8PVoZ86PdaLfbyVpjNTctILuNC7Uia4Bpk/hH+W6DzW31lV+W4az7q4DtzEPgaY8XIGitFzSBhAwGjTPlWRxvCzD5iPemqSadWCIxZIEhr1OYkCo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762624869; c=relaxed/simple; bh=WY8ReV6b5rLneuyL9AKjyd/kw56HVWU1CULr7FLVHP4=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=hn2esUOsoXCZ+bd1svsRFD8TTkA18BiEv5XgbpLMOdG6yY/C1R9efVzbgcvjwhxvMbdrT+bUaLvsX29fF0jzdwKfdA0el9F0j19jfKhU6RwTh/OelRn+gR7AHQUb/K/yiC3VIdE0s9RnjuJOnRc9kH7vdPL2SlvIeMG6FQ+d5+w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=oDUv3HSn; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="oDUv3HSn" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9EDFDC4CEFB; Sat, 8 Nov 2025 18:01:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1762624866; bh=WY8ReV6b5rLneuyL9AKjyd/kw56HVWU1CULr7FLVHP4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=oDUv3HSnjIfwPyFkFpXgxuM9gpIrqWGxlj+VbGgMDqQY7mvSx4LjzbZNiu+GyW66l sBSmHMFXObgsrY/JwizQJcL8IlCvpaHLDnEETtyGW2/R+vrTgZKu9v3oCok35vTcqF jmex0BTITiOowYk1xFcmp3KlwKUu3Iwim/OcS0ek= Date: Sat, 8 Nov 2025 10:01:04 -0800 From: Andrew Morton To: Lorenzo Stoakes Cc: Christian Borntraeger , Janosch Frank , Claudio Imbrenda , David Hildenbrand , Alexander Gordeev , Gerald Schaefer , Heiko Carstens , Vasily Gorbik , Sven Schnelle , Peter Xu , Alexander Viro , Christian Brauner , Jan Kara , Arnd Bergmann , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Muchun Song , Oscar Salvador , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Matthew Brost , Joshua Hahn , Rakie Kim , Byungchul Park , Gregory Price , Ying Huang , Alistair Popple , Axel Rasmussen , Yuanchu Xie , Wei Xu , Kemeng Shi , Kairui Song , Nhat Pham , Baoquan He , Chris Li , SeongJae Park , Matthew Wilcox , Jason Gunthorpe , Leon Romanovsky , Xu Xin , Chengming Zhou , Jann Horn , Miaohe Lin , Naoya Horiguchi , Pedro Falcato , Pasha Tatashin , Rik van Riel , Harry Yoo , Hugh Dickins , linux-kernel@vger.kernel.org, kvm@vger.kernel.org, linux-s390@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, damon@lists.linux.dev Subject: Re: [PATCH v2 00/16] mm: remove is_swap_[pte, pmd]() + non-swap entries, introduce leaf entries Message-Id: <20251108100104.bb9fc75f97b9263af7e5673b@linux-foundation.org> In-Reply-To: References: X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-s390@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Sat, 8 Nov 2025 17:08:14 +0000 Lorenzo Stoakes wrote: > There's an established convention in the kernel that we treat leaf page > tables (so far at the PTE, PMD level) as containing 'swap entries' should > they be neither empty (i.e. p**_none() evaluating true) nor present > (i.e. p**_present() evaluating true). > > However, at the same time we also have helper predicates - is_swap_pte(), > is_swap_pmd() - which are inconsistently used. > > This is problematic, as it is logical to assume that should somebody wish > to operate upon a page table swap entry they should first check to see if > it is in fact one. > > It also implies that perhaps, in future, we might introduce a non-present, > none page table entry that is not a swap entry. > > This series resolves this issue by systematically eliminating all use of > the is_swap_pte() and is swap_pmd() predicates so we retain only the > convention that should a leaf page table entry be neither none nor present > it is a swap entry. Thanks, I've updated mm.git's mm-unstable branch to this v2 series.