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: <CAGsJ_4w8b2TCQMPxd_uPxXkW2xGmPt74S6w3mOfRxOaJj6YXsA@mail.gmail.com>
Date: Fri, 6 Sep 2024 22:22:39 +1200
From: Barry Song <21cnbao@...il.com>
To: Yosry Ahmed <yosryahmed@...gle.com>
Cc: usamaarif642@...il.com, akpm@...ux-foundation.org, 
	chengming.zhou@...ux.dev, david@...hat.com, hannes@...xchg.org, 
	hughd@...gle.com, kernel-team@...a.com, linux-kernel@...r.kernel.org, 
	linux-mm@...ck.org, nphamcs@...il.com, shakeel.butt@...ux.dev, 
	willy@...radead.org, ying.huang@...el.com, hanchuanhua@...o.com
Subject: Re: [PATCH v4 1/2] mm: store zero pages to be swapped out in a bitmap

On Fri, Sep 6, 2024 at 7:28 AM Yosry Ahmed <yosryahmed@...gle.com> wrote:
>
> [..]
> > /*
> >  * Check if all entries have consistent zeromap status, return true if
> >  * all entries are zeromap or non-zeromap, else return false;
> >  */
> > static inline bool swap_zeromap_entries_check(swp_entry_t entry, int nr)
>
> Let's also rename this now to swap_zeromap_entries_same(), "check" is
> a little vague.

Hi Yosry, Usama,
Thanks very much for your comments.

After further consideration, I have adopted a different approach that
offers more
flexibility than returning a boolean value and also has an equally low
implementation
cost:
https://lore.kernel.org/linux-mm/20240906001047.1245-2-21cnbao@gmail.com/

This is somewhat similar to Yosry's previous idea but does not reintroduce the
existing bug.

>
> > {
> >         struct swap_info_struct *sis = swp_swap_info(entry);
> >         unsigned long start = swp_offset(entry);
> >         unsigned long end = start + *nr;
> >
> >         if (find_next_bit(sis->zeromap, end, start) == end)
> >                 return true;
> >         if (find_next_zero_bit(sis->zeromap, end, start) == end)
> >                 return true;
> >
> >         return false;
> > }
> >

Thanks
Barry

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ