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


Groups > linux.kernel > #1416766

Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file

From Minchan Kim <minchan@kernel.org>
Newsgroups linux.kernel
Subject Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file
Date 2016-06-08 02:10 +0200
Message-ID <rHzeh-17I-7@gated-at.bofh.it> (permalink)
References <rH8QO-Oc-9@gated-at.bofh.it> <rH8QO-Oc-35@gated-at.bofh.it> <rHd46-3HM-5@gated-at.bofh.it> <rHq1k-3KB-23@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Jun 07, 2016 at 10:18:18AM -0400, Johannes Weiner wrote:
> On Tue, Jun 07, 2016 at 09:25:50AM +0900, Minchan Kim wrote:
> > Hi Johannes,
> > 
> > Thanks for the nice work. I didn't read all patchset yet but the design
> > makes sense to me so it would be better for zram-based on workload
> > compared to as is.
> 
> Thanks!
> 
> > On Mon, Jun 06, 2016 at 03:48:27PM -0400, Johannes Weiner wrote:
> > > --- a/Documentation/sysctl/vm.txt
> > > +++ b/Documentation/sysctl/vm.txt
> > > @@ -771,14 +771,20 @@ with no ill effects: errors and warnings on these stats are suppressed.)
> > >  
> > >  swappiness
> > >  
> > > -This control is used to define how aggressive the kernel will swap
> > > -memory pages.  Higher values will increase agressiveness, lower values
> > > -decrease the amount of swap.  A value of 0 instructs the kernel not to
> > > -initiate swap until the amount of free and file-backed pages is less
> > > -than the high water mark in a zone.
> > > +This control is used to define the relative IO cost of cache misses
> > > +between the swap device and the filesystem as a value between 0 and
> > > +200. At 100, the VM assumes equal IO cost and will thus apply memory
> > > +pressure to the page cache and swap-backed pages equally. At 0, the
> > > +kernel will not initiate swap until the amount of free and file-backed
> > > +pages is less than the high watermark in a zone.
> > 
> > Generally, I agree extending swappiness value good but not sure 200 is
> > enough to represent speed gap between file and swap sotrage in every
> > cases. - Just nitpick.
> 
> How so? You can't give swap more weight than 100%. 200 is the maximum
> possible value.

In old, swappiness is how agressively reclaim anonymous pages in favour
of page cache. But when I read your description and changes about
swappiness in vm.txt, esp, *relative IO cost*, I feel you change swappiness
define to represent relative IO cost between swap storage and file storage.
Then, with that, we could balance anonymous and file LRU with the weight.

For example, let's assume that in-memory swap storage is 10x times faster
than slow thumb drive. In that case, IO cost of 5 anonymous pages
swapping-in/out is equal to 1 file-backed page-discard/read.

I thought it does make sense because that measuring the speed gab between
those storages is easier than selecting vague swappiness tendency.

In terms of such approach, I thought 200 is not enough to show the gab
because the gap is started from 100.
Isn't it your intention? If so, to me, the description was rather
misleading. :(

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


Thread

[PATCH 01/10] mm: allow swappiness that prefers anon over file Johannes Weiner <hannes@cmpxchg.org> - 2016-06-06 22:00 +0200
  Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file Minchan Kim <minchan@kernel.org> - 2016-06-07 02:30 +0200
    Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file Johannes Weiner <hannes@cmpxchg.org> - 2016-06-07 16:20 +0200
      Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file Minchan Kim <minchan@kernel.org> - 2016-06-08 02:10 +0200
        Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file Johannes Weiner <hannes@cmpxchg.org> - 2016-06-08 18:00 +0200
          Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file Minchan Kim <minchan@kernel.org> - 2016-06-09 03:10 +0200
            Re: [PATCH 01/10] mm: allow swappiness that prefers anon over file Johannes Weiner <hannes@cmpxchg.org> - 2016-06-09 15:40 +0200

csiph-web