Source-Changes-D archive

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

re: CVS commit: src/sys/dev/pci



"Nick Hudson" writes:
> Module Name:	src
> Committed By:	skrll
> Date:		Fri Sep 16 03:55:53 UTC 2022
>
> Modified Files:
> 	src/sys/dev/pci: if_aq.c
>
> Log Message:
> Some MP improvements
>
> - Remove use of IFF_OACTIVE
>
> - Remove use of if_timer and provide an MP safe multiqueue watchdog
>
> - Sprinkle some lock assertions.
>
> Tested by ryo@. Thanks.

this asserts for me.  perhaps ryo@ didn't have LOCKDEBUG?

the problem is that aq_init() calls AQ_LOCK(sc) -- this is
a spin mutex -- and then calls aq_init_locked().  however,
aq_init_locked() calls ASSERT_SLEEPABLE() since it has a
code path that calls callout_halt() (which wants to sleep.)

ie, the function that expects to be called with a spin
mutex held also calls ASSERT_SLEEPABLE().  even if i were
to comment that call, the later call to callout_halt() is
the real problem.

the only way i saw to handle this without investing some
other method to invoke the callout_halt() from another lwp
was to change aq_stop_locked() to return a value that says
that callout_halt is needed here.  that needs to be passed
upto aq_stop() as well as aq_init(), both of which call
aq_stop_locked().  it needs a little re-arrange due to
aq_init_locked() already returning a value for aq_init()
to return directly (and aq_init() is where the mutex will
be dropped, and it's safe to callout_halt().)

for now i'm running with rev 1.32.

thanks.


.mrg.


Home | Main Index | Thread Index | Old Index