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: Mon, 15 Jan 2024 11:08:18 +0900
From: Byungchul Park <byungchul@...com>
To: Matthew Wilcox <willy@...radead.org>
Cc: linux-kernel@...r.kernel.org, linux-mm@...ck.org,
	kernel_team@...ynix.com, akpm@...ux-foundation.org,
	ying.huang@...el.com, namit@...are.com, xhao@...ux.alibaba.com,
	mgorman@...hsingularity.net, hughd@...gle.com, david@...hat.com,
	peterz@...radead.org, luto@...nel.org, tglx@...utronix.de,
	mingo@...hat.com, bp@...en8.de, dave.hansen@...ux.intel.com
Subject: Re: [v5 4/7] mm: Separate move/undo doing on folio list from
 migrate_pages_batch()

On Thu, Jan 11, 2024 at 03:42:55PM +0000, Matthew Wilcox wrote:
> On Thu, Jan 11, 2024 at 03:07:54PM +0900, Byungchul Park wrote:
> > +static void migrate_folios_move(struct list_head *src_folios,
> > +		struct list_head *dst_folios,
> > +		free_folio_t put_new_folio, unsigned long private,
> > +		enum migrate_mode mode, int reason,
> > +		struct list_head *ret_folios,
> > +		struct migrate_pages_stats *stats,
> > +		int *retry, int *thp_retry, int *nr_failed,
> > +		int *nr_retry_pages)
> > +{
> > +	struct folio *folio, *folio2, *dst, *dst2;
> > +	bool is_thp;
> > +	int nr_pages;
> > +	int rc;
> > +
> > +	dst = list_first_entry(dst_folios, struct folio, lru);
> > +	dst2 = list_next_entry(dst, lru);
> > +	list_for_each_entry_safe(folio, folio2, src_folios, lru) {
> > +		is_thp = folio_test_large(folio) && folio_test_pmd_mappable(folio);
> 
> You don't need to call folio_test_large() first.  folio_order() includes
> a call to test_large() so it can return 0.
> 
> > +		nr_pages = folio_nr_pages(folio);
> 
> ... or since you're calculating this anyway,
> 
> 		is_thp = nr_pages >= HPAGE_PMD_NR

Cool. Thanks.

	Byungchul

> perhaps

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ