xfs
[Top] [All Lists]

Re: [BUG REPORT] missing memory counter introduced by xfs

To: Lin Feng <linf@xxxxxxxxxxxxxxxxxx>
Subject: Re: [BUG REPORT] missing memory counter introduced by xfs
From: Dave Chinner <david@xxxxxxxxxxxxx>
Date: Sat, 10 Sep 2016 09:13:20 +1000
Cc: xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <57D25772.3070304@xxxxxxxxxxxxxxxxxx>
References: <57CFEDA3.9000005@xxxxxxxxxxxxxxxxxx> <20160907212206.GP30056@dastard> <57D13871.9070603@xxxxxxxxxxxxxxxxxx> <20160908204413.GW30056@dastard> <57D25772.3070304@xxxxxxxxxxxxxxxxxx>
User-agent: Mutt/1.5.21 (2010-09-15)
On Fri, Sep 09, 2016 at 02:32:18PM +0800, Lin Feng wrote:
> Hi Dave,
> 
> A final not-clear concept about XFS, look beblow please.
> 
> On 09/09/2016 04:44 AM, Dave Chinner wrote:
> >On Thu, Sep 08, 2016 at 06:07:45PM +0800, Lin Feng wrote:
....
> >>>So, you have *5.4 million* active metadata buffers. Each buffer will
> >>>hold  1 or 2 4k pages on your kernel, so simple math says 4M * 4k +
> >>>1.4M * 8k = 26G. There's no missing counter here....
> >>
> >>Does xattr contribute to such metadata buffers or there is something else?
> >
> >xattrs are metadata, so if they don't fit in line in the inode
> >(typical for ceph because it uses xattrs larger than 256 bytes) then
> >they are held in external blocks which are cached in the buffer
> >cache.
> >
> 
> So the 'buffer cache' here you mean is the pages handled by xfs_buf
> struct,

Yes.

> used to hold the xattrs if the inode inline data space
> overflows,

And all other cached metadata that is accessed via struct xfs_buf.

> not the 'beffer/cache' seen via free command, they won't
> reflect in cache field by free command, right?

Correct. From the "free" man page:

        buffers
             Memory used by kernel buffers (Buffers in /proc/meminfo)

        cache
             Memory used by the page cache and slabs (Cached and
             Slab in /proc/meminfo)

        buff/cache
             Sum of buffers and cache


So, "Buffers" is the amount of cached block device pages - this is
always zero for XFS filesystems as we don't use the block device
page cache at all (IIRC, that's where ext4 caches it's metadata).
"cache" is obvious, but it does not include memory attached to slab
objects. Hence it will account for struct xfs_buf memory usage, but
not the pages attached to each xfs_buf....

Cheers,

Dave.
-- 
Dave Chinner
david@xxxxxxxxxxxxx

<Prev in Thread] Current Thread [Next in Thread>