tech-kern archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: scheduler support to lock user processes out?
dyoung%pobox.com@localhost said:
> Suspension is not an all-or-nothing affair: it is both possible and
> desirable to suspend individual device sub-trees.
The S3 vs suspend-devices-to-save-power thing again...
> A driver is broken if it will touch the hardware it controls while that
> hardware is suspended.
If one suspends a device due to power savings policy or on
user request, this should be only done if the device is
not in use. If the device is needed, it must be resumed.
(There are sleep depth vs latency tradeoffs which should
be dealt with eventually.)
This can be managed with only a few hooks in the drivers,
eg in open/close or network up/down, and these hooks are
generally not in performance critical paths. (Shared interrupts
need to be considered, and likely some more details...)
This way, no user process can enter the driver as long
as the device is suspended.
System sleep is different: User processes still have the
device opened, they can even sleep within driver calls.
If you'd want to allow to suspend a device while user processes
are having it open you'd need to place hooks on every driver entry,
and after every function call which might sleep, which would
mean a lot of code in performance critical paths.
(And even that would not be sufficient if the driver
was MP capable.)
So to solve this dilemma I don't have a better idea
than to stop the user processes somehow, at least
these which have a device opened. Whether with scheduler
help or mutexes at the right places or completely different
is another question.
best regards
Matthias
-------------------------------------------------------------------
-------------------------------------------------------------------
Forschungszentrum Juelich GmbH
52425 Juelich
Sitz der Gesellschaft: Juelich
Eingetragen im Handelsregister des Amtsgerichts Dueren Nr. HR B 3498
Vorsitzende des Aufsichtsrats: MinDir'in Baerbel Brumme-Bothe
Geschaeftsfuehrung: Prof. Dr. Achim Bachem (Vorsitzender),
Dr. Ulrich Krafft (stellv. Vorsitzender), Prof. Dr. Harald Bolt,
Dr. Sebastian M. Schmidt
-------------------------------------------------------------------
-------------------------------------------------------------------
Home |
Main Index |
Thread Index |
Old Index