All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christian Ehrhardt <ehrhardt@linux.vnet.ibm.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Rik van Riel <riel@redhat.com>, Elladan <elladan@eskimo.com>,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Lee Schermerhorn <lee.schermerhorn@hp.com>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Andrew Morton <akpm@linux-foundation.org>
Cc: epasch@de.ibm.com, Martin Schwidefsky <schwidefsky@de.ibm.com>,
	Heiko Carstens <heiko.carstens@de.ibm.com>
Subject: Increased Buffers due to patch 56e49d (vmscan: evict use-once pages first), but why exactly?
Date: Mon, 07 Dec 2009 15:36:23 +0100	[thread overview]
Message-ID: <4B1D12E7.4070701@linux.vnet.ibm.com> (raw)

Hi,
commit 56e49d - "vmscan: evict use-once pages first" changed behavior of 
memory management quite a bit which should be fine.
But while tracking down a performance regression I was on the wrong path 
for a while suspecting this patch is causing the regression.
Fortunately this was not the case, but I got some interesting data which 
I couldn't explain completely and I thought maybe its worth to get it 
clarified publicly in case someone else looks at similar data again :-)

All is about the increased amount of "Buffers" accounted as active while 
loosing the same portion from "Cache" accounted as inactive in 
/proc/meminfo.
I understand that with the patch applied there will be some more 
pressure to file pages until the balance of active/inactive file pages 
is reached.
But I didn't get how this prefers buffers compared to cache pages (I 
assume dropping inactive before active was the case all the time so that 
can't be the only difference between buffers/cache).

The scenario I'm running is a low memory system (256M total), that does 
sequential I/O with parallel iozone processes.
One process per disk, each process reading a 2Gb file. The issue occurs 
independent type of disks I use. File system is ext2.
While bisecting even 4 parallel reads from 2Gb files in /tmp were enough 
to see a different amount of buffers in /proc/meminfo.

Looking at the data I got from /proc/meminfo (only significant changes):
                     before    with 56e49d  large devs
MemTotal:         250136 kB      250136 kB
MemFree:            6760 kB        6608 kB
Buffers:            2324 kB       34960 kB      +32636
Cached:            84296 kB       45860 kB      -38436
SwapCached:          392 kB        1416 kB
Active:             6292 kB       38388 kB      +32096
Inactive:          89360 kB       51232 kB      -38128
Active(anon):       4004 kB        3496 kB
Inactive(anon):     8824 kB        9164 kB
Active(file):       2288 kB       34892 kB      +32604
Inactive(file):    80536 kB       42068 kB      -38468
Slab:             106624 kB      112364 kB       +5740
SReclaimable:       5856 kB       11860 kB       +6004
[...]

 From slabinfo I know that the slab increase is just secondary due to 
more structures to e.g. organize the buffers (buffer_head).
I would understand if file associated memory would now shrink in favor 
of non file memory after this patch.
But I can't really see in the code where buffers are favored in 
comparison to cached pages - (it very probably makes sense to do so, as 
they might contain e.g. the inode data about the files in cache).
I think an explanation how that works might be useful for more people 
than just me, so comments welcome.

Kind regards,
Christian

-- 

Grüsse / regards, Christian Ehrhardt
IBM Linux Technology Center, Open Virtualization 


             reply	other threads:[~2009-12-07 14:36 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-07 14:36 Christian Ehrhardt [this message]
2009-12-07 18:17 ` Increased Buffers due to patch 56e49d (vmscan: evict use-once pages first), but why exactly? Rik van Riel
2009-12-08  0:43   ` KOSAKI Motohiro
2009-12-08 15:54     ` Christian Ehrhardt
2009-12-08 16:13       ` Rik van Riel

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4B1D12E7.4070701@linux.vnet.ibm.com \
    --to=ehrhardt@linux.vnet.ibm.com \
    --cc=akpm@linux-foundation.org \
    --cc=elladan@eskimo.com \
    --cc=epasch@de.ibm.com \
    --cc=hannes@cmpxchg.org \
    --cc=heiko.carstens@de.ibm.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=lee.schermerhorn@hp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterz@infradead.org \
    --cc=riel@redhat.com \
    --cc=schwidefsky@de.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.