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: <58e4f0c2-99d1-42b9-ab70-907cf35ac1a7@arm.com>
Date: Wed, 27 Mar 2024 08:27:34 +0000
From: Ryan Roberts <ryan.roberts@....com>
To: Kairui Song <ryncsn@...il.com>, "Huang, Ying" <ying.huang@...el.com>
Cc: linux-mm@...ck.org, Chris Li <chrisl@...nel.org>,
 Minchan Kim <minchan@...nel.org>, Barry Song <v-songbaohua@...o.com>,
 Yu Zhao <yuzhao@...gle.com>, SeongJae Park <sj@...nel.org>,
 David Hildenbrand <david@...hat.com>, Yosry Ahmed <yosryahmed@...gle.com>,
 Johannes Weiner <hannes@...xchg.org>, Matthew Wilcox <willy@...radead.org>,
 Nhat Pham <nphamcs@...il.com>, Chengming Zhou <zhouchengming@...edance.com>,
 Andrew Morton <akpm@...ux-foundation.org>, linux-kernel@...r.kernel.org
Subject: Re: [RFC PATCH 00/10] mm/swap: always use swap cache for
 synchronization

[...]

>>> Test 1, sequential swapin/out of 30G zero page on ZRAM:
>>>
>>>                Before (us)        After (us)
>>> Swapout:       33619409           33886008
>>> Swapin:        32393771           32465441 (- 0.2%)
>>> Swapout (THP): 7817909            6899938  (+11.8%)
>>> Swapin (THP) : 32452387           33193479 (- 2.2%)
>>
>> If my understanding were correct, we don't have swapin (THP) support,
>> yet.  Right?
> 
> Yes, this series doesn't change how swapin/swapout works with THP in
> general, but now THP swapout will leave shadows with large order, so
> it needs to be splitted upon swapin, that will slow down later swapin
> by a little bit but I think that's worth it.
> 
> If we can do THP swapin in the future, this split on swapin can be
> saved to make the performance even better.

I'm confused by this (clearly my understanding of how this works is incorrect).
Perhaps you can help me understand:

When you talk about "shadows" I assume you are referring to the swap cache? It
was my understanding that swapping out a THP would always leave the large folio
in the swap cache, so this is nothing new?

And on swap-in, if the target page is in the swap cache, even if part of a large
folio, why does it need to be split? I assumed the single page would just be
mapped? (and if all the other pages subsequently fault, then you end up with a
fully mapped large folio back in the process)?

Perhaps I'm misunderstanding what "shadows" are?

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ