xfs: prevent NMI timeouts in cmn_err
A message that is not in the archive (sent off-list or not yet received): 996570405.660111292204469269.JavaMail.root@zmail05.collab.prod.int.phx2.redhat.com
Quoted 32 lines · ----- "Dave Chinner
Quoted 2 lines · Christoph Hellwig
Quoted 1 line · Dave Chinner
FWIW, while these macros are the best way to make a simple
backport
Quoted 17 lines
Quoted 17 lines
is possible, I just discovered that mainline has a %pV format operator that allows an implementation like:
void
xfs_fs_cmn_err(const char *lvl, struct xfs_mount *mp, const char *fmt, ...) { struct va_format vaf; va_list args; va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args;Quoted 8 lines
Quoted 5 lines
printk("%sFilesystem %s: %pV", lvl, mp->m_fsname, &vaf); va_end(args); BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0); }With this we can also keep the existing integer-based
CE_values and do trivial array lookup. That also avoids having to do a strcmpfor
Quoted 1 line
every message printed.
Quoted 7 lines
Very true.
Ok, so how do we want to process for this? I'm happy to drop the macro-ised patch and only use it as a backportable fix for old kernels - mainline appears to have a lot more functionality in this area than even recent distro kernels. Lachlan - is that an acceptable approach for you?
Yes, that works for me. We don't have much choice for RHEL4/5 and there's no reason that should compromise a better solution upstream.
Quoted 24 lines
It seems to me that the above is a much better way to start cleaning up the mainline code base, in the following way:
1. the above patch to remove the local message buffer + lock.
2. rationalise all the differences in error reporting down to a common interface
3. convert the common interface to use kernel log levels directly.The current trend seems to be to move towards logging interfaces with the following template:
{sub_sys}_pr_{level}(priv, fmt, ...)Which in this case would give us:
xfs_pr_debug(struct xfs_mount *mp, char *fmt, ...); xfs_pr_note(struct xfs_mount *mp, char *fmt, ...); .... xfs_pr_alert(struct xfs_mount *mp, char *fmt, ...); xfs_pr_emergency(struct xfs_mount *mp, char *fmt, ...);
Quoted 8 lines
And a variant for the panic mask tagged version of
xfs_pr_alert()of:xfs_pr_alert_tag(struct xfs_mount *mp, int tag, char *fmt, ...);I can't see any particular reason for needing to keep the separate parameter for the log level, nor for keeping all the different logging variants we currently have.
Wont you need to reintroduce the log level parameter when each of these new functions calls the common interface? ie most of the above functions will just be wrappers that convert the function name to a log level.
Quoted 7 lines
I'm open to other ideas on the best way to rationalise all the logging we currently have - the above is just my current thoughts on what to do. I'm pushing this out as a proposal for discussion before I change anything as I don't relish the idea of iterating different logging APIs through patches...
Quoted 15 lines
Cheers,
Dave.
Quoted 2 lines
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs
_______________________________________________
xfs mailing list
[email protected]
http://oss.sgi.com/mailman/listinfo/xfs
Quoted 37 lines · Lachlan McIlroy
Quoted 34 lines · ----- "Dave Chinner
Quoted 2 lines · Christoph Hellwig
Quoted 1 line · Dave Chinner
FWIW, while these macros are the best way to make a simple
backport
Quoted 17 lines
Quoted 17 lines
is possible, I just discovered that mainline has a %pV format operator that allows an implementation like:
void
xfs_fs_cmn_err(const char *lvl, struct xfs_mount *mp, const char *fmt, ...) { struct va_format vaf; va_list args; va_start(args, fmt); vaf.fmt = fmt; vaf.va = &args;Quoted 8 lines
Quoted 5 lines
printk("%sFilesystem %s: %pV", lvl, mp->m_fsname, &vaf); va_end(args); BUG_ON(strncmp(lvl, KERN_EMERG, strlen(KERN_EMERG)) == 0); }With this we can also keep the existing integer-based
CE_values and do trivial array lookup. That also avoids having to do a strcmpfor
Quoted 1 line
every message printed.
Very true.
Quoted 8 lines
Quoted 5 lines
Ok, so how do we want to process for this? I'm happy to drop the macro-ised patch and only use it as a backportable fix for old kernels - mainline appears to have a lot more functionality in this area than even recent distro kernels. Lachlan - is that an acceptable approach for you?
Yes, that works for me. We don't have much choice for RHEL4/5 and there's no reason that should compromise a better solution upstream.
Ok, I'll get that ball moving...
Quoted 26 lines
Quoted 26 lines
It seems to me that the above is a much better way to start cleaning up the mainline code base, in the following way:
1. the above patch to remove the local message buffer + lock.
2. rationalise all the differences in error reporting down to a common interface
3. convert the common interface to use kernel log levels directly.The current trend seems to be to move towards logging interfaces with the following template:
{sub_sys}_pr_{level}(priv, fmt, ...)Which in this case would give us:
xfs_pr_debug(struct xfs_mount *mp, char *fmt, ...); xfs_pr_note(struct xfs_mount *mp, char *fmt, ...); .... xfs_pr_alert(struct xfs_mount *mp, char *fmt, ...); xfs_pr_emergency(struct xfs_mount *mp, char *fmt, ...);And a variant for the panic mask tagged version of
xfs_pr_alert()of:
Quoted 8 lines
Quoted 5 lines
xfs_pr_alert_tag(struct xfs_mount *mp, int tag, char *fmt, ...);I can't see any particular reason for needing to keep the separate parameter for the log level, nor for keeping all the different logging variants we currently have.
Wont you need to reintroduce the log level parameter when each of these new functions calls the common interface?
Ah, what I meant was that the above xfs_pr_*() functions form the common logging interface, instead of cmn_err, xfs_cmn_err, xfs_fs_cmn_err, etc. So the second step above would be to convert all the existing logging calls to use this, but still using the current cmn_err() back end for the custom XFS log messages. i.e. the callers change API, but they still use the same CE_* levels.
Quoted 2 lines
ie most of the above functions
will just be wrappers that convert the function name to a log level.
The third step is to change the implementation to something like the dev_<level>() printk implementation, or possibly even using the pr_<level> macros directly via creative abuse of the pr_fmt() macro.
Cheers,
Dave.
Signature · 7 lines
Dave Chinner [email protected] _______________________________________________ xfs mailing list [email protected] http://oss.sgi.com/mailman/listinfo/xfs