Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 21 Jan 2003 20:02:43 -0500
From:      Bosko Milekic <bmilekic@unixdaemons.com>
To:        Alfred Perlstein <bright@mu.org>
Cc:        "M. Warner Losh" <imp@bsdimp.com>, arch@freebsd.org
Subject:   Re: Alfre's malloc changes: the next step
Message-ID:  <20030121200243.A74685@unixdaemons.com>
In-Reply-To: <20030121233932.GI42333@elvis.mu.org>; from bright@mu.org on Tue, Jan 21, 2003 at 03:39:32PM -0800
References:  <20030121.144243.52206100.imp@bsdimp.com> <20030121233932.GI42333@elvis.mu.org>

next in thread | previous in thread | raw e-mail | index | archive | help

On Tue, Jan 21, 2003 at 03:39:32PM -0800, Alfred Perlstein wrote:
> > 1) Make M_WAITOK and M_NOWAIT mandatory and exclusive in malloc.c.
> >    You must specify one or the other, but not both.
> 
> I keep hearing people say that having M_WAITOK implicit when M_NOWAIT
> is absent as a problem, it is not a problem, it's how things should
> be.  One should only, if ever use M_NOWAIT from interrupt context.
> 
> You should not be using M_NOWAIT because your locking is incorrect
> and you're holding a mutex when you need to call malloc/mget in
> user context.

  I agree.

[...]

  I think that this change should not be backed out until people agree
  what they want to do and only after the agreement is reached should
  we even consider HOW to properly make the change (e.g., either back
  out the current one and then commit the new one or just apply a new
  delta to the existing code).

  Personally, I don't think it should be backed out.  The default
  behavior should be to wait (or in the mbuf case, try to wait).  The
  only exception should, strictly speaking, be interrupt code.  I think
  this is pretty clear from an API perspective.  But my ears (or eyes in
  this case) are wide open for compelling reasons to keep the old
  'behavior' (besides for the common and rather lame "compatibility"
  which by the way makes no sense at all given that our semantics are
  different anyway, forget about API differences).

-- 
Bosko Milekic * bmilekic@unixdaemons.com * bmilekic@FreeBSD.org


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-arch" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20030121200243.A74685>