From owner-freebsd-arch@FreeBSD.ORG Sun Mar 23 04:37:13 2008 Return-Path: Delivered-To: arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 8C54F106566B for ; Sun, 23 Mar 2008 04:37:13 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from ebb.errno.com (ebb.errno.com [69.12.149.25]) by mx1.freebsd.org (Postfix) with ESMTP id 5FC978FC21 for ; Sun, 23 Mar 2008 04:37:13 +0000 (UTC) (envelope-from sam@freebsd.org) Received: from Macintosh-2.local ([10.0.0.196]) (authenticated bits=0) by ebb.errno.com (8.13.6/8.12.6) with ESMTP id m2N41NnF028309 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Sat, 22 Mar 2008 21:01:23 -0700 (PDT) (envelope-from sam@freebsd.org) Message-ID: <47E5D613.4060005@freebsd.org> Date: Sat, 22 Mar 2008 21:01:23 -0700 From: Sam Leffler Organization: FreeBSD Project User-Agent: Thunderbird 2.0.0.12 (Macintosh/20080213) MIME-Version: 1.0 To: Jeff Roberson References: <20080322105145.GA41672@team.vega.ru> <20080322135637.Y6961@fledge.watson.org> <200803230104.m2N14xlf026184@apollo.backplane.com> <20080322153658.K910@desktop> In-Reply-To: <20080322153658.K910@desktop> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-DCC-sonic.net-Metrics: ebb.errno.com; whitelist Cc: arch@freebsd.org Subject: Re: Disposal of a misleading M_TRYWAIT X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 23 Mar 2008 04:37:13 -0000 Jeff Roberson wrote: > On Sat, 22 Mar 2008, Matthew Dillon wrote: > >> >> :> Since the advent of MBUMA in FreeBSD (whatever), M_TRYWAIT has meant >> :> M_WAITOK. (The reason for M_TRYWAIT itself was that an original >> mbuf's >> :> M_WAIT could return NULL.) >> :> >> :.. >> : >> :This seems reasonable to me for exactly the reasons you stte. We might >> :simultaneously want to complete the M_DONTWAIT -> M_NOWAIT >> conversion. And >> :you can then remove the XXX comment in mbuf.h about phasing out >> M_TRYWAIT and >> :M_DONTWAIT. :-) >> : >> :Robert N M Watson >> >> The real issue is the fact that both the kernel malloc and the mbuf >> allocation APIs are using the same M_ prefix for their flags. >> >> We converted our mbuf allocator flags (aka M_DONTWAIT, M_TRYWAIT, >> M_WAIT) >> from M_ to MB_ and the code became a whole lot easier to read. >> >> I would not recommend converting the mbuf allocator to actually *USE* >> kernel malloc flags. The problem there is that you then have no clear >> delineation between M_ flags supported by malloc and M_ flags >> supported >> by the mbuf allocator. > > They have been the same allocator for some time now. It makes more > sense for them to use the same flags. We made a decision a while back to not use malloc flags for mbuf routine arguments. There are even assertions to verify it. Changing the flag names however would be a painful change for little gain. Sam