public inbox for linux-man@vger.kernel.org
 help / color / mirror / Atom feed
From: "Alejandro Colomar (man-pages)" <alx.manpages@gmail.com>
To: "G. Branden Robinson" <g.branden.robinson@gmail.com>
Cc: linux-man@vger.kernel.org, Eugene Syromyatnikov <evgsyr@gmail.com>
Subject: Re: [PATCH v3] getrlimit.2: old_getrlimit/ugetrlimit and RLIM_INFINITY discrepancies
Date: Fri, 30 Jul 2021 01:23:21 +0200	[thread overview]
Message-ID: <f69ba7ed-27fb-ad24-8b40-7450b303f59f@gmail.com> (raw)
In-Reply-To: <20210729223535.qvyomfqvvahzmu5w@localhost.localdomain>

Hi Branden,

Thanks for reviewing this!
I didn't have more time today.

Also seeing reviews from different people helps improving my reviews too :)


On 7/30/21 12:35 AM, G. Branden Robinson wrote:
> Hi, Eugene!
> 
> I thought I'd offer some style suggestions since Alex hasn't yet.
> 
> At 2021-07-29T17:44:01+0200, Eugene Syromyatnikov wrote:
>> +The corresponding infinity value constant is provided in
>> +.I <linux/resource.h>
>> +as
>> +.BR RLIM64_INFINITY.
>> +.PP
>> +Original Linux implementation used signed types for limits; that was changed
> 
> Grammatically, you need an article at the beginning of this sentence.
> More broadly, however, what constitutes "*the* original Linux
> implementation" may not be well-defined and is not as relevant to the
> discussion as Linux kernels that were widely deployed.  The earliest
> conveivable Linux attested, what Torvalds produced on his 80386 in 1991
> ("Freax") is less important than Linux 2.4.
> 
> So I would recast and use semantic newlines [see man-pages(7)]:
> 
> 	Linux 2.4 and earlier used signed types for limits;
> 	that was changed
> 
> Alex will surely direct you to the semantic newline advice in
> man-pages(7).

:-)

> 
>     Use semantic newlines
>         In the source of a manual page, new sentences should be started
>         on new lines, and long sentences should  split  into  lines  at
>         clause  breaks  (commas,  semicolons, colons, and so on).  This
>         convention, sometimes known as "semantic  newlines",  makes  it
>         easier to see the effect of patches, which often operate at the
>         level of individual sentences or sentence clauses.
> 
> I won't point out every instance where a semantic newline is preferred.
> 
>> +(along with the value of the
>> +.B RLIM_INFINITY
>> +constant)
> 
> I see there is some precedent in the Linux man-pages to call a
> preprocessor symbol that is replaced with a C language literal a
> "constant".  I would not employ this usage myself, since C has the
> "const" type qualifier that suggests, and is is widely interpreted, as
> "constant".  I think it would be helpful if we referred to as "constant"
> only C objects bearing such a declaration.  Does anyone think this would
> be a worthwhile shift in usage?  (The most important virtue that
> constants in the sense I'm using them have over preprocessor symbols is
> that the former survive the translation process into executable format,
> and (if not optimized out) will appear in a symbol table, which means a
> debugger can know about them.)

I had a look at the Standard to check what wording is used there.  It 
uses "constant" too.  You can find many cases of "decimal constant", 
"double constant", "character constant" in contexts containing also 
"string literal".  Have a special look at the "Constants" section.

https://stackoverflow.com/questions/81656/where-do-i-find-the-current-c-or-c-standard-documents

> 
>> +.\" http://repo.or.cz/davej-history.git/blobdiff/129f8758d8c41e0378ace0b6e2f56bbb8a1ec694..15305d2e69c3a838bacd78962c07077d2821f255:/include/linux/resource.h
>> +during 2.4 development cycle, as it wasn't compatible
> 
> s/during/& the/
> 
>> +with Single UNIX Specification.
> 
> s/with/& the/
> 
>> +However, in order to preserve backward compatibility, the routine
> 
> s/routine/function/ ?
> 
>> +.IR sys_old_getrlimit
>> +has been implemented under
> 
> s/has been/was/
> s/under/using the/
> 
>> +.B __NR_getrlimit
>> +syscall slot, with infinity checks being performed against hard-coded 0x7fffffff
> 
> s/hard-coded/a literal/
> 
>> +value, and the routine
> 
> s/the routine//
> (it will be clear from context that this is another function)
> 
>> +.I sys_getrlimit
>> +has been exposed under a new name,
> 
> s/has been/was/
> s/exposed/made available/
> 
>> +.BR ugetrlimit ().
>> +Note that most newer architectures don't have the latter, with
> 
> s/Note that most/Most/
> 
> I call this a "Kemper notectomy", after my colleague in groff
> development, Dave Kemper, who has pointed out that we tend to massively
> overuse the phrase "note that" in software documentation.  We write for
> impatient readers.  Everything we say in a manual should be worthy of
> note; if it is not, it should be deleted or moved to a place in the text
> reserved for supplemental commentary (a footnote; a (sub)section entitled
> "Background", "History", or "Notes"; or similar).
> 
>> +.BR getrlimit ()
>> +providing proper implementation.
> 
> What's "proper" about it?  That it's unsigned, or that it's conforming?
> Say so.  Again, an article is needed.
> 
> s/proper/a conforming/
> 
>> +Also worth noting that several architectures decided not to change
> 
> I'd condense this.
> 
> s/Also worth noting that/However,
> /
> 
>> +.B RLIM_INFINITY
>> +value: 32-bit mips and sparc (but not 64-bit variants, that switched
> 
> s/mips/MIPS/
> 
> The Linux man-pages are mostly consistent about this casing[1], and it
> is normative[2].
> 
> s/sparc/SPARC/
> 
> The Linux man-pages are mostly consistent about this casing[3], and it
> is normative[4].
> 
>> +to the new value of (~0UL)) retained the old 0x7fffffff value,
>> +and alpha retained 0x7ffffffffffffffful.
> 
> s/alpha/Alpha/
> 
> You can probably guess what I'm going to say.  ;-)

Thanks for this.  I had doubts about how to write those a few months ago 
when I wrote some patches, as I found a mix of them in the pages, and 
wasn't sure which form was more correct.

Cheers,

Alex

> 
>> +.\" ...along with a request to call when one runs into it:
>> +.\" https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/arch/alpha/include/uapi/asm/resource.h#n15
>>   .SH BUGS
>>   In older Linux kernels, the
>>   .B SIGXCPU
> 
> Thank you for your patience with my comments.  I hope they've been
> helpful.
> 
> Regards,
> Branden
> 
> [1] vdso(7) may be an exception.
> [2] https://booksite.elsevier.com/9780124077263/downloads/historial%20perspectives/section_4.16.pdf
> [3] clone(2), syscall(2), and exec(3) may be exceptions.
> [4] https://sparc.org/timeline/
> 


-- 
Alejandro Colomar
Linux man-pages comaintainer; https://www.kernel.org/doc/man-pages/
http://www.alejandro-colomar.es/

  reply	other threads:[~2021-07-29 23:23 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-29 15:44 [PATCH v3] getrlimit.2: old_getrlimit/ugetrlimit and RLIM_INFINITY discrepancies Eugene Syromyatnikov
2021-07-29 22:35 ` G. Branden Robinson
2021-07-29 23:23   ` Alejandro Colomar (man-pages) [this message]
2021-07-30  0:14   ` Eugene Syromyatnikov
2021-07-30  0:51     ` G. Branden Robinson

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f69ba7ed-27fb-ad24-8b40-7450b303f59f@gmail.com \
    --to=alx.manpages@gmail.com \
    --cc=evgsyr@gmail.com \
    --cc=g.branden.robinson@gmail.com \
    --cc=linux-man@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox