All of lore.kernel.org
 help / color / mirror / Atom feed
From: Lukas Wunner <lukas@wunner.de>
To: Stuart Hayes <stuart.w.hayes@gmail.com>
Cc: linux-kernel@vger.kernel.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"Rafael J . Wysocki" <rafael@kernel.org>,
	Tanjore Suresh <tansuresh@google.com>,
	Martin Belanger <Martin.Belanger@dell.com>,
	Oliver O'Halloran <oohall@gmail.com>,
	Daniel Wagner <dwagner@suse.de>, Keith Busch <kbusch@kernel.org>
Subject: Re: [PATCH] driver core: shut down devices asynchronously
Date: Wed, 16 Aug 2023 17:54:35 +0200	[thread overview]
Message-ID: <20230816155435.GA18922@wunner.de> (raw)
In-Reply-To: <20230816154518.3487-1-stuart.w.hayes@gmail.com>

On Wed, Aug 16, 2023 at 10:45:18AM -0500, Stuart Hayes wrote:
> Attempt to shut down devices asynchronously, by making a tree of devices with
> associated work and completion structs, to ensure that child devices are shut
> down before parents.
> 
> This can dramatically reduce system shutdown/reboot time on systems that have
> devices that take many seconds to shut down, such as some NVMe drives.  On once
> system tested, the shutdown time went from 11 minutes before the patch to 55
> seconds with the patch.
> 
> The code could be simplified by adding the work and completion structs to
> struct device, but it may make more sense to not burden it with that when there
> is likely enough memory to allocate this at shutdown time, and if there isn???t,
> it just falls back to the current synchronous shutdown.

Please wrap the commit message at 72 chars.

Is there a particular reason why you're not using the infrastructure
provided by kernel/async.c and <async.h>, such as async_schedule()?
It wraps all the work_struct plumbing and also has helpers to await
completion.  I imagine using that might reduce LoC in this patch.

Thanks,

Lukas

  reply	other threads:[~2023-08-16 15:55 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-16 15:45 [PATCH] driver core: shut down devices asynchronously Stuart Hayes
2023-08-16 15:54 ` Lukas Wunner [this message]
2023-08-16 19:42   ` stuart hayes
2023-08-16 19:52     ` Lukas Wunner
2023-08-16 22:07 ` kernel test robot
2023-08-17  0:10 ` kernel test robot

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=20230816155435.GA18922@wunner.de \
    --to=lukas@wunner.de \
    --cc=Martin.Belanger@dell.com \
    --cc=dwagner@suse.de \
    --cc=gregkh@linuxfoundation.org \
    --cc=kbusch@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=oohall@gmail.com \
    --cc=rafael@kernel.org \
    --cc=stuart.w.hayes@gmail.com \
    --cc=tansuresh@google.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.