svn commit: r272366 - head/sys/kern
Mateusz Guzik
mjguzik at gmail.com
Wed Oct 1 18:18:32 UTC 2014
On Wed, Oct 01, 2014 at 03:32:29PM +0000, Will Andrews wrote:
> Author: will
> Date: Wed Oct 1 15:32:28 2014
> New Revision: 272366
> URL: https://svnweb.freebsd.org/changeset/base/272366
>
> Log:
> In the syncer, drop the sync mutex while patting the watchdog.
>
> Some watchdog drivers (like ipmi) need to sleep while patting the watchdog.
> See sys/dev/ipmi/ipmi.c:ipmi_wd_event(), which calls malloc(M_WAITOK).
>
Is not such malloc inherently bad in case of watchdog?
It looks like the code waits for request completion and then frees it
unconditionally. As such, a local var on stack would do the trick.
The code msleeps later, so this hack of dropping sync_mtx is still
needed.
> Submitted by: asomers
> MFC after: 1 month
> Sponsored by: Spectra Logic
> MFSpectraBSD: 637548 on 2012/10/04
>
> Modified:
> head/sys/kern/vfs_subr.c
>
> Modified: head/sys/kern/vfs_subr.c
> ==============================================================================
> --- head/sys/kern/vfs_subr.c Wed Oct 1 15:23:23 2014 (r272365)
> +++ head/sys/kern/vfs_subr.c Wed Oct 1 15:32:28 2014 (r272366)
> @@ -1863,8 +1863,15 @@ sched_sync(void)
> continue;
> }
>
> - if (first_printf == 0)
> + if (first_printf == 0) {
> + /*
> + * Drop the sync mutex, because some watchdog
> + * drivers need to sleep while patting
> + */
> + mtx_unlock(&sync_mtx);
> wdog_kern_pat(WD_LASTVAL);
> + mtx_lock(&sync_mtx);
> + }
>
> }
> if (syncer_state == SYNCER_FINAL_DELAY && syncer_final_iter > 0)
>
--
Mateusz Guzik <mjguzik gmail.com>
More information about the svn-src-all
mailing list