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]
Date:   Tue, 13 Dec 2022 14:34:48 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     Kefeng Wang <wangkefeng.wang@...wei.com>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        David Hildenbrand <david@...hat.com>,
        Oscar Salvador <osalvador@...e.de>,
        SeongJae Park <sj@...nel.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, damon@...ts.linux.dev,
        vishal.moola@...il.com
Subject: Re: [PATCH -next 2/8] mm: page_idle: Convert page idle to use folios

On Tue, Dec 13, 2022 at 05:27:29PM +0800, Kefeng Wang wrote:
> -static struct page *page_idle_get_page(unsigned long pfn)
> +static struct folio *folio_idle_get_folio(unsigned long pfn)
>  {
> -	struct page *page = pfn_to_online_page(pfn);
> +	struct folio *folio = pfn_to_online_folio(pfn);
>  
> -	if (!page || !PageLRU(page) ||
> -	    !get_page_unless_zero(page))
> +	if (!folio || !folio_test_lru(folio) || !folio_try_get(folio))
>  		return NULL;

You've changed the semantics here, and I suspect will cause breakage
as a result.  Before if you called page_idle_get_page() on a tail page,
you got a NULL pointer returned.  Now you get the folio that contains
that tail page.

I think you have to continue to call pfn_to_online_page() and do
the conversion to folio manually in this function.  By all means
convert this function to return the folio, but you need to take a
little more care.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ