Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 25 Jul 2013 10:11:28 +0200
From:      Hans Petter Selasky <hps@bitfrost.no>
To:        Bruce Evans <brde@optusnet.com.au>
Cc:        svn-src-head@FreeBSD.org, svn-src-all@FreeBSD.org, Tim Kientzle <kientzle@FreeBSD.org>, src-committers@FreeBSD.org
Subject:   Re: svn commit: r253636 - head/sys/vm
Message-ID:  <51F0DDB0.7080102@bitfrost.no>
In-Reply-To: <20130725171038.O841@besplex.bde.org>
References:  <201307250348.r6P3mbsG049595@svn.freebsd.org> <20130725171038.O841@besplex.bde.org>

next in thread | previous in thread | raw e-mail | index | archive | help
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




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?51F0DDB0.7080102>