From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/426 Path: news.gmane.org!not-for-mail From: Moritz Wilhelmy Newsgroups: gmane.linux.lib.musl.general Subject: Re: Anti-bloat side project Date: Tue, 16 Aug 2011 15:03:50 +0200 Message-ID: <20110816130350.GF26140@barfooze.de> References: <20110627170806.GA24833@brightrain.aerifal.cx> <20110627211625.GC5036@port70.net> <20110627211909.GZ12592@brightrain.aerifal.cx> <20110627213805.GD5036@port70.net> <20110627213739.GA12592@brightrain.aerifal.cx> <20110627214300.GB12592@brightrain.aerifal.cx> <20110629141945.GL5036@port70.net> <20110629192736.GG12592@brightrain.aerifal.cx> <20110629200358.GN5036@port70.net> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1313499849 20626 80.91.229.12 (16 Aug 2011 13:04:09 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Tue, 16 Aug 2011 13:04:09 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-427-gllmg-musl=m.gmane.org@lists.openwall.com Tue Aug 16 15:04:05 2011 Return-path: Envelope-to: gllmg-musl@lo.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by lo.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1QtJJL-0000yo-3u for gllmg-musl@lo.gmane.org; Tue, 16 Aug 2011 15:04:03 +0200 Original-Received: (qmail 32055 invoked by uid 550); 16 Aug 2011 13:04:02 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 32047 invoked from network); 16 Aug 2011 13:04:02 -0000 Content-Disposition: inline In-Reply-To: <20110629200358.GN5036@port70.net> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:426 Archived-At: Hello, While debugging mlmmj, my mailing list manager of choice, I noted that it calls read(2) really, really often, in order to read a single byte out of a fd, and then read the next byte, like this: open("/var/spool/mlmmj/foo/control/listaddress", O_RDONLY) = 4 read(4, "f", 1) = 1 read(4, "o", 1) = 1 read(4, "o", 1) = 1 read(4, "@", 1) = 1 read(4, "l", 1) = 1 read(4, "i", 1) = 1 read(4, "s", 1) = 1 read(4, "t", 1) = 1 read(4, "s", 1) = 1 read(4, ".", 1) = 1 read(4, "e", 1) = 1 read(4, "x", 1) = 1 read(4, "a", 1) = 1 read(4, "m", 1) = 1 read(4, "p", 1) = 1 read(4, "l", 1) = 1 read(4, "e", 1) = 1 read(4, ".", 1) = 1 read(4, "c", 1) = 1 read(4, "o", 1) = 1 read(4, "m", 1) = 1 read(4, "\n", 1) = 1 close(4) = 0 It does this for every file it touches as well as network connections it reads from. I don't know yet, how and why exactly it does it this way, but it seems rather insane to me, so I think it might need some patches in order to clean it up. It turned out that attempting to subscribe someone to a mailing list used 794 read(x, y, 1) style syscalls. I don't think I want to know how often it calls read() in order to post a message to all members of the list. Maybe this could be solved by using getline(3) instead, which is in POSIX.1-2008 and implemented on current versions of at least glibc, FreeBSD, NetBSD and of course musl. I will contact the mlmmj developers and try to resolve the issue. Solar, maybe you should still wait a bit before switching openwall over to mlmmj ;) Best, Moritz