svn commit: r358097 - in head/sys: kern vm

Jeff Roberson jroberson at jroberson.net
Fri Feb 21 01:10:34 UTC 2020


On Fri, 21 Feb 2020, mmatsuda at cybernet.co.jp wrote:

> Hi Jeff,
>
> From: Jeff Roberson <jeff at FreeBSD.org>
> Date: Wed, 19 Feb 2020 08:17:27 +0000 (UTC)
>> Author: jeff
>> Date: Wed Feb 19 08:17:27 2020
>> New Revision: 358097
>> URL: https://svnweb.freebsd.org/changeset/base/358097
>>
>> Log:
>>  Eliminate some unnecessary uses of UMA_ZONE_VM.  Only zones involved in
>>  virtual address or physical page allocation need to be marked with this
>>  flag.
>>
>>  Reviewed by:	markj
>>  Tested by:	pho
>>  Differential Revision:	https://reviews.freebsd.org/D23712
>>
>> Modified:
>>  head/sys/kern/subr_vmem.c
>>  head/sys/kern/vfs_subr.c
>>  head/sys/vm/swap_pager.c
>>  head/sys/vm/vm_page.c
>>  head/sys/vm/vm_pager.c
>>
>> Modified: head/sys/kern/subr_vmem.c
>> ==============================================================================
>> --- head/sys/kern/subr_vmem.c	Wed Feb 19 08:15:20 2020	(r358096)
>> +++ head/sys/kern/subr_vmem.c	Wed Feb 19 08:17:27 2020	(r358097)
>> @@ -561,8 +561,7 @@ qc_init(vmem_t *vm, vmem_size_t qcache_max)
>> 		qc->qc_vmem = vm;
>> 		qc->qc_size = size;
>> 		qc->qc_cache = uma_zcache_create(qc->qc_name, size,
>> -		    NULL, NULL, NULL, NULL, qc_import, qc_release, qc,
>> -		    UMA_ZONE_VM);
>> +		    NULL, NULL, NULL, NULL, qc_import, qc_release, qc, 0);
>> 		MPASS(qc->qc_cache);
>> 	}
>> }
>> @@ -668,10 +667,10 @@ vmem_startup(void)
>> 	mtx_init(&vmem_list_lock, "vmem list lock", NULL, MTX_DEF);
>> 	vmem_zone = uma_zcreate("vmem",
>> 	    sizeof(struct vmem), NULL, NULL, NULL, NULL,
>> -	    UMA_ALIGN_PTR, UMA_ZONE_VM);
>> +	    UMA_ALIGN_PTR, 0);
>> 	vmem_bt_zone = uma_zcreate("vmem btag",
>> 	    sizeof(struct vmem_btag), NULL, NULL, NULL, NULL,
>> -	    UMA_ALIGN_PTR, UMA_ZONE_VM | UMA_ZONE_NOFREE);
>> +	    UMA_ALIGN_PTR, UMA_ZONE_VM);
>
> If I'm reading the message correctly, shouldn't the above line be like the following?
>
> +	    UMA_ALIGN_PTR, UMA_ZONE_NOFREE);

In this case the commit message wasn't complete.  There is no reason to 
mark the vmem btags as NOFREE because we can allocate them on the fly. 
There is a reason to mark them ZONE_VM however, because we need them to 
allocate virtual address space.

Thanks,
Jeff

>
> Regards,
> Haro
> =-----------------------------------------------------------------------
>           _ _    Munehiro (haro) Matsuda
> -|- /_\  |_|_|   Cybernet Systems Co., Ltd.
> /|\ |_|  |_|_|
>
>
>


More information about the svn-src-head mailing list