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: <Y8gt5Gb7DPaEI2uN@dhcp22.suse.cz>
Date:   Wed, 18 Jan 2023 18:35:32 +0100
From:   Michal Hocko <mhocko@...e.com>
To:     Minchan Kim <minchan@...nel.org>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        Suren Baghdasaryan <surenb@...gle.com>,
        Matthew Wilcox <willy@...radead.org>,
        linux-mm <linux-mm@...ck.org>,
        LKML <linux-kernel@...r.kernel.org>,
        SeongJae Park <sj@...nel.org>
Subject: Re: [PATCH 1/3] mm: return the number of pages successfully paged out

On Wed 18-01-23 09:09:36, Minchan Kim wrote:
> On Wed, Jan 18, 2023 at 10:10:44AM +0100, Michal Hocko wrote:
> > On Tue 17-01-23 15:16:30, Minchan Kim wrote:
> > > The reclaim_pages MADV_PAGEOUT uses needs to return the number of
> > > pages paged-out successfully, not only the number of reclaimed pages
> > > in the operation because those pages paged-out successfully will be
> > > reclaimed easily at the memory pressure due to asynchronous writeback
> > > rotation(i.e., PG_reclaim with folio_rotate_reclaimable).
> > > 
> > > This patch renames the reclaim_pages with paging_out(with hope that
> > > it's clear from operation point of view) and then adds a additional
> > > stat in reclaim_stat to represent the number of paged-out but kept
> > > in the memory for rotation on writeback completion.
> > > 
> > > With that stat, madvise_pageout can know how many pages were paged-out
> > > successfully as well as reclaimed. The return value will be used for
> > > statistics in next patch.
> > 
> > I really fail to see the reson for the rename and paging_out doesn't
> > even make much sense as a name TBH.
> 
> Currently, what we are doing to reclaim memory is
> 
> reclaim_folio_list
>     shrink_folio_list
>         if (folio_mapped(folio))
>             try_to_unmap(folio)
> 
>         if (folio_test_dirty(folio))
>             pageout
> 
> Based on the structure, pageout is just one of way to reclaim memory.
> 
> With MADV_PAGEOUT, what user want to know how many pages
> were paged out as they requested(from userspace PoV, how many times
> pages fault happens in future accesses), not the number of reclaimed
> pages shrink_folio_list returns currently.
> 
> In the sense, I wanted to distinguish between reclaim and pageout.

But MADV_PAGEOUT is documented to trigger memory reclaim in general
not a pageout. Let me quote from the man page
: Reclaim a given range of pages.  This is done to free up memory occupied
: by these pages.

Sure anonymous pages can be paged out to the swap storage but with the
upcomming multi-tiering it can be also "paged out" to a lower tier. All
that leads to freeing up memory that is currently mapped by that address
range.

Anyway, what do you actually meen by distinguishing between reclaim and
pageout. Aren't those just two names for the same thing?
-- 
Michal Hocko
SUSE Labs

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ