Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1731327

Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead
Date 2017-09-13 03:50 +0200
Message-ID <up4Yp-KK-5@gated-at.bofh.it> (permalink)
References <ubJ5o-4ag-5@gated-at.bofh.it> <ubJ5o-4ag-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Mon, Aug 07, 2017 at 01:40:36PM +0800, Huang, Ying wrote:
> From: Huang Ying <ying.huang@intel.com>
> 
> The swap readahead is an important mechanism to reduce the swap in
> latency.  Although pure sequential memory access pattern isn't very
> popular for anonymous memory, the space locality is still considered
> valid.
> 
> In the original swap readahead implementation, the consecutive blocks
> in swap device are readahead based on the global space locality
> estimation.  But the consecutive blocks in swap device just reflect
> the order of page reclaiming, don't necessarily reflect the access
> pattern in virtual memory.  And the different tasks in the system may
> have different access patterns, which makes the global space locality
> estimation incorrect.
> 
> In this patch, when page fault occurs, the virtual pages near the
> fault address will be readahead instead of the swap slots near the
> fault swap slot in swap device.  This avoid to readahead the unrelated
> swap slots.  At the same time, the swap readahead is changed to work
> on per-VMA from globally.  So that the different access patterns of
> the different VMAs could be distinguished, and the different readahead
> policy could be applied accordingly.  The original core readahead
> detection and scaling algorithm is reused, because it is an effect
> algorithm to detect the space locality.

Andrew,

Every zram users like low-end android device has used 0 page-cluster
to disable swap readahead because it has no seek cost and works as
synchronous IO operation so if we do readahead multiple pages,
swap falut latency would be (4K * readahead window size). IOW,
readahead is meaningful only if it doesn't bother faulted page's
latency.

However, this patch introduces additional knob /sys/kernel/mm/swap/
vma_ra_max_order as well as page-cluster. It means existing users
has used disabled swap readahead doesn't work until they should be
aware of new knob and modification of their script/code to disable
vma_ra_max_order as well as page-cluster.

I say it's a *regression* and wanted to fix it but Huang's opinion
is that it's not a functional regression so userspace should be fixed
by themselves.
Please look into detail of discussion in
http://lkml.kernel.org/r/%3C1505183833-4739-4-git-send-email-minchan@kernel.org%3E

The discussion is never productive so it's time to follow maintainer's
opinion. Could you share your opinion?

Thanks.

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Minchan Kim <minchan@kernel.org> - 2017-09-13 03:50 +0200
  Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Andrew Morton <akpm@linux-foundation.org> - 2017-09-13 23:10 +0200
    Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead "Huang\, Ying" <ying.huang@intel.com> - 2017-09-14 03:00 +0200
      Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Minchan Kim <minchan@kernel.org> - 2017-09-14 10:20 +0200
    Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Minchan Kim <minchan@kernel.org> - 2017-09-14 10:00 +0200
      Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead "Huang\, Ying" <ying.huang@intel.com> - 2017-09-14 14:10 +0200
        Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Minchan Kim <minchan@kernel.org> - 2017-09-14 15:20 +0200
          Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Andrew Morton <akpm@linux-foundation.org> - 2017-09-14 23:30 +0200
          Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead "Huang\, Ying" <ying.huang@intel.com> - 2017-09-15 05:20 +0200
            Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead Minchan Kim <minchan@kernel.org> - 2017-09-15 05:50 +0200
              Re: [PATCH -mm -v4 3/5] mm, swap: VMA based swap readahead "Huang\, Ying" <ying.huang@intel.com> - 2017-09-15 06:50 +0200

csiph-web