Hi,
I've been playing with cluster-1.01.00 and I found the reading very slow.
I've been trying to setup "max_readahead" using gfs_tool and
performances are unchanged.
So I've read the code and placed some printk everywhere ;o)
Results is : in opts_file.c when you make a gfs_read you have the
following code (this is right for both buffered and directio reads)
if (gfs_is_jdata(ip) ||
(gfs_is_stuffed(ip) && !test_bit(GIF_PAGED, &ip->i_flags)))
count = do_read_readi(file, buf, size, offset);
else
count = generic_file_read(file, buf, size, offset);
In my case, I always uses generic_file_read because all conditions are
equal to 0.
I'm not a gfs expert so I don't know if it's normal or not to not use
the do_read_readi call to read the fs.
I've watched how do_read_readi() works and after a few calls you call
gfs_start_ra (from dio.c).
This sounds perfect because it defines "uint32_t max_ra =
gfs_tune_get(sdp, gt_max_readahead) >> sdp->sd_sb.sb_bsize_shift;";
This uses the default max_readahead set.
Now the other case, what's about generic_file_read (defined in the usual
linux tree)
Of course, it doesn't know about the value you set (max_readahead).
So after reading how it works, the file structure owns a f_ra member
which is defined for handling the readahead aspects.
I though about forcing this value before the generic_file_read call.
Please found this patch attached.
When I set a default value to file->f_ra.ra_pages to 512, my
performances are 3 times better ! I've bupped from 40MB/sec to 120MB/sec.
I'm now reaching the normal performance I was expected.
Comments about this patch:
1°) I don't know if it's the cleanest way to do it but it works, so It
shows that the readahead aspect is not handled while using
generic_file_read.
2°) I've used a default value that match my hardware but it could be
cleaner to use the "gfs_tune_get(sdp, gt_max_readahead)" call.
2bis°) I don't know how to call it because it needs the gfs_lock
structure and I don't know how to provide one (I didn't read enough code
for that).
3°) I need a gfs guru to finish this patch with point 2 & 2bis if my
patch sounds relevant
Erwan,
--- gfs-kernel/src/gfs/ops_file.c~ 2005-10-31 16:27:26.000000000 +0100
+++ gfs-kernel/src/gfs/ops_file.c 2005-10-31 16:28:26.000000000 +0100
@@ -371,8 +371,10 @@
if (gfs_is_jdata(ip) ||
(gfs_is_stuffed(ip) && !test_bit(GIF_PAGED, &ip->i_flags)))
count = do_read_readi(file, buf, size, offset);
- else
+ else {
+ file->f_ra.ra_pages=512;
count = generic_file_read(file, buf, size, offset);
+ }
gfs_glock_dq_m(num_gh + 1, ghs);
--
Linux-cluster@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/linux-cluster