Page MenuHomeFreeBSD

Debugging for arrival / depature code.
ClosedPublic

Authored by imp on Jan 25 2018, 4:20 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Apr 19, 10:58 PM
Unknown Object (File)
Mar 21 2024, 12:43 PM
Unknown Object (File)
Mar 7 2024, 11:45 PM
Unknown Object (File)
Jan 21 2024, 5:20 PM
Unknown Object (File)
Jan 7 2024, 4:35 AM
Unknown Object (File)
Dec 23 2023, 10:45 AM
Unknown Object (File)
Dec 1 2023, 2:13 PM
Unknown Object (File)
Sep 6 2023, 4:21 PM
Subscribers
None

Details

Summary

Mitigate the as-yet-unknown race in device departure.

When devices are invalidated, there's some cases where ccbs for that
device still wind up in xpt_done after the path has been
invalidated. Since we don't always need sim or devq, add some guard
rails to only fail if we have to use them.

Track Ref / DeRef and Hold / Unhold that da is doing to track down
leaks. We assume each source can be taken / dropped only once and
don't recurse.

Likely needs #ifdef INVARIANTS for upstream.

Test Plan

So this is pretty green...

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

imp added reviewers: ken, scottl.
scottl requested changes to this revision.Jan 25 2018, 2:29 PM
scottl added inline comments.
sys/cam/cam_xpt.c
5429 ↗(On Diff #38421)

My compiler barfed on this, wanted the expression to be (sim != NULL)

5445 ↗(On Diff #38421)

Same here

This revision now requires changes to proceed.Jan 25 2018, 2:29 PM
sys/cam/cam_xpt.c
5429 ↗(On Diff #38421)

Whoops, had it backwards, the msg needs to be in the ellipsis.

Something in this patch is causing my system to spontaneously reboot late in the boot process. No panic, and the messages on the screen disappear too quickly (and are erased in the serial console by the BIOS splash screen).

This looks good and should catch duplicate releases or a release without an acquire. But obviously we need to figure out why Scott's machine is rebooting with it.

OK, cope with cam_periph_acquire returing CAM values and
cam_periph_hold returning 0/1.

I think you forgot to add the implementation for CAM_PERIPH_PRINT(). Mine looks like this in cam_periph.h:

#define CAM_PERIPH_PRINT(periph, msg, args...) \

printf("%s%d:" msg, (periph)->periph_name, (periph)->unit_number, ##args)

I chose not to do xpt_print() because I wanted a more compact print that didn't have the B:T:L noise in it.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 25 2018, 9:38 PM
This revision was automatically updated to reflect the committed changes.