Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 4 May 2015 09:58:48 +1000 (EST)
From:      Bruce Evans <brde@optusnet.com.au>
To:        Julian Elischer <julian@freebsd.org>
Cc:        Mateusz Guzik <mjguzik@gmail.com>, Bruce Evans <brde@optusnet.com.au>,  freebsd-arch@freebsd.org
Subject:   Re: [PATCH 1/2] Generalised support for copy-on-write structures shared by threads.
Message-ID:  <20150504094742.C3339@besplex.bde.org>
In-Reply-To: <55461CC3.2020306@freebsd.org>
References:  <1430188443-19413-1-git-send-email-mjguzik@gmail.com> <1430188443-19413-2-git-send-email-mjguzik@gmail.com> <20150428181802.F1119@besplex.bde.org> <20150501165633.GA7112@dft-labs.eu> <55461CC3.2020306@freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, 3 May 2015, Julian Elischer wrote:

> On 5/2/15 12:56 AM, Mateusz Guzik wrote:
>> On Tue, Apr 28, 2015 at 06:45:01PM +1000, Bruce Evans wrote:
>>> On Tue, 28 Apr 2015, Mateusz Guzik wrote:
>>>> diff --git a/sys/sys/proc.h b/sys/sys/proc.h
>>>> index 64b99fc..f29d796 100644
>>>> --- a/sys/sys/proc.h
>>>> +++ b/sys/sys/proc.h
>>>> @@ -225,6 +225,7 @@ struct thread {
>>>> /* Cleared during fork1() */
>>>> #define	td_startzero td_flags
>>>> 	int		td_flags;	/* (t) TDF_* flags. */
>>>> +	u_int		td_cowgeneration;/* (k) Generation of COW pointers. 
>>>> */
>>>> 	int		td_inhibitors;	/* (t) Why can not run. */
>>>> 	int		td_pflags;	/* (k) Private thread (TDP_*) flags. 
>>>> */
>>>> 	int		td_dupfd;	/* (k) Ret value from fdopen. XXX */
>>> This name is so verbose that it messes up the comment indentation.
>>> 
>> Yeah, that's crap, but the naming is already inconsistent and verbose.
>> For instance there is td_generation alrady.
>> 
>> Is _cowgen variant ok?
> td_cowgen is much preferable  with comment  "(k) generation of c.o.w. 
> pointers."

> +	u_int		td_cowgen;	/* (k) generation of c.o.w. pointers. */

It is less preferable with such a comment.  The change in the comment just
adds 3 style bugs:
- inconsistent capitalization.  In this file, comments on struct members
   start with a capital letter
- punctuation for COW.  Acronyms are not punctuated.  Perhaps this one
   should be in lower case (like vm is usually in lower case).
- verboseness from the previous bug.  It expands the line line to 80.

But there is a problem with the comment.  It doesn't do much more than
echo the variable name with minor expansions and rearrangements.  The
only useful parts of it are "(k)" and "pointers".

Bruce



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