From owner-svn-src-head@FreeBSD.ORG Sat Aug 1 05:12:01 2009 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9CAF21067C69; Sat, 1 Aug 2009 05:11:41 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from pooker.samsco.org (pooker.samsco.org [168.103.85.57]) by mx1.freebsd.org (Postfix) with ESMTP id 2EB878FC1A; Sat, 1 Aug 2009 05:11:40 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from phobos.local (pooker.samsco.org [168.103.85.57]) by pooker.samsco.org (8.14.2/8.14.2) with ESMTP id n715BQrd080182; Fri, 31 Jul 2009 23:11:27 -0600 (MDT) (envelope-from scottl@samsco.org) Message-ID: <4A73CE7E.9060609@samsco.org> Date: Fri, 31 Jul 2009 23:11:26 -0600 From: Scott Long User-Agent: Mozilla/5.0 (Macintosh; U; Intel Mac OS X; en-US; rv:1.8.1.13) Gecko/20080313 SeaMonkey/1.1.9 MIME-Version: 1.0 To: Scott Long , Dmitry Marakasov , Alfred Perlstein , svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, src-committers@FreeBSD.org References: <200907300014.n6U0EZ77086341@svn.freebsd.org> <20090801022914.GB93222@hades.panopticon> <4A73AF67.3010508@samsco.org> <20090801050053.GB8399@doormat.home> In-Reply-To: <20090801050053.GB8399@doormat.home> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.5 required=3.8 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.8 X-Spam-Checker-Version: SpamAssassin 3.1.8 (2007-02-13) on pooker.samsco.org Cc: Subject: Re: svn commit: r195960 - in head/sys/dev/usb: . controller input X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 05:12:01 -0000 Navdeep Parhar wrote: > On Fri, Jul 31, 2009 at 08:58:47PM -0600, Scott Long wrote: >> Dmitry Marakasov wrote: >>> * Navdeep Parhar (nparhar@gmail.com) wrote: >>> >>>> This has slowed down core dumps very significantly. What used to take 10-15s on >>>> my system now takes around 3 minutes. >>> Same here. >>> >> Likely because prior to polling being implemented, each i/o was done >> blindly and completed immediately instead of waiting for actual >> confirmation from the hardware. Crashdumps have been slow for a >> number of years, thanks to a fundamental change in how they are done. >> Until now, USB was cheating and making them look fast. > > I'm afraid I did not understand your email. I was talking about > crashdump time differences between yesterday and the day before, not > "over a number of years." Are there any other issues involved here? > Crashdumps work by the crashdump routine sending an i/o one-at-a-time to the disk driver, waiting for a completion response between each i/o. Polling in the disk driver is used to detect when the disk hardware has completed each i/o request. Since it is done completely serially and completely synchronously, it's very slow because it has to wait for the hardware to process each i/o, one at a time. Prior to yesterday, the usb2 stack did not implement polling. The umass disk driver completely ignored polling, and always immediately returned success. So instead of waiting for the hardware to complete each crashdump i/o request, it immediately returned success and allowed the crashdump routine to send a new i/o. It was short cutting the required process. Now that polling is in place, the shortcut is gone, and crashdumps on USB are back to being slow, just like on every other disk driver. The shortcut is fast, but it's also unsafe; it's bypassing the guarantee that every i/o is getting written without error and without overrunning the speed of the disk media. I mention "over a number of years" because the crashdump routine wasn't always designed to be so slow. But, that's how it is now, and there isn't much that can be done in the USB driver to fix it, short of going back to the unsafe shortcut. Scott