Re: [PATCH 2/4] bcache: calculate the number of incremental GC nodesaccording to the total of btree nodes

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

 



Hi Coly

>Hi Junhui,
>
>>                  btree_node_prefetch(b, k);
>> +                /*
>> +                 * initiallize c->gc_stats.nodes
>> +                 * for incremental GC
>> +                 */
>> +                b->c->gc_stats.nodes++;
>                                       
>I don't get the point why increase gc_stats.nodes here. Could you please
>explain a bit more ? 
 
We get gc_stats.nodes here, because we need to know the total btree nodes 
to caculate how much btree nodes we could do incremental GC in the first
time. If we don't get it, it would be zero in the first GC time, and we
can't caculate how much btree nodes in incremental GC correctly in the
first GC time.

Though the count is not accurate (since after we get gc_stats.nodes, journal
replay, I/O writes may happend, so the real nodes count may be changed), but
we only use it to estimate how much btree nodes we could GC each time, so it
doesn't matter.
                                     
Thanks.                                                                      
Tang Junhui                             
     



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux