Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-22 Thread Roman Gushchin
On Wed, Aug 22, 2018 at 09:01:19AM +0300, Konstantin Khlebnikov wrote: > On Tue, Aug 21, 2018 at 8:15 PM, Johannes Weiner wrote: > > On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > >> On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox > >> wrote: > >> > On Fri, Aug 17,

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-22 Thread Roman Gushchin
On Wed, Aug 22, 2018 at 09:01:19AM +0300, Konstantin Khlebnikov wrote: > On Tue, Aug 21, 2018 at 8:15 PM, Johannes Weiner wrote: > > On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > >> On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox > >> wrote: > >> > On Fri, Aug 17,

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-22 Thread Konstantin Khlebnikov
On Tue, Aug 21, 2018 at 8:15 PM, Johannes Weiner wrote: > On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: >> On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: >> > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: >> >> - scan =

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-22 Thread Konstantin Khlebnikov
On Tue, Aug 21, 2018 at 8:15 PM, Johannes Weiner wrote: > On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: >> On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: >> > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: >> >> - scan =

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-21 Thread Johannes Weiner
On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > >> - scan = div64_u64(scan * fraction[file], > >> -

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-21 Thread Johannes Weiner
On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > >> - scan = div64_u64(scan * fraction[file], > >> -

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-21 Thread Matthew Wilcox
On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > >> - scan = div64_u64(scan * fraction[file], > >> -

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-21 Thread Matthew Wilcox
On Tue, Aug 21, 2018 at 08:11:44AM +0300, Konstantin Khlebnikov wrote: > On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > >> - scan = div64_u64(scan * fraction[file], > >> -

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-20 Thread Konstantin Khlebnikov
On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: >> - scan = div64_u64(scan * fraction[file], >> - denominator); >> + if (scan > 1) >> +

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-20 Thread Konstantin Khlebnikov
On Sat, Aug 18, 2018 at 4:22 AM, Matthew Wilcox wrote: > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: >> - scan = div64_u64(scan * fraction[file], >> - denominator); >> + if (scan > 1) >> +

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-20 Thread Roman Gushchin
On Fri, Aug 17, 2018 at 06:22:13PM -0700, Matthew Wilcox wrote: > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > > - scan = div64_u64(scan * fraction[file], > > -denominator); > > + if (scan > 1) > > +

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-20 Thread Roman Gushchin
On Fri, Aug 17, 2018 at 06:22:13PM -0700, Matthew Wilcox wrote: > On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > > - scan = div64_u64(scan * fraction[file], > > -denominator); > > + if (scan > 1) > > +

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-17 Thread Matthew Wilcox
On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > - scan = div64_u64(scan * fraction[file], > - denominator); > + if (scan > 1) > + scan = div64_u64(scan * fraction[file], > +

Re: [PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-17 Thread Matthew Wilcox
On Fri, Aug 17, 2018 at 04:18:34PM -0700, Roman Gushchin wrote: > - scan = div64_u64(scan * fraction[file], > - denominator); > + if (scan > 1) > + scan = div64_u64(scan * fraction[file], > +

[PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-17 Thread Roman Gushchin
I've noticed, that dying memory cgroups are often pinned in memory by a single pagecache page. Even under moderate memory pressure they sometimes stayed in such state for a long time. That looked strange. My investigation showed that the problem is caused by applying the LRU pressure balancing

[PATCH RFC] mm: don't miss the last page because of round-off error

2018-08-17 Thread Roman Gushchin
I've noticed, that dying memory cgroups are often pinned in memory by a single pagecache page. Even under moderate memory pressure they sometimes stayed in such state for a long time. That looked strange. My investigation showed that the problem is caused by applying the LRU pressure balancing