[prev in list] [next in list] [prev in thread] [next in thread] 

List:       netbsd-current-users
Subject:    Re: coretemp0: workqueue busy: updates stopped
From:       "J. Hannken-Illjes" <hannken () eis ! cs ! tu-bs ! de>
Date:       2015-06-24 9:13:48
Message-ID: B46209EC-77B3-42C0-B526-6D18A14446EF () eis ! cs ! tu-bs ! de
[Download RAW message or body]

On 24 Jun 2015, at 10:51, Paul Goyette <paul@vps1.whooppee.com> wrote:

<snip>
> 
> There is a rather "interesting" mutex-dance in sme_check_events() about
> which I need to think:
> 
> 	mutex_enter(wq_mutex)
> 	check for empty wq
> 	mutex_exit(wq_mutex)
> 
> 	mutex_enter(global_sysmon_mutex)
> 	mutex_enter(wq_mutex)
> 	queue up the wq entries
> 	mutex_exit(wq_mutex)
> 	check for low_power condition
> 	mutex_exit(global_sysmon_mutex)
> 
> I'm pretty sure this can be reduced a bit:
> 
> 	mutex_enter(global_sysmon_mutex)
> 	mutex_enter(wq_mutex)
> 	check for empty wq
> 
> 	queue up the wq entries
> 	mutex_exit(wq_mutex)
> 	check for low_poer condition
> 	mutex_exit(global_sysmon_mutex)

It can't, see rev. 1.114:

Add a counter of busy events and stop enqueueing more work if a device is busy.
Protect this counter with a new short time lock "sme_work_mtx" and
keep "sme_mtx" as long time lock.

Removes a deadlock where an active event holds "sme_mtx", the callout
"sme_events_check" blocks on "sme_mtx" and callout processing stops.

--
J. Hannken-Illjes - hannken@eis.cs.tu-bs.de - TU Braunschweig (Germany)

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic