lkml.org 
[lkml]   [2014]   [Oct]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch resend] mm: page_alloc: fix zone allocation fairness on UP
On Thu, 11 Sep 2014, Leon Romanovsky wrote:

> >> I think the better way will be to apply Mel's patch
> >> https://lkml.org/lkml/2014/9/8/214 which fix zone_page_state shadow casting
> >> issue and convert all atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH])) to
> >> zone_page__state(zone, NR_ALLOC_BATCH). This move will unify access to
> >> vm_stat.
> >
> > It's not as simple. The counter can go way negative and we need that
> > negative number, not 0, to calculate the reset delta. As I said in
> > response to Mel's patch, we could make the vmstat API signed but I'm
> > not convinced that is reasonable, given the 99% majority of usecases.
> You are right, I missed that NR_ALLOC_BATCH is in use as a part of calculations
> + high_wmark_pages(zone) - low_wmark_pages(zone) -
> + atomic_long_read(&zone->vm_stat[NR_ALLOC_BATCH]));

How about creating __zone_page_state for zone_page_state without the 0
check? That would be much nicer and would move the stuff to a central
place. Given the nastiness of this issue there are bound to be more fixes
coming up.



\
 
 \ /
  Last update: 2014-10-03 11:01    [W:0.046 / U:1.072 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site