From owner-freebsd-current Wed May 29 13: 4:52 2002 Delivered-To: freebsd-current@freebsd.org Received: from falcon.mail.pas.earthlink.net (falcon.mail.pas.earthlink.net [207.217.120.74]) by hub.freebsd.org (Postfix) with ESMTP id 1437237B407 for ; Wed, 29 May 2002 13:04:46 -0700 (PDT) Received: from pool0344.cvx22-bradley.dialup.earthlink.net ([209.179.199.89] helo=mindspring.com) by falcon.prod.itd.earthlink.net with esmtp (Exim 3.33 #2) id 17D9gN-0004BT-00; Wed, 29 May 2002 13:04:31 -0700 Message-ID: <3CF53430.49B6F618@mindspring.com> Date: Wed, 29 May 2002 13:04:00 -0700 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bosko Milekic Cc: Peter Wemm , Richard Wenninger , current@FreeBSD.ORG Subject: Re: UMA lock References: <20020529061540.88CD6380A@overcee.wemm.org> <3CF475E3.8925781A@mindspring.com> <20020529091152.B61073@unixdaemons.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit 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 Bosko Milekic wrote: > On Tue, May 28, 2002 at 11:32:03PM -0700, Terry Lambert wrote: > > Can we get rid of the NULL tests we had to put in when M_WAIT > > turned into M_WAITOK? > > No. What you see as a bad thing others (including me) see as a good > thing. I _want_ to be able to say: "okay, try sleeping; but I realize > that sleeping for longer than some reasonable time if I'm not getting > anything to begin with will probably not get me anything at any point > so tell me the allocation really failed and give me the opportunity to > clean up before *I* decide what I want to do." Up the operating system's wazoo! *We* are the programmers. *We* know better than *it* whether it's OK to sleep indefinitely or not. If *we* want the allocation to fail after *some reasonable time*, then *we will damn well set a timer to "some reasonable time"* to indicate that fact to the OS. If *we* do *not* damn well set a timer, then *we* damn well do not want it to fail, *we* want it to hang either *until it succeeds* or *until hell freezes over* or *until we manually enter the kernel debugger to find out why it is hanging*. All these people are bitching about kludging around something by changing M_WAITOK to M_NOWAIT. The kludge is *already there* in M_WAITOK, whether you want it or not. So bitching about this kluge is meaningless: changing it back to M_WAITOK won't make the little F'er go away, it will just *hide* the kludge from people to lazy to read the code all the way down, and know *why* they have to check for a NULL return from a call that's *supposed to wait* until it's return will *not* be NULL. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message