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] [day] [month] [year] [list]
Message-ID: <fa398c31-7135-457e-b97d-366c12685688@redhat.com>
Date: Fri, 22 Nov 2024 12:23:19 +0100
From: David Hildenbrand <david@...hat.com>
To: Andrew Morton <akpm@...ux-foundation.org>,
 Matthew Wilcox <willy@...radead.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>, linux-mm@...ck.org,
 mm-commits@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [GIT PULL] MM updates for 6.13-rc1

On 22.11.24 06:42, Andrew Morton wrote:
> On Tue, 19 Nov 2024 04:35:47 +0000 Matthew Wilcox <willy@...radead.org> wrote:
> 
>> On Mon, Nov 18, 2024 at 07:30:01PM -0800, Andrew Morton wrote:
>>> Matthew Wilcox (Oracle) (13):
>>>        ksm: use a folio in try_to_merge_one_page()
>>>        ksm: convert cmp_and_merge_page() to use a folio
>>
>> Unfortunately you left the crap patch in from Gaosheng.  Linus, can you
>> apply this fixup?
>>
>> >From 3d7e7319bbb3ced1dfb9c82bb7e8c7386380799b Mon Sep 17 00:00:00 2001
>> From: "Matthew Wilcox (Oracle)" <willy@...radead.org>
>> Date: Mon, 18 Nov 2024 23:32:25 -0500
>> Subject: [PATCH] mm: Revert IS_ERR_OR_NULL check
>>
>> &foo->bar is address arithmetic, not a dereference of foo.
>> Huawei engineers seem particularly prone to not knowing this.
> 
> It isn't only Huawai people.  David acked Gaosheng's patch and it snuck
> past me (again).  People keep on getting tricked by this idiom and I
> think we'd be better off with some nicely named wrapper to help
> readers understand what's going on.

The helper we have is "folio_page(folio, 0)" ... and we do have a bunch 
of that usage in the kernel.

Likely we, want a more catchy helper that simply gives us the first (and 
for small folios the only) page.

... not able to come up with good names though. folio_page0(), 
folio_first_page(), ... :(

Once folios no longer overlay pages, the &folio->page trick will stop 
working I guess, and I recall a comment from Willy about that.

... and then we'd probably have to dereference the folio to obtain the 
"struct page"?

-- 
Cheers,

David / dhildenb


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ