From owner-freebsd-arch Fri Mar 16 18: 8:44 2001 Delivered-To: freebsd-arch@freebsd.org Received: from thehousleys.net (frenchknot.ne.mediaone.net [24.147.224.201]) by hub.freebsd.org (Postfix) with ESMTP id 6EB6E37B71A for ; Fri, 16 Mar 2001 18:08:39 -0800 (PST) (envelope-from jim@thehousleys.net) Received: (from root@localhost) by thehousleys.net (8.11.3/8.11.2) id f2H28RM03594; Fri, 16 Mar 2001 21:08:27 -0500 (EST) (envelope-from jim@thehousleys.net) Received: from thehousleys.net (baby.int.thehousleys.net [192.168.0.24]) by thehousleys.net (8.11.3/8.11.3) with ESMTP id f2H28Of03586; Fri, 16 Mar 2001 21:08:25 -0500 (EST) (envelope-from jim@thehousleys.net) Message-ID: <3AB2C718.B31B29C3@thehousleys.net> Date: Fri, 16 Mar 2001 21:08:24 -0500 From: James Housley X-Mailer: Mozilla 4.76 [en] (X11; U; Linux 2.2.12 i386) X-Accept-Language: en MIME-Version: 1.0 To: Dima Dorfman Cc: freebsd-arch@freebsd.org Subject: Re: Inherate nodump cause significant slow down of dump References: <20010317015657.C47D03E1E@bazooka.unixfreak.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: by AMaViS perl-10 Sender: owner-freebsd-arch@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG Dima Dorfman wrote: > > [ Should this really be on -arch? ] > > James Housley writes: > > Dima Dorfman wrote: > > > I'm not terribly opposed to this, but OTOH I don't see why it's > > > necessary. The slowdown only occurs if you set nodump on a directory. > > > With the old behavior, this wouldn't do anything useful (AFAIK), so if > > > you have nodump on a directory, you probably expect the new behavior. > > > The latter has a problem with taking more time than it should (I think > > > it actually takes the same amount of time as dumping everything under > > > the nodump'd directory would). In other words, the only thing that's > > > broken is the new feature. > > > > > > > I haven't tested this yet, but should be able to tomorrow. But I > > believe that if I do chflags -R nodump /usr/ports it will not a > > significant more amount of time to process, throught Phase II, then with > > out the nodump flags under the old version. > > I just tried it, and, as I suspected, it isn't the case. The slowdown > is caused by the fact that for every directory with subdirectories and > the nodump flag set, mapdirs returns 1, which causes it to be run > again. You can test this theory by commenting out lines 250 and 251 > in rev. 1.12 of traverse.c (this will fix the slowdown, but break > everything else). Okay. > > > I am also guessing the with the new version chflags -R nodump /usr/ports > > will be about the same amount of time as with the old code. I am not > > opposed to the feature. Acutally I was suprised that that is not the > > way it worked when I first found the flag. However, there has to be a > > better way to implement it. > > dump's tree-walker is braindead. It can be implemented by adding > another pass; I don't know if that will make it better or worse. If I > can't fix this, I'll try that. > Talking about 1.12 traverse.c, about line #160 in mapfiles() /* * All dirs go in dumpdirmap; only inodes that are to * be dumped go in usedinomap and dumpinomap, however. */ if (mode == IFDIR) SETINO(ino, dumpdirmap); ------------------------^^^^^^^^^^^^^^^^^^^^^^^^ if (WANTTODUMP(dp)) { SETINO(ino, usedinomap); SETINO(ino, dumpinomap); if (mode != IFREG && mode != IFDIR && mode != IFLNK) *tapesize += 1; else *tapesize += blockest(dp); continue; } if (mode == IFDIR) anydirskipped = 1; Why is a directory added without checking for the nodump flag? Because isn't then just removed later in mapdirs()? Wouldn't this work better? I don't fully understand all the code yet, but I am looking. /* * All dirs go in dumpdirmap; only inodes that are to * be dumped go in usedinomap and dumpinomap, however. */ if (mode == IFDIR) - SETINO(ino, dumpdirmap); + if (WANTTODUMP(dp)) + SETINO(ino, dumpdirmap); + else { + anydirskipped = 1; + continue; + } if (WANTTODUMP(dp)) { SETINO(ino, usedinomap); SETINO(ino, dumpinomap); if (mode != IFREG && mode != IFDIR && mode != IFLNK) *tapesize += 1; else *tapesize += blockest(dp); continue; } if (mode == IFDIR) anydirskipped = 1; Jim -- /"\ ASCII Ribbon Campaign . \ / - NO HTML/RTF in e-mail . X - NO Word docs in e-mail . / \ ----------------------------------------------------------------- jeh@FreeBSD.org http://www.FreeBSD.org The Power to Serve jim@TheHousleys.Net http://www.TheHousleys.net --------------------------------------------------------------------- If it happens once, it's a bug. If it happens twice, it's a feature. If it happens more than twice, it's windows. -- Luiz de Barros To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-arch" in the body of the message