From owner-svn-src-head@freebsd.org Tue May 28 16:51:55 2019 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1618515A58F7 for ; Tue, 28 May 2019 16:51:55 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (chez.mckusick.com [70.36.157.235]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7D8B988CF2; Tue, 28 May 2019 16:51:54 +0000 (UTC) (envelope-from mckusick@mckusick.com) Received: from chez.mckusick.com (localhost [IPv6:::1]) by chez.mckusick.com (8.15.2/8.15.2) with ESMTP id x4SH0aE2037260; Tue, 28 May 2019 10:00:37 -0700 (PDT) (envelope-from mckusick@mckusick.com) Message-Id: <201905281700.x4SH0aE2037260@chez.mckusick.com> From: Kirk McKusick To: Mark Johnston Subject: Re: svn commit: r348300 - head/sys/ufs/ffs cc: svn-src-head@freebsd.org X-URL: http://WWW.McKusick.COM/ Reply-To: Kirk McKusick In-reply-to: <20190527201500.GE82831@raichu> Comments: In-reply-to Mark Johnston message dated "Mon, 27 May 2019 16:15:00 -0400." MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <37258.1559062836.1@chez.mckusick.com> Content-Transfer-Encoding: quoted-printable Date: Tue, 28 May 2019 10:00:36 -0700 X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00,MISSING_MID, UNPARSEABLE_RELAY autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on chez.mckusick.com X-Rspamd-Queue-Id: 7D8B988CF2 X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org X-Spamd-Result: default: False [-6.87 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; NEURAL_HAM_SHORT(-0.87)[-0.866,0]; REPLY(-4.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 28 May 2019 16:51:55 -0000 > Date: Mon, 27 May 2019 16:15:00 -0400 > From: Mark Johnston > To: Kirk McKusick > Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, > svn-src-head@freebsd.org > Subject: Re: svn commit: r348300 - head/sys/ufs/ffs > = > 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 softupdate= s >> 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 >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D >> --- 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. Thanks for pointing out this problem. DEBUG is left over from the CSRG days (1980's :-) and should have been purged decades ago. I have converted its use in ffs_snapshot.c and ffs_alloc.c to DIAGNOSTIC. In ffs_softdep.c I have converted DEBUG and SUJ_DEBUG to INVARIANTS. Kirk