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: <aFUTdnPTT6m0GBX0@yjaykim-PowerEdge-T330>
Date: Fri, 20 Jun 2025 16:53:26 +0900
From: YoungJun Park <youngjun.park@....com>
To: Kairui Song <kasong@...cent.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
	Hugh Dickins <hughd@...gle.com>,
	Baolin Wang <baolin.wang@...ux.alibaba.com>,
	Matthew Wilcox <willy@...radead.org>,
	Kemeng Shi <shikemeng@...weicloud.com>,
	Chris Li <chrisl@...nel.org>, Nhat Pham <nphamcs@...il.com>,
	Baoquan He <bhe@...hat.com>, Barry Song <baohua@...nel.org>,
	linux-kernel@...r.kernel.org, gunho.lee@....com,
	taejoon.song@....com
Subject: Re: [PATCH v2 3/4] mm/shmem, swap: improve mthp swapin process

On Fri, Jun 20, 2025 at 01:55:37AM +0800, Kairui Song wrote:
> +	if (skip_swapcache) {
> +		swapcache_clear(si, folio->swap, folio_nr_pages(folio));
> +		folio->swap.val = 0;
>  	}
> +	if (folio)
> +		folio_put(folio);
>  	put_swap_device(si);
 
I really appreciate the patch. great work!

It's a rather trivial point, but I was wondering if the following change
might make sense:
...
	if (skip_swapcache)
		swapcache_clear(si, folio->swap, folio_nr_pages(folio));

  	put_swap_device(si);

	if (folio)
		folio_put(folio);

	return error;
...

My intention here is to minimize the reference to si,
and from what I understand, this folio has already been allocated and would 
soon disappear. Is it possible to to reduce the clear operation?
(folio->swap.val = 0)

Just a small suggestion.
Thank you again for your work!

Regards,
Youngjun Park

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ