2012-05-07 20:10:15

by Rik van Riel

[permalink] [raw]
Subject: Re: [RFC][PATCH] avoid swapping out with swappiness==0

On 04/26/2012 11:41 AM, KOSAKI Motohiro wrote:
> On Thu, Apr 26, 2012 at 10:26 AM, Richard Davies
> <[email protected]> wrote:
>> Satoru Moriya wrote:
>>>> I have run into problems with heavy swapping with swappiness==0 and
>>>> was pointed to this thread (
>>>> http://marc.info/?l=linux-mm&m=133522782307215 )
>>>
>>> Did you test this patch with your workload?
>>
>> I haven't yet tested this patch. It takes a long time since these are
>> production machines, and the bug itself takes several weeks of production
>> use to really show up.
>>
>> Rik van Riel has pointed out a lot of VM tweaks that he put into 3.4:
>> http://marc.info/?l=linux-mm&m=133536506926326
>>
>> My intention is to reboot half of our machines into plain 3.4 once it is
>> out, and half onto 3.4 + your patch.
>>
>> Then we can compare behaviour.
>>
>> Will your patch apply cleanly on 3.4?
>
> Note. This patch doesn't solve your issue. This patch mean,
> when occuring very few swap io, it change to 0. But you said
> you are seeing eager swap io. As Dave already pointed out, your
> machine have buffer head issue.
>
> So, this thread is pointless.

Running KVM guests directly off block devices results in a lot
of buffer cache.

I suspect that this patch will in fact fix Richard's issue.

The patch is small, fairly simple and looks like it will fix
people's problems. It also makes swappiness=0 behave the way
most people seem to imagine it would work.

If it works for a few people (test results), I believe we
might as well merge it.

Yes, for cgroups we may need additional logic, but we can
sort that out as we go along.

--
All rights reversed


2012-05-08 00:05:11

by Minchan Kim

[permalink] [raw]
Subject: Re: [RFC][PATCH] avoid swapping out with swappiness==0

On 05/08/2012 05:09 AM, Rik van Riel wrote:

> On 04/26/2012 11:41 AM, KOSAKI Motohiro wrote:
>> On Thu, Apr 26, 2012 at 10:26 AM, Richard Davies
>> <[email protected]> wrote:
>>> Satoru Moriya wrote:
>>>>> I have run into problems with heavy swapping with swappiness==0 and
>>>>> was pointed to this thread (
>>>>> http://marc.info/?l=linux-mm&m=133522782307215 )
>>>>
>>>> Did you test this patch with your workload?
>>>
>>> I haven't yet tested this patch. It takes a long time since these are
>>> production machines, and the bug itself takes several weeks of
>>> production
>>> use to really show up.
>>>
>>> Rik van Riel has pointed out a lot of VM tweaks that he put into 3.4:
>>> http://marc.info/?l=linux-mm&m=133536506926326
>>>
>>> My intention is to reboot half of our machines into plain 3.4 once it is
>>> out, and half onto 3.4 + your patch.
>>>
>>> Then we can compare behaviour.
>>>
>>> Will your patch apply cleanly on 3.4?
>>
>> Note. This patch doesn't solve your issue. This patch mean,
>> when occuring very few swap io, it change to 0. But you said
>> you are seeing eager swap io. As Dave already pointed out, your
>> machine have buffer head issue.
>>
>> So, this thread is pointless.
>
> Running KVM guests directly off block devices results in a lot
> of buffer cache.
>
> I suspect that this patch will in fact fix Richard's issue.
>
> The patch is small, fairly simple and looks like it will fix
> people's problems. It also makes swappiness=0 behave the way
> most people seem to imagine it would work.
>
> If it works for a few people (test results), I believe we
> might as well merge it.
>
> Yes, for cgroups we may need additional logic, but we can
> sort that out as we go along.
>


I agree Rik's opinion absolutely.

--
Kind regards,
Minchan Kim

2012-05-21 07:12:34

by Richard Davies

[permalink] [raw]
Subject: Re: [RFC][PATCH] avoid swapping out with swappiness==0

Hi Satoru,

Rik van Riel wrote:
> KOSAKI Motohiro wrote:
> > Richard Davies wrote:
> > >Satoru Moriya wrote:
> > > > > I have run into problems with heavy swapping with swappiness==0 and
> > > > > was pointed to this thread (
> > > > > http://marc.info/?l=linux-mm&m=133522782307215 )
> > > >
> > > > Did you test this patch with your workload?
> > >
> > > I haven't yet tested this patch. It takes a long time since these are
> > > production machines, and the bug itself takes several weeks of
> > > production use to really show up.
> > >
> > > Rik van Riel has pointed out a lot of VM tweaks that he put into 3.4:
> > > http://marc.info/?l=linux-mm&m=133536506926326
> > >
> > > My intention is to reboot half of our machines into plain 3.4 once it
> > > is out, and half onto 3.4 + your patch.
> > >
> > > Then we can compare behaviour.
> > >
> > > Will your patch apply cleanly on 3.4?
> >
> > Note. This patch doesn't solve your issue. This patch mean,
> > when occuring very few swap io, it change to 0. But you said
> > you are seeing eager swap io. As Dave already pointed out, your
> > machine have buffer head issue.
> >
> > So, this thread is pointless.
>
> Running KVM guests directly off block devices results in a lot
> of buffer cache.
>
> I suspect that this patch will in fact fix Richard's issue.
>
> The patch is small, fairly simple and looks like it will fix
> people's problems. It also makes swappiness=0 behave the way
> most people seem to imagine it would work.
>
> If it works for a few people (test results), I believe we
> might as well merge it.
>
> Yes, for cgroups we may need additional logic, but we can
> sort that out as we go along.

Now that 3.4 is out with Rik's fixes, I'm keen to start testing with and
without this extra patch.

Satoru - should I just apply your original patch (most likely), or do you
need to update for the final released kernel?

Thanks,

Richard.

2012-05-21 13:39:50

by Satoru Moriya

[permalink] [raw]
Subject: RE: [RFC][PATCH] avoid swapping out with swappiness==0

Hi Richard,

On 05/21/2012 03:12 AM, Richard Davies wrote:
> Now that 3.4 is out with Rik's fixes, I'm keen to start testing with
> and without this extra patch.
>
> Satoru - should I just apply your original patch (most likely), or do
> you need to update for the final released kernel?

Thank you for testing!
I believe you can apply the patch without any updates.

Regards,
Satoru