lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <g2w3xqtz6kz3u3c7zxvpv76azlfjwhau7tjbkvfokhbz727hxr@c2po6fgf4gu3>
Date: Thu, 19 Jun 2025 17:56:14 +1000
From: Alistair Popple <apopple@...dia.com>
To: David Hildenbrand <david@...hat.com>
Cc: akpm@...ux-foundation.org, linux-mm@...ck.org, 
	gerald.schaefer@...ux.ibm.com, dan.j.williams@...el.com, jgg@...pe.ca, willy@...radead.org, 
	linux-kernel@...r.kernel.org, nvdimm@...ts.linux.dev, linux-fsdevel@...r.kernel.org, 
	linux-ext4@...r.kernel.org, linux-xfs@...r.kernel.org, jhubbard@...dia.com, hch@....de, 
	zhang.lyra@...il.com, debug@...osinc.com, bjorn@...nel.org, balbirs@...dia.com, 
	lorenzo.stoakes@...cle.com, linux-arm-kernel@...ts.infradead.org, loongarch@...ts.linux.dev, 
	linuxppc-dev@...ts.ozlabs.org, linux-riscv@...ts.infradead.org, linux-cxl@...r.kernel.org, 
	dri-devel@...ts.freedesktop.org, John@...ves.net, m.szyprowski@...sung.com, 
	Jason Gunthorpe <jgg@...dia.com>
Subject: Re: [PATCH v2 08/14] mm/khugepaged: Remove redundant pmd_devmap()
 check

On Tue, Jun 17, 2025 at 11:44:30AM +0200, David Hildenbrand wrote:
> On 16.06.25 13:58, Alistair Popple wrote:
> > The only users of pmd_devmap were device dax and fs dax. The check for
> > pmd_devmap() in check_pmd_state() is therefore redundant as callers
> > explicitly check for is_zone_device_page(), so this check can be dropped.
> > 
> 
> Looking again, is this true?
> 
> If we return "SCAN_SUCCEED", we assume there is a page table there that we
> can map and walk.
> 
> But I assume we can drop that check because nobody will ever set
> pmd_devmap() anymore?
> 
> So likely just the description+sibject of this patch should be adjusted.

Ugh. I wish I had've documented this better because it's all very "obvious",
but I think the description is still accurate. These devmap checks could never
have been hit and were therefore redundant, because in practice all callers call
thp_vma_allowable_order() either before or after check_pmd_state() (or both).

thp_vma_allowable_order() will eventually (in __thp_vma_allowable_orders())
check for a DAX VMA and bail. But yes, I should call that out in the patch
subject so I don't have to keep relearning this obvious fact :-)

> FWIW, I think check_pmd_state() should be changed to work on pmd_leaf() etc,
> but that's something for another day.

Sure, and I do appreciate these kind of remarks because sometimes I get bored
enough to come back and actually do them. Not very often ... but sometimes.

> -- 
> Cheers,
> 
> David / dhildenb
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ