lkml.org 
[lkml]   [2024]   [Apr]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH v2] mm: swap: prejudgement swap_has_cache to avoid page allocation
Date
Andrew Morton <akpm@linux-foundation.org> writes:

> On Mon, 8 Apr 2024 20:14:39 +0800 Zhaoyu Liu <liuzhaoyu.zackary@bytedance.com> wrote:
>
>> Based on qemu arm64 - latest kernel + 100M memory + 1024M swapfile.
>> Create 1G anon mmap and set it to shared, and has two processes
>> randomly access the shared memory. When they are racing on swap cache,
>> on average, each "alloc_pages_mpol + swapcache_prepare + folio_put"
>> took about 1475 us.
>
> And what effect does this patch have upon the measured time? ANd upon
> overall runtime?

And the patch will cause increased lock contention, please test with
more processes and perhaps HDD swap device too.

>> So skip page allocation if SWAP_HAS_CACHE was set, just
>> schedule_timeout_uninterruptible and continue to acquire page
>> via filemap_get_folio() from swap cache, to speedup
>> __read_swap_cache_async.

--
Best Regards,
Huang, Ying

\
 
 \ /
  Last update: 2024-05-27 16:30    [W:0.076 / U:0.556 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site