From owner-svn-src-head@FreeBSD.ORG Thu Jul 25 08:10:00 2013 Return-Path: Delivered-To: svn-src-head@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTP id 381A8C76; Thu, 25 Jul 2013 08:10:00 +0000 (UTC) (envelope-from hps@bitfrost.no) Received: from mta.bitpro.no (mta.bitpro.no [92.42.64.202]) by mx1.freebsd.org (Postfix) with ESMTP id BB50C2457; Thu, 25 Jul 2013 08:09:59 +0000 (UTC) Received: from mail.lockless.no (mail.lockless.no [46.29.221.38]) by mta.bitpro.no (Postfix) with ESMTP id CBAD17A153; Thu, 25 Jul 2013 10:09:57 +0200 (CEST) Received: from localhost (localhost [127.0.0.1]) by mail.lockless.no (Postfix) with ESMTP id 2122C8EFEDC; Thu, 25 Jul 2013 10:10:02 +0200 (CEST) X-Virus-Scanned: by amavisd-new-2.6.4 (20090625) (Debian) at lockless.no Received: from mail.lockless.no ([127.0.0.1]) by localhost (mail.lockless.no [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id ywf2WLcw1MbJ; Thu, 25 Jul 2013 10:10:01 +0200 (CEST) Received: from laptop015.hselasky.homeunix.org (cm-176.74.213.204.customer.telag.net [176.74.213.204]) by mail.lockless.no (Postfix) with ESMTPSA id E43D78EFEBC; Thu, 25 Jul 2013 10:10:00 +0200 (CEST) Message-ID: <51F0DDB0.7080102@bitfrost.no> Date: Thu, 25 Jul 2013 10:11:28 +0200 From: Hans Petter Selasky Organization: Bitfrost A/S User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:17.0) Gecko/20130522 Thunderbird/17.0.6 MIME-Version: 1.0 To: Bruce Evans Subject: Re: svn commit: r253636 - head/sys/vm References: <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org> In-Reply-To: <20130725171038.O841@besplex.bde.org> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle , src-committers@FreeBSD.org X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 25 Jul 2013 08:10:00 -0000 On 07/25/13 09:26, Bruce Evans wrote: > On Thu, 25 Jul 2013, Tim Kientzle wrote: > >> Log: >> Clear entire map structure including locks so that the >> locks don't accidentally appear to have been already >> initialized. >> >> In particular, this fixes a consistent kernel crash on >> armv6 with: >> panic: lock "vm map (user)" 0xc09cc050 already initialized >> that appeared with r251709. >> >> PR: arm/180820 >> >> Modified: >> head/sys/vm/vm_map.c >> >> Modified: head/sys/vm/vm_map.c >> ============================================================================== >> >> --- head/sys/vm/vm_map.c Thu Jul 25 03:44:12 2013 (r253635) >> +++ head/sys/vm/vm_map.c Thu Jul 25 03:48:37 2013 (r253636) >> @@ -239,8 +239,7 @@ vm_map_zinit(void *mem, int size, int fl >> vm_map_t map; >> >> map = (vm_map_t)mem; >> - map->nentries = 0; >> - map->size = 0; >> + memset(map, 0, sizeof(*map)); >> mtx_init(&map->system_mtx, "vm map (system)", NULL, MTX_DEF | >> MTX_DUPOK); >> sx_init(&map->lock, "vm map (user)"); >> return (0); > > memset() to value 0 is spelled bzero() in the kernel. > Hi, Is this the "memset vs bzero" or "batman vs superman" discussion again ;-) The structure looks like some size, so bzero() might run faster than memset() depending on the compiler settings. Should be profiled before changed! --HPS