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 5BFE454763; Tue, 11 Nov 2025 00:17:48 +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=1762820271; cv=none; b=mooVU1Ag7/Ii6tk/im5TbXdFz4IeLGxlnjRVH5An7GF7ge1maNkhZ5YLdcVLN98knjlQjDpyVD56eH82FrZLsAacbovRt/XTdPdKL5V1OlBvmwWScrVSivXLvGbohvMPHmR0hHCIdPsl/KwmsoYNz9pAbVtpImA3lDVOTxg9GyY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1762820271; c=relaxed/simple; bh=h4IOFDJ10o8gxsjF+0swXOnDNA//+lvIGav3YD5mbm4=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=r+VRs+4P0pEYLBkDT1OxCqrfvvg17R5ATPRVQWr+OF3SLo6dibLuydJfez9hkG55vvWpi0sAcpCFXq2gO829fz9FwulBv1E6JXegjgpiCFKIdO9l4/J5Zu8iJKQU9qQEkQb5kAEz6abJkF6ZQGB+3/wLJ+wTOCKA6duwr6EAnBU= 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=vjkeLHDm; 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="vjkeLHDm" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 68CB5C4CEFB; Tue, 11 Nov 2025 00:17:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1762820268; bh=h4IOFDJ10o8gxsjF+0swXOnDNA//+lvIGav3YD5mbm4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=vjkeLHDmhlbRmdh2J8YEkuADTnOje8197r13F9Y+9M4PNEGyrIjTsJrXa9FcWBd30 3dmWPQqBvqXKMpha7c0qNKjQ5ewY10+fA5vTYMX7SAz0x9GQP2DAUfOdVKd+b+ILms w4QnZBmAPYCsSnhcOO+V0J4HJESA9uFYopLe6MVY= Date: Mon, 10 Nov 2025 16:17:45 -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: <20251110161745.2075f263e3c693bf65f98ccc@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-fsdevel@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 Mon, 10 Nov 2025 22:21:18 +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 updated mm.git's mm-unstable branch to this version the patchset.