From owner-freebsd-stable@FreeBSD.ORG Thu Mar 28 06:52:08 2013 Return-Path: Delivered-To: freebsd-stable@freebsd.org Received: from mx1.freebsd.org (mx1.FreeBSD.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id B2A7FB9F for ; Thu, 28 Mar 2013 06:52:08 +0000 (UTC) (envelope-from mauzo@anubis.morrow.me.uk) Received: from isis.morrow.me.uk (isis.morrow.me.uk [204.109.63.142]) by mx1.freebsd.org (Postfix) with ESMTP id 90727FD9 for ; Thu, 28 Mar 2013 06:52:08 +0000 (UTC) Received: from anubis.morrow.me.uk (host86-173-252-28.range86-173.btcentralplus.com [86.173.252.28]) (Authenticated sender: mauzo) by isis.morrow.me.uk (Postfix) with ESMTPSA id C005F45046; Thu, 28 Mar 2013 06:42:23 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.7.4 isis.morrow.me.uk C005F45046 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=morrow.me.uk; s=dkim201101; t=1364452944; bh=40EKzLwhhrzSHhxzaoWfmqTIABYhpIb5VQUMnIhgQaY=; h=Date:From:To:Subject:References:In-Reply-To; b=09Zillg14Mp/QyiF6D1oQSOcuke2QYTH9ldtRedmeFN8IByoPqunF9dsLXGiY0VK1 G8AEewcsgw7Cg3+Cc9dFIsYwLgInGMjXNKdEchchwVuZPWyESEEVSU2tKecKOXreeX pmaTtYnInlkSgWFRgDyrC1N3xsxcCaXz1sXR3OtY= X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.97.6 at isis.morrow.me.uk Received: by anubis.morrow.me.uk (Postfix, from userid 5001) id 761CBA298; Thu, 28 Mar 2013 06:42:20 +0000 (GMT) Date: Thu, 28 Mar 2013 06:42:20 +0000 From: Ben Morrow To: unga888@yahoo.com, freebsd-stable@freebsd.org Subject: Re: FreeBSD 9.1 excessive memory allocations [SOLVED] Message-ID: <20130328064216.GA30925@anubis.morrow.me.uk> References: <1364322902.78474.YahooMailNeo@web161904.mail.bf1.yahoo.com> <1364393170.36972.49.camel@revolution.hippie.lan> <1364409226.37379.YahooMailNeo@web161906.mail.bf1.yahoo.com> <1364410923.36972.67.camel@revolution.hippie.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1364449156.30979.YahooMailNeo@web161906.mail.bf1.yahoo.com> X-Newsgroups: gmane.os.freebsd.stable Organization: morrow.me.uk User-Agent: Mutt/1.5.21 (2010-09-15) X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 28 Mar 2013 06:52:08 -0000 Quoth Unga : > > > I think you may be reading too much into the malloc manpage.  When it > > mentions the use of per-thread small-object caches to avoid locking it's > > talking about performance, not thread safety.  Allocations of all sizes > > are thread-safe, the library just assumes that huge allocations are rare > > enough that it doesn't use extra per-thread resources to avoid locking > > for them, it just uses locking for huge blocks. > > Good to note all allocations are thread safe in FreeBSD. Is it by some > standard that malloc should be thread safe regardless the OS (BSDs, > Linux, Windows, Android, etc)? POSIX (well, SUSv4 at least) says that malloc and free must be threadsafe. Note that Windows is not a POSIX system, though I belive malloc is also always threadsafe on Windows. Ben