Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 20 Feb 2020 15:10:28 -1000 (HST)
From:      Jeff Roberson <jroberson@jroberson.net>
To:        mmatsuda@cybernet.co.jp
Cc:        jeff@FreeBSD.org, src-committers@freebsd.org, svn-src-all@freebsd.org,  svn-src-head@freebsd.org
Subject:   Re: svn commit: r358097 - in head/sys: kern vm
Message-ID:  <alpine.BSF.2.21.9999.2002201509090.1198@desktop>
In-Reply-To: <20200221.094131.01367154.mmatsuda@cybernet.co.jp>
References:  <202002190817.01J8HRTY062438@repo.freebsd.org> <20200221.094131.01367154.mmatsuda@cybernet.co.jp>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 21 Feb 2020, mmatsuda@cybernet.co.jp wrote:

> Hi Jeff,
>
> From: Jeff Roberson <jeff@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.
> /|\ |_|  |_|_|
>
>
>



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?alpine.BSF.2.21.9999.2002201509090.1198>