NetBSD-Bugs archive

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

Re: kern/58043: kernel crash in assert_sleepable() in -current, dk(4) driver?



I've already converted my config to raid0 instead of ccd, so I am sorry
that I am unable to test the patch.  :-(

On Mon, 18 Mar 2024, J. Hannken-Illjes wrote:

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!



+---------------------+--------------------------+----------------------+
| Paul Goyette (.sig) | PGP Key fingerprint:     | E-mail addresses:    |
| (Retired)           | 1B11 1849 721C 56C8 F63A | paul%whooppee.com@localhost    |
| Software Developer  | 6E2E 05FD 15CE 9F2D 5102 | pgoyette%netbsd.org@localhost  |
| & Network Engineer  |                          | pgoyette99%gmail.com@localhost |
+---------------------+--------------------------+----------------------+


Home | Main Index | Thread Index | Old Index