Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 16 Sep 2014 21:50:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 193696] New: CAM AC_FOUND_DEVICE calls malloc(M_WAITOK) from THREAD_NO_SLEEPING() context
Message-ID:  <bug-193696-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=193696

            Bug ID: 193696
           Summary: CAM AC_FOUND_DEVICE calls malloc(M_WAITOK) from
                    THREAD_NO_SLEEPING() context
           Product: Base System
           Version: 11.0-CURRENT
          Hardware: Any
                OS: Any
            Status: Needs Triage
          Severity: Affects Some People
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: smferris@gmail.com

The CAM xpt_done_td is marked THREAD_NO_SLEEPING.  This is problematic since
the AC_FOUND_DEVICE async events still call functions such as disk_alloc() and
devstat_alloc() that malloc with M_WAITOK, so they could sleep, which panics
the
kernel.

You can spot the problem more easily by adding an ASSERT in malloc
that checks for M_WAITOK and THREAD_CAN_SLEEP, and then removing and
re-adding a device at run-time.  At least with mps, the initial device
creation works since it runs from dainit() in an intr config hook.

I'll attach a patch with the assertion that highlights the problem.

-- 
You are receiving this mail because:
You are the assignee for the bug.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-193696-8>