[Lustre-devel] [PATCH] Fix task IO accounting on reads

Peter Kjellström cap at nsc.liu.se
Wed Apr 27 08:56:19 PDT 2011


On Wednesday, April 27, 2011 01:23:57 PM Mark Hills wrote:
> On Tue, 26 Apr 2011, Andreas Dilger wrote:
...
> > Mark,
> > It looks like this functionality was added to the kernel in Git commit
> > hash 7c3ab7381e79dfc7db14a67c6f4f3285664e1ec2, which was between 2.6.19
> > and 2.6.20.  This call needs to be made conditional so that it doesn't
> > break the client build on older kernels (it looks like it would break
> > RHEL5 and SLES10 clients, which don't have this functionality AFAICS).
> > 
> > It looks like it may be possible to create a compatibility macro in
> > lustre/include/linux/lustre_compat25.h so that it doesn't break for
> > clients running on older kernels:
> > 
> > #ifdef CONFIG_TASK_IO_ACCOUNTING
> > #include <linux/task_io_accounting_ops.h>
> > #else
> > #define task_io_accounting_read(bytes) do {} while (0)
> > #endif
> 
> Newer kernels always define task_io_account_read() as a function, even if
> it's a no-op. So to avoid redefining it it should check the kernel
> version, not the CONFIG_ flag.
> 
> A revised patch is below, which I tested with kernel 2.6.32.28.
> Unfortunately I odn't have a pre-2.6.20 platform for testing.

I suspect a real world complication that you'd have to handle is that the 
RHEL-5u6 kernel (2.6.18-238) has 
task_io_accounting_ops.h/task_io_accounting_read (yet another Redhat 
backport...)

/Peter
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.lustre.org/pipermail/lustre-devel-lustre.org/attachments/20110427/1e720af5/attachment.pgp>


More information about the lustre-devel mailing list