RE: [PATCH] blkcg: add plugging support for punt bio

2020-09-08 Thread Tianxianting
Thanks TJ and your previous guide to me.
I will summarize and resubmit the patch.

-Original Message-
From: Tejun Heo [mailto:hte...@gmail.com] On Behalf Of Tejun Heo
Sent: Wednesday, September 09, 2020 2:03 AM
To: tianxianting (RD) 
Cc: ax...@kernel.dk; cgro...@vger.kernel.org; linux-bl...@vger.kernel.org; 
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] blkcg: add plugging support for punt bio

On Sat, Sep 05, 2020 at 11:25:03AM +, Tianxianting wrote:
> Hi jens,tj
> Could you share a couple of  minutes to comment it?
> I really appreciate it

The result looks fine to me but can you please summarize that in the commit 
message of the patch?

Thanks.

--
tejun


Re: [PATCH] blkcg: add plugging support for punt bio

2020-09-08 Thread Tejun Heo
On Sat, Sep 05, 2020 at 11:25:03AM +, Tianxianting wrote:
> Hi jens,tj
> Could you share a couple of  minutes to comment it?
> I really appreciate it

The result looks fine to me but can you please summarize that in the commit
message of the patch?

Thanks.

-- 
tejun


Re: [PATCH] blkcg: add plugging support for punt bio

2020-08-06 Thread Jens Axboe
On 8/6/20 7:54 AM, Xianting Tian wrote:
> Try to merge continuous bio to current task's plug fisrt.

The patch looks fine to me, but I'd really like to see a bit more
changelog here. The commit message should explain why the change
is made, rather it's a very brief explanation of what it does.

If the bio list is contiguous, then we do the plugging to improve
merging at the lower level. You probably ran into a case where
you saw sub-optimal merging? And now the performance is better
with the patch? How much?


-- 
Jens Axboe



[PATCH] blkcg: add plugging support for punt bio

2020-08-06 Thread Xianting Tian
Try to merge continuous bio to current task's plug fisrt.

Signed-off-by: Xianting Tian 
---
 block/blk-cgroup.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/block/blk-cgroup.c b/block/blk-cgroup.c
index 0ecc897..fe5d361 100644
--- a/block/blk-cgroup.c
+++ b/block/blk-cgroup.c
@@ -122,6 +122,7 @@ static void blkg_async_bio_workfn(struct work_struct *work)
 async_bio_work);
struct bio_list bios = BIO_EMPTY_LIST;
struct bio *bio;
+   struct blk_plug plug;
 
/* as long as there are pending bios, @blkg can't go away */
spin_lock_bh(>async_bio_lock);
@@ -129,8 +130,10 @@ static void blkg_async_bio_workfn(struct work_struct *work)
bio_list_init(>async_bios);
spin_unlock_bh(>async_bio_lock);
 
+   blk_start_plug();
while ((bio = bio_list_pop()))
submit_bio(bio);
+   blk_finish_plug();
 }
 
 /**
-- 
1.8.3.1



Re: [PATCH] blkcg: add plugging support for punt bio

2020-08-06 Thread Tejun Heo
On Thu, Aug 06, 2020 at 09:54:42AM -0400, Xianting Tian wrote:
> Try to merge continuous bio to current task's plug fisrt.
> 
> Signed-off-by: Xianting Tian 

Acked-by: Tejun Heo 

Thanks!

-- 
tejun