On 3/17/22 00:43, Pankaj Raghav wrote: > Hi Naohiro, > > On 2022-03-16 05:07, Naohiro Aota wrote: >>> +# blkzone supports printing zone cap only after version 2.37 >>> +_blkzone_req_major_ver=2 >>> +_blkzone_req_minor_ver=37 >>> +blkzone_ver=$($BLKZONE_PROG --version | cut -d " " -f 4 | cut -d "-" -f 1) >>> +blkzone_ver=( ${blkzone_ver//./ } ) >>> +blkzone_major_ver=${blkzone_ver[0]} >>> +blkzone_minor_ver=${blkzone_ver[1]} >>> +if [[ $blkzone_major_ver -ge $_blkzone_req_major_ver &&\ >>> + $blkzone_minor_ver -ge $_blkzone_req_minor_ver ]]; then >> >> I'd like to have it as a helper. >> >> Or, how about adding a filter and a wrapper function to add a "cap" >> filed whose value equal to the zone size for the old version (like >> with _getcap() and _filter_getcap())? Then, we can just call: >> zonecap=$(_blkzone_report ... | grep -Po "cap ([0x\d]+)+" | cut -d ' ' -f 2) >> size=$((zonecap << 9)) >> > That is a good idea. I will give it a shot. Thanks. > >>> + zonecap=$($BLKZONE_PROG report -c 1 $SCRATCH_DEV |\ >>> + grep -Po "cap ([0x\d]+)+" | cut -d ' ' -f 2) >> >> But still, zone capacity can vary for each zone. So, we need to read >> the capacity of a zone where the data BG resides on. >> > Do we support variable zone capacity in Linux? IIRC variable zone sizes > are definitely not supported but I am not sure about variable zone capacity. No, variable zone capacity is not supported in Linux. By that, I mean that drive that may change the capacity of a zone after a reset are not supported. So a zone capacity in Linux is always fixed throughout the life time of the NS it belongs to. But nothing mandates that all zones have the same capacity. A drive could expose zones with different capacities. That is the point Naohiro was making. > > But even if we do support, I see that the zone 5 (old_data_zone) and > zone 6 (new_data_zone) during the test and what if the new_data_zone > (zone 6) has a smaller cap than old_data_zone (zone 5)? > The main question: Is there a way to deterministically tell where the > data BG will reside and where it will relocate before we start the test > with variable capacity? > > My first look indicates that adding variable zone capacity will make the > test a bit more complex and I am not sure if it is worth the effort if > there are no use cases for it. > Let me know your thoughts. > -- Damien Le Moal Western Digital Research