From owner-freebsd-current Mon Jul 8 16:48: 1 2002 Delivered-To: freebsd-current@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 3305237B400 for ; Mon, 8 Jul 2002 16:47:59 -0700 (PDT) Received: from gw.catspoiler.org (217-ip-163.nccn.net [209.79.217.163]) by mx1.FreeBSD.org (Postfix) with ESMTP id 160D243E4A for ; Mon, 8 Jul 2002 16:47:58 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Received: from mousie.catspoiler.org (mousie.catspoiler.org [192.168.101.2]) by gw.catspoiler.org (8.12.5/8.12.5) with ESMTP id g68Nlhwr002091; Mon, 8 Jul 2002 16:47:47 -0700 (PDT) (envelope-from dl-freebsd@catspoiler.org) Message-Id: <200207082347.g68Nlhwr002091@gw.catspoiler.org> Date: Mon, 8 Jul 2002 16:47:43 -0700 (PDT) From: Don Lewis Subject: Re: KSE M-III status & junior hacker project. To: abjenkins@attbi.com Cc: joe@tao.org.uk, current@FreeBSD.ORG In-Reply-To: <200207081928.50162.abjenkins@attbi.com> MIME-Version: 1.0 Content-Type: TEXT/plain; charset=iso-8859-1 Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG On 8 Jul, Anthony Jenkins wrote: > I've been looking at the pcm code and I can see where it locks, then allocates > memory with the M_WAITOK flag thing. I'm wondering if there's a standard > procedure for fixing these... would I just nail down the malloc to a > non-sleepable one? Only if the the code can cope with malloc() failing and returning NULL if the memory isn't immediately available. In most cases a better solution is to allocate the memory before grabbing the lock. To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message