From owner-svn-src-all@FreeBSD.ORG Fri Nov 19 21:46:42 2010 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from [127.0.0.1] (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by hub.freebsd.org (Postfix) with ESMTP id 1AF1B1065907; Fri, 19 Nov 2010 21:46:35 +0000 (UTC) (envelope-from jkim@FreeBSD.org) From: Jung-uk Kim To: Attilio Rao Date: Fri, 19 Nov 2010 16:46:17 -0500 User-Agent: KMail/1.6.2 References: <201011191943.oAJJhv3i087205@svn.freebsd.org> <201011191621.25520.jhb@freebsd.org> In-Reply-To: MIME-Version: 1.0 Content-Disposition: inline Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 8bit Message-Id: <201011191646.20048.jkim@FreeBSD.org> Cc: svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org, John Baldwin Subject: Re: svn commit: r215544 - head/sys/kern X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 19 Nov 2010 21:46:42 -0000 On Friday 19 November 2010 04:31 pm, Attilio Rao wrote: > 2010/11/19 John Baldwin : > > On Friday, November 19, 2010 4:09:28 pm Jung-uk Kim wrote: > >> On Friday 19 November 2010 02:43 pm, Attilio Rao wrote: > >> > Author: attilio > >> > Date: Fri Nov 19 19:43:56 2010 > >> > New Revision: 215544 > >> > URL: http://svn.freebsd.org/changeset/base/215544 > >> > > >> > Log: > >> >   Scan the list in reverse order for the shutdown handlers of > >> > loaded modules. This way, when there is a dependency between > >> > two modules, the handler of the latter probed runs first. > >> > > >> >   This is a similar approach as the modules are unloaded in > >> > the same linkerfile. > >> > > >> >   Sponsored by:     Sandvine Incorporated > >> >   Submitted by:     Nima Misaghian >> > com> MFC after:        1 week > >> > >> Hmm...  It is not directly related but I was thinking about > >> doing similar things for sys/kern/subr_bus.c.  What do you think > >> about the attached patch? > > > > Hmm, the patches for suspend and resume that I had for this took > > the opposite order, they did suspend in forward order, but resume > > in backwards order. Like so: > > > > --- //depot/vendor/freebsd/src/sys/kern/subr_bus.c     > >  2010-11-17 22:30:24.000000000 0000 +++ > > //depot/user/jhb/acpipci/kern/subr_bus.c    2010-11-19 > > 17:19:02.000000000 00 @@ -3426,9 +3429,9 @@ > >        TAILQ_FOREACH(child, &dev->children, link) { > >                error = DEVICE_SUSPEND(child); > >                if (error) { > > -                       for (child2 = > > TAILQ_FIRST(&dev->children); -                            child2 > > && child2 != child; > > -                            child2 = TAILQ_NEXT(child2, link)) > > +                       for (child2 = TAILQ_PREV(child, > > device_list, link); +                            child2 != NULL; > > +                            child2 = TAILQ_PREV(child2, > > device_list, link)) DEVICE_RESUME(child2); > >                        return (error); > >                } > > @@ -3447,7 +3450,7 @@ > >  { > >        device_t        child; > > > > -       TAILQ_FOREACH(child, &dev->children, link) { > > +       TAILQ_FOREACH_REVERSE(child, &dev->children, device_list, > > link) { DEVICE_RESUME(child); > >                /* if resume fails, there's nothing we can > > usefully do... */ } > > > > (Likely mangled whitespace.) > > > > I couldn't convince myself which order was "more" correct for > > suspend and resume. > > Considering loading in starting point, I think suspend should go in > reverse logic and resume in the same module load logic. > So that dependent modules are suspended first and resumed after. > Don't you agree? That's exactly what I was thinking. :-) Jung-uk Kim