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: <Y8TUE3h/IJySDn11@casper.infradead.org>
Date:   Mon, 16 Jan 2023 04:35:31 +0000
From:   Matthew Wilcox <willy@...radead.org>
To:     "Huang, Ying" <ying.huang@...el.com>
Cc:     Mike Kravetz <mike.kravetz@...cle.com>,
        Andrew Morton <akpm@...ux-foundation.org>, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org, Zi Yan <ziy@...dia.com>,
        Yang Shi <shy828301@...il.com>,
        Baolin Wang <baolin.wang@...ux.alibaba.com>,
        Oscar Salvador <osalvador@...e.de>,
        Bharata B Rao <bharata@....com>,
        Alistair Popple <apopple@...dia.com>,
        haoxin <xhao@...ux.alibaba.com>
Subject: Re: [PATCH -v2 0/9] migrate_pages(): batch TLB flushing

On Fri, Jan 13, 2023 at 10:42:08AM +0800, Huang, Ying wrote:
> +++ b/mm/migrate.c
> @@ -1187,10 +1187,13 @@ static int __migrate_folio_move(struct folio *src, struct folio *dst,
>  	int rc;
>  	int page_was_mapped = 0;
>  	struct anon_vma *anon_vma = NULL;
> +	bool is_lru = !__PageMovable(&src->page);
>  
>  	__migrate_folio_extract(dst, &page_was_mapped, &anon_vma);
>  
>  	rc = move_to_new_folio(dst, src, mode);
> +	if (!unlikely(is_lru))
> +		goto out_unlock_both;

This reads a little awkwardly.  Could it be:

	if (likely(!is_lru))

... but honestly, I think the polarity here is wrong.  LRU pages tend to
outnumber !LRU pages, so shouldn't this be:

	if (unlikely(!is_lru)) {

just like it is in migrate_folio_unmap()?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ