* xfs_buf and buffercache/pagecache connection
@ 2010-05-31 16:31 Yannis Klonatos
2010-05-31 18:04 ` Andi Kleen
2010-05-31 22:06 ` Dave Chinner
0 siblings, 2 replies; 4+ messages in thread
From: Yannis Klonatos @ 2010-05-31 16:31 UTC (permalink / raw)
To: xfs
Hello,
I was looking to add a kernel hook to my system in order to
monitor buffer-cache hit and misses. Initially I was
planning to add my modifications to the __getblk(). However, i noticed
that XFS does not directly use the buffer-cache
for its pages but it seems to implement its own buffer.
What I am now looking for is 1) the place where XFS checks
whether a page exists in its buffer or not and 2)
what are the possible interactions between xfs_buf and the Linux kernel
buffer-cache.
I would appreciate any information regarding the above issues.
Thanks in advance,
Yannis Klonatos
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xfs_buf and buffercache/pagecache connection
2010-05-31 16:31 xfs_buf and buffercache/pagecache connection Yannis Klonatos
@ 2010-05-31 18:04 ` Andi Kleen
2010-05-31 18:25 ` Yannis Klonatos
2010-05-31 22:06 ` Dave Chinner
1 sibling, 1 reply; 4+ messages in thread
From: Andi Kleen @ 2010-05-31 18:04 UTC (permalink / raw)
To: Yannis Klonatos; +Cc: xfs
Yannis Klonatos <klonatos@ics.forth.gr> writes:
> I was looking to add a kernel hook to my system in order to
> monitor buffer-cache hit and misses. Initially I was
> planning to add my modifications to the __getblk(). However, i noticed
> that XFS does not directly use the buffer-cache
> for its pages but it seems to implement its own buffer.
> What I am now looking for is 1) the place where XFS checks
> whether a page exists in its buffer or not and 2)
> what are the possible interactions between xfs_buf and the Linux
> kernel buffer-cache.
> I would appreciate any information regarding the above issues.
The kernel does not track all accesses, e.g. through mmap.
So you can only get misses (which is essentially IO rate and already
accounted), but not hits.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xfs_buf and buffercache/pagecache connection
2010-05-31 18:04 ` Andi Kleen
@ 2010-05-31 18:25 ` Yannis Klonatos
0 siblings, 0 replies; 4+ messages in thread
From: Yannis Klonatos @ 2010-05-31 18:25 UTC (permalink / raw)
To: Andi Kleen; +Cc: xfs
[-- Attachment #1.1: Type: text/plain, Size: 2259 bytes --]
???? 5/31/2010 9:04 PM, O/H Andi Kleen ??????:
> Yannis Klonatos<klonatos@ics.forth.gr> writes:
>
>
>> I was looking to add a kernel hook to my system in order to
>> monitor buffer-cache hit and misses. Initially I was
>> planning to add my modifications to the __getblk(). However, i noticed
>> that XFS does not directly use the buffer-cache
>> for its pages but it seems to implement its own buffer.
>> What I am now looking for is 1) the place where XFS checks
>> whether a page exists in its buffer or not and 2)
>> what are the possible interactions between xfs_buf and the Linux
>> kernel buffer-cache.
>> I would appreciate any information regarding the above issues.
>>
> The kernel does not track all accesses, e.g. through mmap.
> So you can only get misses (which is essentially IO rate and already
> accounted), but not hits.
>
> -Andi
>
First of all thanks for your quick reply.
So, if i understand correctly, what you are saying is that it is
basically impossible to modify xfs code
so that i get that specific information? This sounds a bit strange since
if XFS was indeed using the
buffercache as ext3 or other fs does, the following modification would
suffice (file fs/buffer.c):
structbuffer_head <+code=buffer_head> *
find_get_block <+code=__find_get_block>(structblock_device <+code=block_device> *bdev <+code=bdev>,sector_t <+code=sector_t> block <+code=block>, intsize <+code=size>) {
structbuffer_head <+code=buffer_head> *bh <+code=bh> =lookup_bh_lru <+code=lookup_bh_lru>(bdev <+code=bdev>,block <+code=block>,size <+code=size>);
/* BEGIN MODIFICATION */
if (bh) buffercache_hits++;
else buffercache_misses++;
/* END MODIFICATION */
if (bh <+code=bh> ==NULL <+code=NULL>) {
bh <+code=bh> =__find_get_block_slow <+code=__find_get_block_slow>(bdev <+code=bdev>,block <+code=block>);
if (bh <+code=bh>)
bh_lru_install <+code=bh_lru_install>(bh <+code=bh>);
}
if (bh <+code=bh>) {
touch_buffer <+code=touch_buffer>(bh <+code=bh>);
returnbh <+code=bh>;
}
XPORT_SYMBOL <+code=EXPORT_SYMBOL>(__find_get_block <+code=__find_get_block>);
[-- Attachment #1.2: Type: text/html, Size: 4086 bytes --]
[-- Attachment #2: Type: text/plain, Size: 121 bytes --]
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: xfs_buf and buffercache/pagecache connection
2010-05-31 16:31 xfs_buf and buffercache/pagecache connection Yannis Klonatos
2010-05-31 18:04 ` Andi Kleen
@ 2010-05-31 22:06 ` Dave Chinner
1 sibling, 0 replies; 4+ messages in thread
From: Dave Chinner @ 2010-05-31 22:06 UTC (permalink / raw)
To: Yannis Klonatos; +Cc: xfs
On Mon, May 31, 2010 at 07:31:39PM +0300, Yannis Klonatos wrote:
> Hello,
>
> I was looking to add a kernel hook to my system in order to
> monitor buffer-cache hit and misses. Initially I was
> planning to add my modifications to the __getblk(). However, i
> noticed that XFS does not directly use the buffer-cache
> for its pages but it seems to implement its own buffer.
> What I am now looking for is 1) the place where XFS checks
> whether a page exists in its buffer or not and 2)
> what are the possible interactions between xfs_buf and the Linux
> kernel buffer-cache.
> I would appreciate any information regarding the above issues.
There are already stats in place to tell you about this.
http://xfs.org/index.php/Runtime_Stats#buf_-_Buf_Statistics
They aren't documented there, but if you look at
fs/xfs/linux-2.6/xfs_buf.c an search for XFS_STATS_INC you'll find
what they all mean from the code. It isn't as simple as hit or miss
counters - there's different counters for different types of hits
and misses....
Cheers,
Dave.
--
Dave Chinner
david@fromorbit.com
_______________________________________________
xfs mailing list
xfs@oss.sgi.com
http://oss.sgi.com/mailman/listinfo/xfs
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2010-05-31 22:03 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-05-31 16:31 xfs_buf and buffercache/pagecache connection Yannis Klonatos
2010-05-31 18:04 ` Andi Kleen
2010-05-31 18:25 ` Yannis Klonatos
2010-05-31 22:06 ` Dave Chinner
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox