lkml.org 
[lkml]   [2014]   [Jul]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [patch 3/3] mm: vmscan: clean up struct scan_control
On Mon, 14 Jul 2014 09:20:49 -0400 Johannes Weiner <hannes@cmpxchg.org> wrote:

> Reorder the members by input and output, then turn the individual
> integers for may_writepage, may_unmap, may_swap, compaction_ready,
> hibernation_mode into flags that fit into a single integer.

bitfields would be a pretty good fit here. I usually don't like them
because of locking concerns with the RMWs, but scan_control is never
accessed from another thread.

> - if (!sc->may_unmap && page_mapped(page))
> + if (!(sc->flags & MAY_UNMAP) && page_mapped(page))

Then edits such as this are unneeded.



\
 
 \ /
  Last update: 2014-07-18 11:41    [W:0.121 / U:1.568 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site