Re: [PATCH v2] blk-throttle: fix race between blkcg_bio_issue_check and cgroup_rmdir

2018-02-22 Thread xuejiufei
Hi Tejun, On 2018/2/22 下午11:18, Tejun Heo wrote: > Hello, > > On Thu, Feb 22, 2018 at 02:14:34PM +0800, Joseph Qi wrote: >> I still don't get how css_tryget can work here. >> >> The race happens when: >> 1) writeback kworker has found the blkg with rcu; >> 2) blkcg is during offlining and

[PATCH RESEND] blk-throttle: avoid double counted

2018-02-13 Thread xuejiufei
If a bio is split after counted to the stat_bytes and stat_ios in blkcg_bio_issue_check(), the bio could be resubmitted and enters the block throttle layer again. This will cause the part of the bio is counted twice. The flag BIO_THROTTLED can not be used to fix this problem considering the

Re: [PATCH RESEND] blk-throttle: dispatch more sync writes in block throttle layer

2018-02-07 Thread xuejiufei
Hi Tejun, Could you please kindly review this patch or give some advice? Thanks. Jiufei Xue On 2018/1/23 上午10:08, xuejiufei wrote: > Cgroup writeback is supported since v4.2. But there exists a problem > in the following case. > > A cgroup may send both buffer and dir

[PATCH RESEND] blk-throttle: dispatch more sync writes in block throttle layer

2018-01-22 Thread xuejiufei
Cgroup writeback is supported since v4.2. But there exists a problem in the following case. A cgroup may send both buffer and direct/sync IOs. The foreground thread will be stalled when periodic writeback IOs is flushed because the service queue in block throttle layer already has a plenty of

[PATCH] blk-throttle: avoid double counted

2018-01-09 Thread xuejiufei
From: Jiufei Xue If a bio is split after counted to the stat_bytes and stat_ios in blkcg_bio_issue_check(), the bio could be resubmited and enters the block throttle layer again. This will cause the part of the bio is counted twice. The flag BIO_THROTTLED can not be

Re: [RFC PATCH] blk-throttle: dispatch more sync writes in block throttle layer

2018-01-09 Thread xuejiufei
Hi Tejun, On 2018/1/9 下午10:56, Tejun Heo wrote: > Hello, > > On Tue, Jan 09, 2018 at 12:45:13PM +0800, xuejiufei wrote: >> 1. A bio is charged according to the direction, if we put the reads >> and sync writes together, we need to search the queue to pick a >> certa

Re: [RFC PATCH] blk-throttle: dispatch more sync writes in block throttle layer

2018-01-08 Thread xuejiufei
Hi Tejun, Thanks for your reply. On 2018/1/8 下午8:07, Tejun Heo wrote: > Hello, > > On Fri, Jan 05, 2018 at 01:16:26PM +0800, xuejiufei wrote: >> From: Jiufei Xue <jiufei@alibaba-inc.com> >> >> Cgroup writeback is supported since v4.2. But there exists a

[RFC PATCH] blk-throttle: dispatch more sync writes in block throttle layer

2018-01-04 Thread xuejiufei
From: Jiufei Xue Cgroup writeback is supported since v4.2. But there exists a problem in the following case. A cgroup may send both buffer and direct/sync IOs. The foreground thread will be stalled when periodic writeback IOs is flushed because the service queue in

[RFC] distinguish foreground and background IOs in block throttle

2017-12-24 Thread xuejiufei
Hi all, Cgroup writeback is supported since v4.2. I found there exists a problem in the following case. A cgroup may send both buffer and direct/sync IOs. The foreground thread will be stalled when periodic writeback IOs is flushed because the service queue already has a plenty of writeback IOs,

Re: [PATCH V2] block-throttle: avoid double charge

2017-12-19 Thread xuejiufei
Hi Shaohua, I noticed that the splitted bio will goto the scheduler directly while the cloned bio entering the generic_make_request again. So can we just leave the BIO_THROTTLED flag in the original bio and do not copy the flag to new splitted bio, so it is not necessary to remove the flag in

[PATCH] blk-throttle: fix null pointer dereference while throttling writeback IOs

2017-10-09 Thread xuejiufei
From: Jiufei Xue A null pointer dereference can occur when blkcg is removed manually with writeback IOs inflight. This is caused by the following case: Writeback kworker submit the bio and set bio->bi_cg_private to tg in blk_throtl_assoc_bio. Then we remove the block