lkml.org 
[lkml]   [2011]   [Nov]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] mm: remove struct reclaim_state
On Fri, Nov 18, 2011 at 02:07:02PM +0400, Konstantin Khlebnikov wrote:
> Dave Chinner wrote:
> >On Fri, Nov 18, 2011 at 01:28:06PM +0300, Konstantin Khlebnikov wrote:
> >>Memory reclaimer want to know how much pages was reclaimed during shrinking slabs.
> >>Currently there is special struct reclaim_state with single counter and pointer from
> >>task-struct. Let's store counter direcly on task struct and account freed pages
> >>unconditionally. This will reduce stack usage and simplify code in reclaimer and slab.
> >>
> >>Logic in do_try_to_free_pages() is slightly changed, but this is ok.
> >>Nobody calls shrink_slab() explicitly before do_try_to_free_pages(),
> >
> >Except for drop_slab() and shake_page()....
>
> Indeed, but they do not care about accounting reclaimed pages and
> they do not call do_try_to_free_pages() after all.

Right, so you're effectively leaving a landmine for someone to trip
over - anyone that cares about accounting during shrink_slab needs
to zero the value first. The current code makes this obvious by not
having a reclaim structure in the cases where callers don't care
about accounting - after your change the correct usage is
undocumented....

Cheers,

Dave.
--
Dave Chinner
david@fromorbit.com


\
 
 \ /
  Last update: 2011-11-18 22:11    [W:0.056 / U:0.256 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site