From owner-freebsd-arch@FreeBSD.ORG Thu Jan 24 20:30:43 2013 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by hub.freebsd.org (Postfix) with ESMTP id 93E81418; Thu, 24 Jan 2013 20:30:43 +0000 (UTC) (envelope-from adrian.chadd@gmail.com) Received: from mail-wi0-f172.google.com (mail-wi0-f172.google.com [209.85.212.172]) by mx1.freebsd.org (Postfix) with ESMTP id EDB732F6; Thu, 24 Jan 2013 20:30:42 +0000 (UTC) Received: by mail-wi0-f172.google.com with SMTP id o1so827747wic.11 for ; Thu, 24 Jan 2013 12:30:36 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:x-received:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=oNEjBDexpeKomx2Ocx3EubxQ2khCB115kqebUHv2xk4=; b=bJLGaU3TOs691EDbQwo/Fg9UpveGQgQyca1av2tlgEKRhmYfL4YVhLjZqeKxvaK3b3 +c7ST2N+PCVbEa8JiNxthSlXwWl58TZDe5kOu+volQskDFrAku0REEjnA3BKkCBLxMju 0Fwu7FY2DyfUDpvr7vuzR2DCx2qm+8E7jUYRwjFyu3CFDY3PuyPXszpkIhKSsXrv89Tc 7q9hsH1UJPUPGhuJrIXw4nw22jJGdkrgIdZEnsNi8KPmFLXrpySrNaoPuQJjLV3+odMY 5DGzUSz7qhswmefPA2k4s085hsZKB8VSRqn8TiKM/u8YlbP/AIyNPqtAwJ74zcLSQlaQ HoEw== MIME-Version: 1.0 X-Received: by 10.194.172.197 with SMTP id be5mr5379504wjc.20.1359059436389; Thu, 24 Jan 2013 12:30:36 -0800 (PST) Sender: adrian.chadd@gmail.com Received: by 10.216.67.6 with HTTP; Thu, 24 Jan 2013 12:30:36 -0800 (PST) In-Reply-To: References: Date: Thu, 24 Jan 2013 12:30:36 -0800 X-Google-Sender-Auth: 4vioMybD9jMiOpATRRb9ogltFKY Message-ID: Subject: Re: [rfc] enabling MALLOC_PRODUCTION on -HEAD for now, until jemalloc has been taught to have some run time selectable debug options From: Adrian Chadd To: Jason Evans Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: freebsd-arch@freebsd.org X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Jan 2013 20:30:43 -0000 On 24 January 2013 10:40, Jason Evans wrote: > I imported jemalloc 3.3.0 last night, which I think will restore non-MALL= OC_PRODUCTION performance to roughly what it has been for years. The key c= hange was a patch by Ian Lepore: > > http://www.canonware.com/cgi-bin/gitweb.cgi?p=3Djemalloc.git;a=3D= commitdiff;h=3D14a2c6a698a207ac3f3825443cf3441c8842e990 > > In practice, the zeroed memory validation should no longer execute at all= on FreeBSD due to madvise(...MADV_FREE) not guaranteeing zeroed memory. > > I don't know how significant the impact will be on constrained/older syst= ems, but for the many buildworld repetitions I did during testing it improv= ed throughput by >1.5X. With this change in place, I'm not keen on enablin= g MALLOC_PRODUCTION by default, because the assertions are useful both for = detecting bugs in jemalloc (heaven forbid), and for indicating that crashes= within jemalloc are application errors. The only other significant source= of overhead I'm aware of is junk filling, which we've had enabled by defau= lt on -current for ages, probably since the introduction of phkmalloc. If = you don't like it: > > ln -s 'junk:false' /etc/malloc.conf > > If a substantial performance difference remains for you (MALLOC_PRODUCTIO= N vs non-MALLOC_PRODUCTION with junk:false set), please let me know. Sweet, thanks. I'll do up a new -HEAD MIPS, ARM and PPC test builds tonight and let you know how it all goes. I'd love to keep MALLOC_PRODUCTION off on -HEAD by default. :-) Thank you to both you and Ian for spearheading this change to your malloc library. :) Adrian