Re: Re: [PATCH] update bucket_in_use in real time

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

 



From: Tang Junhui <tang.junhui@xxxxxxxxxx>

Thanks to Mike and Coly's comments.

>> +		 if(ca->set->avail_nbuckets > 0) {
>> +		 		 ca->set->avail_nbuckets--;
>> +		 		 bch_update_bucket_in_use(ca->set);
>> +		 }
>> +
> 
> I am not sure this needs an atomic.  All accesses to this variable are
>> done with the bucket_lock held, so that seems correct.  Is this right?
Yes, you are right.

>> static void bch_btree_gc_finish(struct cache_set *c)
> available should be removed and this function should return 0.
I have changed this function to a void type, so nothing need return.

>> +		 stats.in_use		 = (c->nbuckets - c->avail_nbuckets) * 100 / c->nbuckets;
> 
> This should instead call bch_update_bucket_in_use to avoid code duplication.
OK, I will modify it and resend a v2 patch later. 
                  
> Overall I think this is a good piece of progress.
Thanks for your review and comments again.

Tang Junhui
--
To unsubscribe from this list: send the line "unsubscribe linux-bcache" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux ARM Kernel]     [Linux Filesystem Development]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux