aboutsummaryrefslogtreecommitdiffstats
path: root/mm
diff options
context:
space:
mode:
authorVlastimil Babka <vbabka@suse.cz>2013-09-11 17:22:30 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-09-11 18:58:00 -0400
commit1ebb7cc6a58321a4b22c4c9097b4651b0ab859d0 (patch)
treee7742f1bd9a86d9165af70c7a7e773f4e4d85b3a /mm
parent7225522bb429a2f7dae6667e533e2d735b4882d0 (diff)
mm: munlock: batch NR_MLOCK zone state updates
Depending on previous batch which introduced batched isolation in munlock_vma_range(), we can batch also the updates of NR_MLOCK page stats. After the whole pagevec is processed for page isolation, the stats are updated only once with the number of successful isolations. There were however no measurable perfomance gains. Signed-off-by: Vlastimil Babka <vbabka@suse.cz> Reviewed-by: Jörn Engel <joern@logfs.org> Acked-by: Mel Gorman <mgorman@suse.de> Cc: Michel Lespinasse <walken@google.com> Cc: Hugh Dickins <hughd@google.com> Cc: Rik van Riel <riel@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: Michal Hocko <mhocko@suse.cz> Cc: Vlastimil Babka <vbabka@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/mlock.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/mm/mlock.c b/mm/mlock.c
index b3b4a78b7802..b1a7c8007c89 100644
--- a/mm/mlock.c
+++ b/mm/mlock.c
@@ -241,6 +241,7 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone)
241{ 241{
242 int i; 242 int i;
243 int nr = pagevec_count(pvec); 243 int nr = pagevec_count(pvec);
244 int delta_munlocked = -nr;
244 245
245 /* Phase 1: page isolation */ 246 /* Phase 1: page isolation */
246 spin_lock_irq(&zone->lru_lock); 247 spin_lock_irq(&zone->lru_lock);
@@ -251,9 +252,6 @@ static void __munlock_pagevec(struct pagevec *pvec, struct zone *zone)
251 struct lruvec *lruvec; 252 struct lruvec *lruvec;
252 int lru; 253 int lru;
253 254
254 /* we have disabled interrupts */
255 __mod_zone_page_state(zone, NR_MLOCK, -1);
256
257 if (PageLRU(page)) { 255 if (PageLRU(page)) {
258 lruvec = mem_cgroup_page_lruvec(page, zone); 256 lruvec = mem_cgroup_page_lruvec(page, zone);
259 lru = page_lru(page); 257 lru = page_lru(page);
@@ -275,8 +273,10 @@ skip_munlock:
275 */ 273 */
276 pvec->pages[i] = NULL; 274 pvec->pages[i] = NULL;
277 put_page(page); 275 put_page(page);
276 delta_munlocked++;
278 } 277 }
279 } 278 }
279 __mod_zone_page_state(zone, NR_MLOCK, delta_munlocked);
280 spin_unlock_irq(&zone->lru_lock); 280 spin_unlock_irq(&zone->lru_lock);
281 281
282 /* Phase 2: page munlock and putback */ 282 /* Phase 2: page munlock and putback */