From owner-freebsd-hackers@FreeBSD.ORG Mon Nov 12 02:02:38 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9D4EEF91; Mon, 12 Nov 2012 02:02:38 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-da0-f54.google.com (mail-da0-f54.google.com [209.85.210.54]) by mx1.freebsd.org (Postfix) with ESMTP id 641108FC08; Mon, 12 Nov 2012 02:02:37 +0000 (UTC) Received: by mail-da0-f54.google.com with SMTP id z9so2605149dad.13 for ; Sun, 11 Nov 2012 18:02:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=UDXIH/xQjqib6FGZmZvCup0dN/GkLzBVvLAj1tU5dIk=; b=tcDpJ/ALGuUWwt+Q8P0HKwc9Xif0ioaOg38yNCp57Fc73JGEUA2PvrZwwBosDRgZPI ab0nmXsxQAOYWrL6tov2ZDxUXGGSCFj+h+1Gevudp+W5L/ss5xRazdM4rQjmNKCgFntC lwdBsg4zcoZCish5fdrOjZE0wx0bV2DteN+maOochoX7U2Be0YaB6GZUkID7hV7bvld+ EGD3kjJtyrYGlWSACogXDF0ra+0Myki8gf5BnCsdYZVIirWTRTyiwFRwsavqMa1CyAjR /V6ECUurcp7AnCxoQBZwPFyDUaX3+f+PhgdqSXEDqrZvSDZcLZTE+xSbXuwqpDNsQ9wn b+eQ== MIME-Version: 1.0 Received: by 10.68.247.134 with SMTP id ye6mr46861110pbc.69.1352685756831; Sun, 11 Nov 2012 18:02:36 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.68.124.130 with HTTP; Sun, 11 Nov 2012 18:02:36 -0800 (PST) In-Reply-To: References: <20121110132019.GP73505@kib.kiev.ua> Date: Sun, 11 Nov 2012 18:02:36 -0800 X-Google-Sender-Auth: RRn8ERaobwyjxGBNFlVfOMvf7lY Message-ID: Subject: Re: Memory reserves or lack thereof From: Adrian Chadd To: alc@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Konstantin Belousov , "freebsd-hackers@freebsd.org" , "Sears, Steven" X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 12 Nov 2012 02:02:38 -0000 On 11 November 2012 13:40, Alan Cox wrote: > > Agreed. Once upon time, before SMPng, M_NOWAIT was rarely used. It was > well understand that it should only be used by interrupt handlers. > > The trouble is that M_NOWAIT conflates two orthogonal things. The obvious > being that the allocation shouldn't sleep. The other being how far we're > willing to deplete the cache/free page queues. > > When fine-grained locking got sprinkled throughout the kernel, we all to > often found ourselves wanting to do allocations without the possibility of > blocking. So, M_NOWAIT became commonplace, where it wasn't before. Well, what's the current set of best practices for allocating mbufs? I don't mind going through ath(4) and net80211(4), looking to make it behave better with mbuf allocations. There's 49 M_NOWAIT's in net80211 and 10 in ath(4). I wonder how many of them are synonyms with "don't fail allocating", too. Hm. Adrian