Date: Thu, 29 Jul 1999 17:36:40 -0600 (MDT) From: "David G. Andersen" <danderse@cs.utah.edu> To: Kevin Day <toasty@dragondata.com> Cc: crandall@matchlogic.com (Charles Randall), hackers@FreeBSD.ORG Subject: Re: Replace/rewrite reverse.c for tail(1) Message-ID: <14240.58569.149071.866632@torrey.cs.utah.edu> In-Reply-To: Kevin Day's message of Wed, July 28 1999 <199907290339.WAA95155@celery.dragondata.com> References: <64003B21ECCAD11185C500805F31EC030378660F@houston.matchlogic.com> <199907290339.WAA95155@celery.dragondata.com>
next in thread | previous in thread | raw e-mail | index | archive | help
Er, the original TAC was a BSD utility which was rewritten by Jay
Lepreau at Utah (who also happens to be my boss)... The source for it
that I have sitting around (1986) doesn't actually list a copyright,
but I'm fairly sure that we're in control of the copyright for that
version. The authors are listed as "Unknown off the net long ago, and
Jay Lepreau". :)
It's likely to not be as fast as the newer gnu version, of course, but
if you'd like, I can check on the copyright issue and plop you the
source if it's OK.
-Dave
Lo and Behold, Kevin Day said:
>
> Because of licensing restrictions in our product, we are unable to ship with
> any GNU/GPL'ed tools, so I'm forced to fix 'tail' rather than use tac. (I
> saw tac, and agree that it is faster for this specific use)
>
> Any VM people wanna pipe up and make a suggestion so that I may make up a
> patch?
>
> Kevin
>
>
>
>
> [Charset iso-8859-1 unsupported, filtering to ASCII...]
> > I'd suggest that you use "tac" from GNU textutils.
> >
> > Charles
> >
> > -----Original Message-----
> > From: Kevin Day [mailto:toasty@dragondata.com]
> > Sent: Wednesday, July 28, 1999 3:09 AM
> > To: hackers@freebsd.org
> > Subject: Replace/rewrite reverse.c for tail(1)
> >
> > An application I use quite often requires me to reverse the lines in the
> > file to get the desired output.
> >
> > 'tail -r' appears to be very inefficient in it's use of mmap(). It mmap's
> > the entire file in, which encourages the kernel to swap out the rest of the
> > system to keep pages of the input file in memory.
> >
> > 58350 root 54 0 412M 85244K RUN 0:14 19.78% 19.19% tail
> >
> > Out of 128M of ram, it's swapped nearly everything else out to keep 85M of
> > this 400M file in ram, even though it will never touch it again. :)
> >
> > I see two possible fixes for this. One could be madvise'ing periodically
> > with MADV_DONTNEED. If I understand correctly, this would help a bit, right?
> >
> > Or, mmap smaller regions of the file, and keep moving the buffer. This would
> > also help with files exceeding mmap's limits.
> >
> >
> > Any thoughts?
> >
> >
> > Kevin
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-hackers" in the body of the message
> >
> >
> > To Unsubscribe: send mail to majordomo@FreeBSD.org
> > with "unsubscribe freebsd-hackers" in the body of the message
> >
>
>
>
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message
--
work: danderse@cs.utah.edu me: angio@pobox.com
University of Utah CS Department http://www.angio.net/
"If you haul a geek up a crack, you will bloody their fingers for a day...
If you teach a geek to climb, you will bloody their fingers for life."
To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?14240.58569.149071.866632>
