svn commit: r348300 - head/sys/ufs/ffs

Mark Johnston markj at freebsd.org
Mon May 27 20:15:05 UTC 2019


On Mon, May 27, 2019 at 06:22:44AM +0000, Kirk McKusick wrote:
> Author: mckusick
> Date: Mon May 27 06:22:43 2019
> New Revision: 348300
> URL: https://svnweb.freebsd.org/changeset/base/348300
> 
> Log:
>   Add function name and line number debugging information to softupdates
>   worklist structures to help track their movement between work lists.
>   No functional change to the operation of soft updates intended.
> 
> Modified:
>   head/sys/ufs/ffs/ffs_softdep.c
>   head/sys/ufs/ffs/softdep.h
> 
> [...]
> Modified: head/sys/ufs/ffs/softdep.h
> ==============================================================================
> --- head/sys/ufs/ffs/softdep.h	Mon May 27 04:20:31 2019	(r348299)
> +++ head/sys/ufs/ffs/softdep.h	Mon May 27 06:22:43 2019	(r348300)
> @@ -213,6 +213,10 @@ struct worklist {
>  	struct mount		*wk_mp;		/* Mount we live in */
>  	unsigned int		wk_type:8,	/* type of request */
>  				wk_state:24;	/* state flags */
> +#ifdef DEBUG
> +	const char		*wk_func;	/* func where added / removed */
> +	int			wk_line;	/* line where added / removed */
> +#endif
>  };
>  #define	WK_DATA(wk) ((void *)(wk))
>  #define	WK_PAGEDEP(wk) ((struct pagedep *)(wk))

ffs_softdep.c defines DEBUG, while ffs_alloc.c (which includes
softdep.h) does not.  A result of this is that the kernel's type info
used by DTrace contains two different definitions of struct worklist,
which has a sort of snowball effect since we end up with two definitions
of each structure containing a struct worklist *, and so on.

Could we turn DEBUG into a proper kernel configuration option so that
it's defined consistently everywhere, or just use INVARIANTS/DIAGNOSTIC
instead?  I am happy to do the work if we can agree on a direction.

DEBUG is used only in the SU, snapshot and the block allocation code.
In ffs_alloc.c it is used to enable some debug printfs (which are
themselves conditionalized on a sysctl var).  It is used similarly in
ffs_snapshot.c.  In ffs_softdep.c (which also has SUJ_DEBUG) it enables
some consistency checking.  INVARIANTS seems to me like a reasonable
option to use in ffs_softdep.c, and perhaps the others as well.


More information about the svn-src-all mailing list