lkml.org 
[lkml]   [2023]   [Aug]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH] driver core: shut down devices asynchronously
From


On 8/16/2023 10:54 AM, Lukas Wunner wrote:
> 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.
>

Thanks

> 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.
>

Not a good one. Let me look into this, thank you.

\
 
 \ /
  Last update: 2023-08-16 21:43    [W:0.049 / U:0.724 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site