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 3DA3335949 for ; Thu, 19 Mar 2026 14:07:38 +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=1773929258; cv=none; b=qWGnqpo1yCFQsJM87UqEJxe+TbUM2RtKe0zy2o2+e7sRStJjHXn96unrK8KN1DheDAYo5CepimXFwS3Jgxxma9eJaHQiGnSGtnJ1Hh0bWHSbSqwI+U5PZxP98AOzQRVsWG5XdYXD4OQ/3gU4+8Ln9kqVRaPoT20lxeO8158Kvp0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773929258; c=relaxed/simple; bh=HkZRbcYV9UKIWpRqai42smC0s83PraNFAAL7cCXl3Fo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=UT88Af8VSbI29/OCe22dXN8J4gUUXblwclamSEHMXhmT45lrr2m4owgXdHUUI5FYcwQOfqnUXcO1+ZatuwBf8DM41iy3cO3CWSD40EFxPkE3Ww1e7sRHEoU+lZcQaPMVq9aRZB0yTbjZnMqg4Qt3YtwN0DmPl2JhH2uleyxQ0GY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=SwIWMSqU; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="SwIWMSqU" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 800B5C2BCB1; Thu, 19 Mar 2026 14:07:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1773929257; bh=HkZRbcYV9UKIWpRqai42smC0s83PraNFAAL7cCXl3Fo=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SwIWMSqUzmv/tchOI9fmLYCKdWPrNkgnYJtGz+/VxtnW6IvDJYatRbeB9+70C5rbG Xlt+elf01mYggD7fU0fJzk8lrHHB0NFkYl6kl5o7ctONaCm3Hv4TOVROxUdBYf60iN rIz41nrOcv+sUhuab5TOlEY/N7WDz6qLKDZB2R5fBRPSW31CP4Men6hgOajzU7bxhv ytiRw31fVRCreO604swZZZ9D1lsA7+zVt1j4fKuCxCtkcbDfc3OhO0kUSz+D1sbDah fBXrczmWekD0Bn+0RXBGWxYTgzXWJcXvE3jl2LEyE5BQ/JmNukOJbWIl3wSfY4jNPl a0I3epxNPaEKA== Date: Thu, 19 Mar 2026 14:07:35 +0000 From: "Lorenzo Stoakes (Oracle)" To: "David Hildenbrand (Arm)" Cc: Andrew Morton , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/8] mm/huge_memory: simplify vma_is_specal_huge() Message-ID: References: <84712e37721c557f887e4a405759be31a4961100.1773865827.git.ljs@kernel.org> <5ce0932d-e8d7-4f0b-acb2-12be43a035e1@kernel.org> <11293efc-8c97-476f-9b65-8576c63e3275@lucifer.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Thu, Mar 19, 2026 at 02:03:04PM +0100, David Hildenbrand (Arm) wrote: > On 3/19/26 11:34, Lorenzo Stoakes (Oracle) wrote: > > On Wed, Mar 18, 2026 at 09:45:31PM +0100, David Hildenbrand (Arm) wrote: > >>> +++ b/mm/huge_memory.c > >>> @@ -100,6 +100,14 @@ static inline bool file_thp_enabled(struct vm_area_struct *vma) > >>> return !inode_is_open_for_write(inode) && S_ISREG(inode->i_mode); > >>> } > >>> > >>> +/* If returns true, we are unable to access the VMA's folios. */ > >>> +static bool vma_is_special_huge(struct vm_area_struct *vma) > >>> +{ > >>> + if (vma_is_dax(vma)) > >>> + return false; > >>> + return vma_test_any(vma, VMA_PFNMAP_BIT, VMA_MIXEDMAP_BIT); > >>> +} > >> > >> I was hoping that we could make this whole code look more like PTE code > >> by using vm_normal_page_pmd() ... :) > > > > Could that be a follow up? > > I guess so, but the code is so awful :( well I udated the code to use vm_normal_folio_pmd() :) at least should get us closer to common logic. Cheers, Lorenzo