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: <CAGsJ_4wH8ATOQLodxm7fEZb7Nt0oCxeyuiiUcf3ZYBpyC0kiFA@mail.gmail.com>
Date: Wed, 17 Sep 2025 12:41:09 +0800
From: Barry Song <21cnbao@...il.com>
To: Kairui Song <ryncsn@...il.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>, 
	Matthew Wilcox <willy@...radead.org>, Hugh Dickins <hughd@...gle.com>, Chris Li <chrisl@...nel.org>, 
	Baoquan He <bhe@...hat.com>, Nhat Pham <nphamcs@...il.com>, 
	Kemeng Shi <shikemeng@...weicloud.com>, Baolin Wang <baolin.wang@...ux.alibaba.com>, 
	Ying Huang <ying.huang@...ux.alibaba.com>, Johannes Weiner <hannes@...xchg.org>, 
	David Hildenbrand <david@...hat.com>, Yosry Ahmed <yosryahmed@...gle.com>, 
	Lorenzo Stoakes <lorenzo.stoakes@...cle.com>, Zi Yan <ziy@...dia.com>, 
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 15/15] mm, swap: use a single page for swap table when
 the size fits

> >
> > > ---
> > > +static void swap_table_free(struct swap_table *table)
> > > +{
> > > +       if (!SWP_TABLE_USE_PAGE) {
> > > +               kmem_cache_free(swap_table_cachep, table);
> > > +               return;
> > > +       }
> > > +
> > > +       call_rcu(&(folio_page(virt_to_folio(table), 0)->rcu_head),
> > > +                swap_table_free_folio_rcu_cb);
> > > +}
> >
> > Can’t it simply be:
> > virt_to_page(table)->rcu_head ?
>
> I'm not sure if we prefer folios when possible?

Not sure either, but even Mathew still sometimes suggests using PAGE:

https://lore.kernel.org/lkml/aLrrQDCBzaMwwmA-@casper.infradead.org/

BTW, "(folio_page(folio), 0)" looks quite strange. I mean, why is it 0
instead of 1?
Although we know it’s always one PAGE, 0 still seems strange.

>
> Either way is fine, they are identical for this use case.
>

Thanks
Barry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ