From owner-freebsd-current Wed Jan 20 15:50:30 1999 Return-Path: Received: (from majordom@localhost) by hub.freebsd.org (8.8.8/8.8.8) id PAA04795 for freebsd-current-outgoing; Wed, 20 Jan 1999 15:50:30 -0800 (PST) (envelope-from owner-freebsd-current@FreeBSD.ORG) Received: from dingo.cdrom.com (castles232.castles.com [208.214.165.232]) by hub.freebsd.org (8.8.8/8.8.8) with ESMTP id PAA04789 for ; Wed, 20 Jan 1999 15:50:28 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Received: from dingo.cdrom.com (localhost [127.0.0.1]) by dingo.cdrom.com (8.9.1/8.8.8) with ESMTP id PAA04181; Wed, 20 Jan 1999 15:46:39 -0800 (PST) (envelope-from mike@dingo.cdrom.com) Message-Id: <199901202346.PAA04181@dingo.cdrom.com> X-Mailer: exmh version 2.0.2 2/24/98 To: Bruce Evans cc: green@unixhelp.org, mike@smith.net.au, current@FreeBSD.ORG Subject: Re: Truth to M_WAITOK? In-reply-to: Your message of "Thu, 21 Jan 1999 10:46:57 +1100." <199901202346.KAA13074@godzilla.zeta.org.au> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Date: Wed, 20 Jan 1999 15:46:39 -0800 From: Mike Smith Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG > >It looks like M_WAITOK will either return non-NULL or panic; it > >shouldn't be capable of returning NULL. Ideally, it shouldn't panic > >either (why is it only that M_WAITOK can panic, and M_NOWAIT can't?). > > Because failures for M_NOWAIT are normal (all pages may be in use, > and the caller is not prepared for pages top be freed by swapping). > Therefore, callers that set M_NOWAIT must be prepared for failure. OTOH, > failures for M_WAITOK are abnormal, and at least for map == kmem_map (as > it is for calls to kmem_malloc() from malloc()), the correct handling > for failure is to panic since a full map is unlikely to become unfull > and neither the caller or kmem_malloc() can know what to do to unfill it. Bear with the ignorance a moment; how is a full map any different to no more kmem space? In the "out of kmem" case, we call VM_WAIT and retry. Why not do this in the kmem_map full case as well? -- \\ Sometimes you're ahead, \\ Mike Smith \\ sometimes you're behind. \\ mike@smith.net.au \\ The race is long, and in the \\ msmith@freebsd.org \\ end it's only with yourself. \\ msmith@cdrom.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message