Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 27 May 2019 16:15:00 -0400
From:      Mark Johnston <markj@freebsd.org>
To:        Kirk McKusick <mckusick@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r348300 - head/sys/ufs/ffs
Message-ID:  <20190527201500.GE82831@raichu>
In-Reply-To: <201905270622.x4R6MiP3047706@repo.freebsd.org>
References:  <201905270622.x4R6MiP3047706@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20190527201500.GE82831>