From owner-freebsd-arch@FreeBSD.ORG Sun Mar 23 09:15:38 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 3EB7A106566B; Sun, 23 Mar 2008 09:15:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.freebsd.org (Postfix) with ESMTP id 0E3E08FC19; Sun, 23 Mar 2008 09:15:38 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id 41C9446B6C; Sun, 23 Mar 2008 05:15:37 -0400 (EDT) Date: Sun, 23 Mar 2008 09:15:37 +0000 (GMT) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Sam Leffler In-Reply-To: <47E5D613.4060005@freebsd.org> Message-ID: <20080323091107.Y79412@fledge.watson.org> References: <20080322105145.GA41672@team.vega.ru> <20080322135637.Y6961@fledge.watson.org> <200803230104.m2N14xlf026184@apollo.backplane.com> <20080322153658.K910@desktop> <47E5D613.4060005@freebsd.org> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed 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 09:15:38 -0000 On Sat, 22 Mar 2008, Sam Leffler wrote: >> 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. However, this isn't just a search and replace patch on flag names. M_TRYWAIT in fact does a Yoda suggests -- it doesn't "try", it just "does", and as a result none of the intermittently applied NULL-checking for M_TRYWAIT return paths can ever be executed. Hence the are never tested, and new code is turning up that makes the assumption that these paths will never see failure. A significant part of Ruslan's patch is improving consistency in error handling by making all code consider the wait case unable to fail, and there's nothing quite like removing unused exceptional case handling to make network code easier to read. I would also be fine with a proposal that replaces the existing M_DONTWAIT / M_TRYWAIT with mbuf allocator specific flags that read FOO_WAIT and FOO_NOWAIT (be it the same as in Dragonfly, MB_WAIT and MB_NOWAIT or otherwise). It's certainl true that in other cases, we've tried hard to have allocator wrappers with enhanced functionality use their own flag namespace -- SF_WAIT, etc, but since the mbuf allocator really is UMA these days, I am also alright with using the UMA/malloc flags. Robert N M Watson Computer Laboratory University of Cambridge