Re: [PATCH] generic/551: prevent OOM when running on tmpfs with low memory

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



>> diff --git a/tests/generic/551 b/tests/generic/551
>> index 4a7f0a638235e272ef55ffeb3b3e548707568379..6a7376d7a8e3580bee0a5c98eacdaf93c60c8d5c 100755
>> --- a/tests/generic/551
>> +++ b/tests/generic/551
>> @@ -38,6 +38,7 @@ do_test()
>>  	local truncsize
>>  	local total_size=0
>>  	local avail_mem=`_available_memory_bytes`
>> +	[ "$FSTYP" = "tmpfs" ] && avail_mem=$((avail_mem - free_size_k * 1024))
> 
> This makes sense to me. But better to have a comment for this. If you don't
> have more suggestions, I'll add below comment when I merge this patch.
> 
> # To avoid OOM on tmpfs, subtract the amount of available memory allocated
> # for the tmpfs

Looks good to me.

> 
> Reviewed-by: Zorro Lang <zlang@xxxxxxxxxx>

Thanks




[Index of Archives]     [Linux Filesystems Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux