]> Pileus Git - ~andy/linux/commit
GFS2: Cache last hash bucket for glock seq_files
authorSteven Whitehouse <swhiteho@redhat.com>
Fri, 8 Jun 2012 10:16:22 +0000 (11:16 +0100)
committerSteven Whitehouse <swhiteho@redhat.com>
Fri, 8 Jun 2012 10:16:22 +0000 (11:16 +0100)
commitba1ddcb6ca0c46edd275790d1e4e2cfd6219ce19
tree76d134ba74c609f5afa66e0e5c4b8bc541fc84b3
parentdf5d2f5560a9c33129391a136ed9f0ac26abe69b
GFS2: Cache last hash bucket for glock seq_files

For the glocks and glstats seq_files, which are exposed via debugfs
we should cache the most recent hash bucket, along with the offset
into that bucket. This allows us to restart from that point, rather
than having to begin at the beginning each time.

This is an idea from Eric Dumazet, however I've slightly extended it
so that if the position from which we are due to start is at any
point beyond the last cached point, we start from the last cached
point, plus whatever is the appropriate offset. I don't really expect
people to be lseeking around these files, but if they did so with only
positive offsets, then we'd still get some of the benefit of using a
cached offset.

With my simple test of around 200k entries in the file, I'm seeing
an approx 10x speed up.

Cc: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Steven Whitehouse <swhiteho@redhat.com>
fs/gfs2/glock.c