Re: [PATCH v4 2/8] staging: zcache: zero-filled pages awareness

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Mar 20, 2013 at 06:30:38PM +0800, Bob Liu wrote:
>
>> @@ -641,16 +691,22 @@ static void zcache_pampd_free(void *pampd, struct tmem_pool *pool,
>>  {
>>  	struct page *page = NULL;
>>  	unsigned int zsize, zpages;
>> +	bool zero_filled = false;
>>  
>>  	BUG_ON(preemptible());
>> -	if (pampd_is_remote(pampd)) {
>> +
>> +	if (pampd == (void *)ZERO_FILLED)
>> +		zero_filled = true;
>> +
>> +	if (pampd_is_remote(pampd) && !zero_filled) {
>>  		BUG_ON(!ramster_enabled);
>>  		pampd = ramster_pampd_free(pampd, pool, oid, index, acct);
>>  		if (pampd == NULL)
>>  			return;
>>  	}
>>  	if (is_ephemeral(pool)) {
>> -		page = zbud_free_and_delist((struct zbudref *)pampd,
>> +		if (!zero_filled)
>> +			page = zbud_free_and_delist((struct zbudref *)pampd,
>>  						true, &zsize, &zpages);
>
>This check should also apply for !is_ephemeral(pool).

Good catch, fixed.

>
>>  		if (page)
>>  			dec_zcache_eph_pageframes();
>> @@ -667,7 +723,7 @@ static void zcache_pampd_free(void *pampd, struct tmem_pool *pool,
>>  	}
>>  	if (!is_local_client(pool->client))
>>  		ramster_count_foreign_pages(is_ephemeral(pool), -1);
>> -	if (page)
>> +	if (page && !zero_filled)
>>  		zcache_free_page(page);
>>  }
>>  
>> 
>
>-- 
>Regards,
>-Bob

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]