From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>,
Arjan van de Ven <arjan@linux.intel.com>,
"Luis R. Rodriguez" <mcgrof@do-not-panic.com>,
falcon@meizu.com, tiwai@suse.de, tj@kernel.org,
linux-kernel@vger.kernel.org, oleg@redhat.com,
akpm@linux-foundation.org, penguin-kernel@i-love.sakura.ne.jp,
joseph.salisbury@canonical.com, bpoirier@suse.de,
Mel Gorman <mgorman@suse.de>
Subject: Re: [RFC v1 0/3] driver-core: add asynch module loading support
Date: Thu, 4 Sep 2014 23:21:18 +0200 [thread overview]
Message-ID: <20140904212118.GB3347@wotan.suse.de> (raw)
In-Reply-To: <20140831204035.GA4793@kroah.com>
On Sun, Aug 31, 2014 at 01:40:35PM -0700, Greg KH wrote:
> On Sun, Aug 31, 2014 at 01:14:07PM -0700, Dmitry Torokhov wrote:
> > On Sun, Aug 31, 2014 at 12:31:40PM -0700, Greg KH wrote:
> > > On Sun, Aug 31, 2014 at 12:24:46PM -0700, Arjan van de Ven wrote:
> > > > >>before we added the current async approach the approach of async init calls was tried
> > > > >>At the time, Linus hated it and he was right, it was not the right thing.
> > > > >>
> > > > >>What is different this time to make this the right thing to do ?
> > > > >
> > > > >Because otherwise drivers still have to do this, but open code it. Let's say I
> > > > >have a long operations (i.e. for some touchpads it takes about 2 secs to reset
> > > > >and configure it). I can offload that part into async_schedule() so it does not
> > > > >stop initialization of the rest of the system (why would I want to delay
> > > > >initializing of USB or storage system until touchpad is ready?) but if that
> > > > >initialization fails we end up with partially bound driver and device that is
> > > > >not really operable. I would very much prefer async and sync cases be the same
> > > > >- if probe() fails the driver is not bound to the device.
> > > > >
> > > > >I think it is wrong to make async probing system-wide, but driver opt-in shoudl
> > > > >be fine and right thing to do.
> > > > >
> > > >
> > > > I am completely fine if we make basically an async wrapper for
> > > > pci_register_driver() and friends.. that would be convenient I suppose.
> > > >
> > > > (but then again, in reality very few drivers take real time to init... most already
> > > > do the heavy work in open(). Not all can, sure, but if you look at a bootgraph.pl
> > > > graph of a typical boot it's only a few that matter).
> >
> > Input devices normally can't as we need to publish their capabilities before
> > users start opening them.
> >
> > > > And many drivers need to register with a subsystem, and there's some ordering around that,
> > > > and that's why we ended up with the async cookie stuff, so that you can do the
> > > > heavy work in parallel, but order near the end at registeration-with-the-subsystem time.
> > > >
> > > > But doing this on an initcall level was wrong back then, and I have yet to hear
> > > > a reason why it would be right this time.
> > >
> > > It's still wrong, it's not what I was thinking about when talking this
> > > over with Luis and Dmitry, I think something got lost in the
> > > translation...
> >
> > Right, all (well almost all) I wanted is for individual drivers to declare
> > their probe() functions asynchronous and driver core scheduling async attach
> > and properly handle failures from it.
>
> Yes, that's what I want as well.
>
> Luis, care to redo the patches in this way? It should be a lot simpler
> (no messing around with init levels and linker fun...)
Sure, when we spoke the requirement was indeed clear but as I noted on
the description on this cover letter as I reviewed Wu Zhangjin's RFC
which used async_schedule() he ran into the issue of eventually grouping
things. I went with this approach as a first shot given that we have a long
tested set of groupings already done by the kernel so this tried to take
advantage of that should we try to scale on asynchronous probing.
I still believe its a good approach if we wanted to scale it but that
would require the desire to do so, I obviously considered it worthwhile
as I shaved off at least ~1 second off kernel boot time when doing an
original proof of concept and only doing drivers, and taking into
consideration my kenrel takes ~5 seconds before userspace is reached.
I'll toss this in the bin for now though and send something based on
Tejun's approach shortly!
Luis
next prev parent reply other threads:[~2014-09-04 21:21 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-31 9:03 Luis R. Rodriguez
2014-08-31 9:03 ` [RFC v1 1/3] driver-core: split module_init() and module_exit() Luis R. Rodriguez
2014-08-31 9:03 ` [RFC v1 2/3] async: move synchronous caller into a helper Luis R. Rodriguez
2014-08-31 9:03 ` [RFC v1 3/3] async: add driver asynch levels Luis R. Rodriguez
2014-08-31 10:13 ` [RFC v1 0/3] driver-core: add asynch module loading support Tejun Heo
2014-08-31 11:02 ` Tejun Heo
2014-08-31 11:05 ` Tejun Heo
2014-08-31 17:52 ` Dmitry Torokhov
2014-08-31 19:26 ` Arjan van de Ven
2014-08-31 20:11 ` Dmitry Torokhov
2014-08-31 11:25 ` David Herrmann
2014-08-31 11:38 ` Tejun Heo
2014-08-31 18:28 ` Dmitry Torokhov
2014-08-31 22:02 ` Tejun Heo
2014-08-31 23:06 ` Dmitry Torokhov
2014-08-31 23:40 ` Tejun Heo
2014-08-31 14:44 ` Arjan van de Ven
2014-08-31 17:50 ` Dmitry Torokhov
2014-08-31 19:24 ` Arjan van de Ven
2014-08-31 19:31 ` Greg KH
2014-08-31 20:14 ` Dmitry Torokhov
2014-08-31 20:40 ` Greg KH
2014-08-31 21:53 ` Tejun Heo
2014-08-31 22:15 ` Greg KH
2014-08-31 22:53 ` Tejun Heo
2014-08-31 23:20 ` Arjan van de Ven
2014-08-31 23:29 ` Tejun Heo
2014-08-31 22:51 ` Dmitry Torokhov
2014-08-31 23:03 ` Tejun Heo
2014-09-04 21:21 ` Luis R. Rodriguez [this message]
2014-09-04 21:52 ` Greg KH
2014-08-31 16:41 ` Greg KH
[not found] <99jhsb6abtsilpt3j5nu991b.1409513632114@email.android.com>
2014-08-31 22:32 ` Arjan van de Ven
2014-08-31 22:45 ` Dmitry Torokhov
2014-08-31 22:48 ` Arjan van de Ven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20140904212118.GB3347@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=akpm@linux-foundation.org \
--cc=arjan@linux.intel.com \
--cc=bpoirier@suse.de \
--cc=dmitry.torokhov@gmail.com \
--cc=falcon@meizu.com \
--cc=gregkh@linuxfoundation.org \
--cc=joseph.salisbury@canonical.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mcgrof@do-not-panic.com \
--cc=mgorman@suse.de \
--cc=oleg@redhat.com \
--cc=penguin-kernel@i-love.sakura.ne.jp \
--cc=tiwai@suse.de \
--cc=tj@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®