tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

scheduler support to lock user processes out?

A major problem which causes instability if a system is
suspended through pmf is that user processes are still
running while the device tree is traversed and devices
are prepared for a low-power state. If a process tries
to access a device which was already prepared for sleep,
all kinds of nasty things can happen.
As things look now, kernel threads, timeouts etc are still
needed in that phase, so some brute-force approach (eg mutex)
stopping everything wouldn't work.

It has been suggested and reported that putting all CPUs
than the primary one into offline state before helps a lot.
This supports what I'm saying, and it appearently makes
system suspend working well in almost all practical cases,
but as I understand it it is not 100% safe: While the one
primary CPU left is doing the device traversal and thus
can't do anything else, it can still happen that the kernel
thread doing this sleeps for a while, and a user lwp gets

How can one make that only kernel threads are run, without
runtime cost in normal operation?
Something simply based on priorities wouldn't work because
there might be user realtime processes which are above
kernel threads. Otoh, having realtime processes run while
the system is suspended sounds somehow strange... but we
are not talking about realtime in an industrial sense so we
should be reasonable. (Or better be strict and don't allow
a system be suspended as long as realtime processes are
running? I'm not sure here.)

Any ideas?

best regards

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