Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp1553062pxa; Thu, 6 Aug 2020 10:07:28 -0700 (PDT) X-Google-Smtp-Source: ABdhPJye2Cp+hnPfUXHXTf5qriYEL5e7wYQpToT9o4T/EPpNw+34GNHOSMXx39tf77JjBGYPnuXh X-Received: by 2002:a17:906:e251:: with SMTP id gq17mr5138751ejb.445.1596733647948; Thu, 06 Aug 2020 10:07:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1596733647; cv=none; d=google.com; s=arc-20160816; b=SycYn7LXcVxkauQa2t1v88mx7W46uxW6vUED8iOcxAyzqABkckUxntde/7coN0gLKg r9f/aIULfNn5YF+PrgYna5OmdN4/iIFFwxKILpsCdFsar1EY2eZAERu+EpHMtCVfisZN AzzOkb1jih54JeyAYsaNFSlL6ush9Hll8SCPAHH9sOhPI5T2gOUoAzx2aVY2vMYw+YDs KqsJE3uIx+is3ipo8B6zPl7Cbuuq4DdWG0hqTOlWybMVSv9Wziz9nIyZnElD5kVk/vjH i0gppSqGNd4mgI2I1yH50YkJCPhma0E5492m2x+SH3upjL3UjhGnNITiUop8k1Ec/f9D MUQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=+kkkBx1bxSHF0cNmAcmdtGqYc15xx5yDg7pnYwZu2X0=; b=NK7Fyb4ALByy4OzjWieysVhKuuQmqsv1vytmqzk4XBhsabByOzive4RDHZ28lZOvuc 1HtFIlbQJZjDGKsq/M44bmekhHL9P6MDgkt5rRfGAzq6PH2kZeuZknULVEk8vcxRL6pD fADUnTdLN3zlWy8Yf62FQcTzo0v7D43xiW1L20Z/c43t4Qe6hFPnDGUjnvtkXITkvdZq WCKl5rEf0P2MQwY7rLlhd1iB8VNL3+oUiCGYkDE5kpnw2LV+eFSvhUcYC5W4WODOuvEY wxEvL6u7JDWnqgB/kpHuycgqup75NbttytlfG6l1IuQ1Z29zzjd74xbVWnpEWSvz6cVL tcrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=frS1DJFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c12si3642098ejr.507.2020.08.06.10.07.05; Thu, 06 Aug 2020 10:07:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@126.com header.s=s110527 header.b=frS1DJFL; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=126.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729573AbgHFRGm (ORCPT + 99 others); Thu, 6 Aug 2020 13:06:42 -0400 Received: from m15111.mail.126.com ([220.181.15.111]:50497 "EHLO m15111.mail.126.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729995AbgHFRFl (ORCPT ); Thu, 6 Aug 2020 13:05:41 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=126.com; s=s110527; h=From:Subject:Date:Message-Id; bh=+kkkBx1bxSHF0cNmAc mdtGqYc15xx5yDg7pnYwZu2X0=; b=frS1DJFLGX4fnq8DPpkPzrzBNlUdQF0oAl OByLZL/oh0uRwQOqWrbf1nOSNUXkqdCAH3q5tAuTs/FpHF95mdaDf5Y2jRIDQgn/ Yhnm4ye5dHSqkaNpPT7U5g3xKULcl3LE4qSzaHuBJf9t8RWQDJ1TLxUWh3YO+iAI h+F4QZKqE= Received: from 192.168.137.131 (unknown [112.10.84.202]) by smtp1 (Coremail) with SMTP id C8mowAB3NEaiCyxfR1tJIQ--.29658S3; Thu, 06 Aug 2020 21:54:44 +0800 (CST) From: Xianting Tian To: tj@kernel.org, axboe@kernel.dk Cc: cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] blkcg: add plugging support for punt bio Date: Thu, 6 Aug 2020 09:54:42 -0400 Message-Id: <1596722082-31817-1-git-send-email-xianting_tian@126.com> X-Mailer: git-send-email 1.8.3.1 X-CM-TRANSID: C8mowAB3NEaiCyxfR1tJIQ--.29658S3 X-Coremail-Antispam: 1Uf129KBjvdXoWrZw1kKFy5Kr47JF4UZw4xZwb_yoWfZrg_Gr yqyFykGF1DCa1Fkws09F93ArZYkws5XF1qg34rK34fXF18Ja1qkr13Xw4qq34rCFyxuFy3 WanrZry8Crs3KjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IU0dMaUUUUUU== X-Originating-IP: [112.10.84.202] X-CM-SenderInfo: h0ld03plqjs3xldqqiyswou0bp/1tbi7Ql4pFpD-JPV9AAAsv Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(&blkg->async_bio_lock); @@ -129,8 +130,10 @@ static void blkg_async_bio_workfn(struct work_struct *work) bio_list_init(&blkg->async_bios); spin_unlock_bh(&blkg->async_bio_lock); + blk_start_plug(&plug); while ((bio = bio_list_pop(&bios))) submit_bio(bio); + blk_finish_plug(&plug); } /** -- 1.8.3.1