Re: git: f339a3ef6369 - main - dtrace: remove unnecessary fflush()

From: Chuck Silvers <chs_at_FreeBSD.org>
Date: Thu, 10 Feb 2022 19:32:36 UTC
On Thu, Feb 10, 2022 at 02:36:30PM +0100, Mateusz Piotrowski wrote:
> Hello everyone,
> 
> On 10/02/2022 03:48, Chuck Silvers wrote:
> > The branch main has been updated by chs:
> > 
> > URL: https://cgit.FreeBSD.org/src/commit/?id=f339a3ef6369b368f3a2455792a7a3a4c28f92c4
> > 
> > commit f339a3ef6369b368f3a2455792a7a3a4c28f92c4
> > Author:     Chuck Silvers <chs@FreeBSD.org>
> > AuthorDate: 2022-02-10 01:09:26 +0000
> > Commit:     Chuck Silvers <chs@FreeBSD.org>
> > CommitDate: 2022-02-10 01:09:26 +0000
> > 
> >      dtrace: remove unnecessary fflush()
> >      This call was added back in the early days of dtrace porting and
> >      no one knows why anymore.  The extra flushing causes lots of
> >      unnecessary CPU overhead when a script produces lots of output,
> >      as well as easily losing output because the command can't keep up.
> 
> Did you have some specific way to measure the CPU overhead of DTrace here?
> I'm interested in this kind of performance measurements and I wonder if
> anything more sophisticated than observing top(1) was used to test this
> change. Thanks!

I just looked at top and saw that the CPU usage of the dtrace process
dropped from 100% to around 13%.  More importantly, when the fflush was
present dtrace would report that millions of output records were being
dropped, and after the fflush was removed then dtrace no longer reported
any dropped output.

-Chuck