• Xianting Tian's avatar
    blkcg: add plugging support for punt bio · 192f1c6b
    Xianting Tian authored
    The test and the explaination of the patch as bellow.
    
    Before test we added more debug code in blkg_async_bio_workfn():
    	int count = 0
    	if (bios.head && bios.head->bi_next) {
    		need_plug = true;
    		blk_start_plug(&plug);
    	}
    	while ((bio = bio_list_pop(&bios))) {
    		/*io_punt is a sysctl user interface to control the print*/
    		if(io_punt) {
    			printk("[%s:%d] bio start,size:%llu,%d count=%d plug?%d\n",
    				current->comm, current->pid, bio->bi_iter.bi_sector,
    				(bio->bi_iter.bi_size)>>9, count++, need_plug);
    		}
    		submit_bio(bio);
    	}
    	if (need_plug)
    		blk_finish_plug(&plug);
    
    Steps that need to be set to trigger *PUNT* io before testing:
    	mount -t btrfs -o compress=lzo /dev/sda6 /btrfs
    	mount -t cgroup2 nodev /cgroup2
    	mkdir /cgroup2/cg3
    	echo "+io" > /cgroup2/cgroup.subtree_control
    	echo "8:0 wbps=1048576000" > /cgroup2/cg3/io.max #1000M/s
    	echo $$ > /cgroup2/cg3/cgroup.procs
    
    Then use dd command to test btrfs PUNT io in current shell:
    	dd if=/dev/zero of=/btrfs/fil...
    192f1c6b
blk-cgroup.c 49.8 KB