On Wed, 11 Jun 2008, James Carlson wrote: > [EMAIL PROTECTED] writes: >> to that driver in order to perform yet another guards check; Should >> kmem_alloc() be fixed ? > > Seems like an obvious case to me; yes.
Hmm, I've found: http://bugs.opensolaris.org/view_bug.do?bug_id=4241150 which created the "size == 0" panic from where before all hell would break loose ... and since then (1999), most such panics, if they occurred, have been caused by drivers passing e.g. uninitialized / unvalidated values into kmem_alloc() - and were fixed by fixing the driver bug. I've got to ping a few people about that. In the case of the code I'm on right now, the behaviour "try KM_NOSLEEP on huge buffers" is deliberate, and any limit not imposed by <system resources available> would break driver functionality. I do think the abovementioned codechange, which introduced: 1049 if (size == 0) 1050 panic("vmem_xalloc(): size == 0"); in vmem_xalloc(), needs to be modified like this: if (size == 0) if (vmflag & VM_NOSLEEP) return (NULL); else panic("vmem_xalloc(): size == 0"); to allow KM_NOSLEEP users graceful recovery ? FrankH. _______________________________________________ opensolaris-code mailing list opensolaris-code@opensolaris.org http://mail.opensolaris.org/mailman/listinfo/opensolaris-code