rwatson 68d9c43724 Add a new kernel option, MALLOC_MAKE_FAILURES, which compiles
in a debugging feature causing M_NOWAIT allocations to fail at
a specified rate.  This can be useful for detecting poor
handling of M_NOWAIT: the most frequent problems I've bumped
into are unconditional deference of the pointer even though
it's NULL, and hangs as a result of a lost event where memory
for the event couldn't be allocated.  Two sysctls are added:

debug.malloc.failure_rate

  How often to generate a failure: if set to 0 (default), this
  feature is disabled.  Otherwise, the frequency of failures --
  I've been using 10 (one in ten mallocs fails), but other
  popular settings might be much lower or much higher.

debug.malloc.failure_count

  Number of times a coerced malloc failure has occurred as a
  result of this feature.  Useful for tracking what might have
  happened and whether failures are being generated.

Useful possible additions: tying failure rate to malloc type,
printfs indicating the thread that experienced the coerced
failure.

Reviewed by:	jeffr, jhb
2003-03-26 20:18:40 +00:00
..
2003-03-25 04:32:52 +00:00
2003-03-13 23:07:09 +00:00
2003-02-14 12:44:48 +00:00
2002-12-22 05:35:03 +00:00
2002-06-29 02:00:02 +00:00
2003-01-07 20:10:04 +00:00
2003-03-10 20:24:54 +00:00
2003-02-12 07:00:59 +00:00
2002-10-02 09:09:25 +00:00
2003-03-19 00:33:38 +00:00
2003-02-20 03:26:11 +00:00
2003-03-05 08:16:29 +00:00
2003-03-05 08:16:29 +00:00
2003-03-07 22:47:32 +00:00
2003-03-23 19:41:34 +00:00