The following reply was made to PR kern/58043; it has been noted by GNATS.
From: "J. Hannken-Illjes" <hannken%mailbox.org@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc:
Subject: Re: kern/58043: kernel crash in assert_sleepable() in -current, dk(4)
driver?
Date: Mon, 18 Mar 2024 10:52:09 +0100
--Apple-Mail=_C00F97DB-BCE8-4515-9DA6-D93726D027F3
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=us-ascii
Paul,
please try the attached patch -- if it prevents assert_sleepable() to fire
it is the call to CCD_GETBUF() aka. pool_cache_get(ccd_cache, PR_WAITOK)
from softint context that has to be fixed.
--
J. Hannken-Illjes - hannken%mailbox.org@localhost <mailto:hannken%mailbox.org@localhost>
--Apple-Mail=_C00F97DB-BCE8-4515-9DA6-D93726D027F3
Content-Disposition: attachment;
filename=001_ccd_defer.diff
Content-Type: application/octet-stream;
x-unix-mode=0644;
name="001_ccd_defer.diff"
Content-Transfer-Encoding: 7bit
ccd_defer
Always defer requests to the helper thread so ccdstart() doesn't
get called from softint anymore.
diff -r 8b8d2498ffd9 -r 2ec4e85f1120 sys/dev/ccd.c
--- sys/dev/ccd.c
+++ sys/dev/ccd.c
@@ -777,17 +777,10 @@ ccdstrategy(struct buf *bp)
return;
}
- /* Defer to thread if system is low on memory. */
+ /* Always defer to thread. */
bufq_put(cs->sc_bufq, bp);
- if (__predict_false(ccdbackoff(cs))) {
- mutex_exit(cs->sc_iolock);
-#ifdef DEBUG
- if (ccddebug & CCDB_FOLLOW)
- printf("ccdstrategy: holding off on I/O\n");
-#endif
- return;
- }
- ccdstart(cs);
+ cv_broadcast(&cs->sc_push);
+ mutex_exit(cs->sc_iolock);
}
static void
--Apple-Mail=_C00F97DB-BCE8-4515-9DA6-D93726D027F3--
!DSPAM:65f80f7713337849015859!