From owner-freebsd-current@FreeBSD.ORG Sat Aug 1 18:34:57 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 29DEC106566B; Sat, 1 Aug 2009 18:34:57 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-bw0-f206.google.com (mail-bw0-f206.google.com [209.85.218.206]) by mx1.freebsd.org (Postfix) with ESMTP id 772AB8FC17; Sat, 1 Aug 2009 18:34:56 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: by bwz2 with SMTP id 2so1647451bwz.43 for ; Sat, 01 Aug 2009 11:34:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type:content-transfer-encoding; bh=lm9o2QpyUIORk4foAMjpIF29sfO8zFkuCX/XblmbIX4=; b=kF5WeVyMrADQCWHvW8Ok1EpoWw9OLzNBQaniHsPJp7klHs9emOilG/o+tlq80Aaj74 XH7j1l0DVa/9j7BWCDnDeakEj4tRUBgoNIjf3T6f7T6nfetRdS/WsTuX49UCO39zBN30 wbnom6uWBZik18i1tRfdgEeMT85n+xLqOPrUU= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; b=oZeVs27+m8BBD0znB9j+yVQKpV6FlIXICgXQ+urX37ZnON/mkbA909/XePLp/hZx87 zWYtNxGxjfZ2gQjdqcIKFeVAR/U2vmeQiFyWxDS4XqDZetrbUEizegyxgP5nYEwgWkKu JlSxApXLAW/UogN3YxxM/d1UzRcXD02JWQ26c= MIME-Version: 1.0 Sender: asmrookie@gmail.com Received: by 10.223.108.211 with SMTP id g19mr1966526fap.39.1249151695332; Sat, 01 Aug 2009 11:34:55 -0700 (PDT) In-Reply-To: <200908010630.21366.hselasky@c2i.net> References: <3bbf2fe10907310759o3be1f565t4122fcd66c4531f4@mail.gmail.com> <200907311919.26913.hselasky@c2i.net> <4e6cba830907311917j5d3c0eb6u7f7b1099d3acd504@mail.gmail.com> <200908010630.21366.hselasky@c2i.net> Date: Sat, 1 Aug 2009 20:34:55 +0200 X-Google-Sender-Auth: 48f3c059acae1383 Message-ID: <3bbf2fe10908011134h760f1c37y694acd8f37c120e6@mail.gmail.com> From: Attilio Rao To: Hans Petter Selasky Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Cc: Peter Holm , Giovanni Trematerra , freebsd-current@freebsd.org Subject: Re: [PATCH] Newbus locking X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 18:34:58 -0000 2009/8/1 Hans Petter Selasky : > On Saturday 01 August 2009 04:17:42 Giovanni Trematerra wrote: >> > On Fri, Jul 31, 2009 at 7:19 PM, Hans Petter Selasky >> > wrote: >> > >> > >> > I'm not saying that your approach will not work or that it is wrong. I'm >> > saying that it is not fast enough. Your patch affects the boottime, in a >> > negative way. >> >> I tested a patch for a while. I didn't notice any slow down in boot time. >> Well, I haven't measured it but I can't see any noticeable difference >> even booting from an USB key. > > Hi, > > We are talking about some seconds. Store the "ticks" varible in "usb_attach()" > in sys/dev/usb/controller/usb_controller.c and print out the difference every > time "usb_bus_explore()" is called having "if (bus->bus_roothold != NULL)". So, thanks to the precious help of Peter Holm I worked on this patch fixing 3 problems reported by Peter and addressing the Hans' concern: now newbus lock is not held for the whole duration of explore handler, but just acquired and released when needed (really modifying the newbus subtree). I think it can also be faster than the Giant version now. New patch is here: http://www.freebsd.org/~attilio/Yahoo/newbus/newbus_locking4.diff Please let me know if you can note any regressions. Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein