From patchwork Fri Mar 3 07:01:10 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hou Tao X-Patchwork-Id: 9602131 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id D41596016C for ; Fri, 3 Mar 2017 07:11:36 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C776228622 for ; Fri, 3 Mar 2017 07:11:36 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BC56828623; Fri, 3 Mar 2017 07:11:36 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B89728621 for ; Fri, 3 Mar 2017 07:11:36 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751602AbdCCHLL (ORCPT ); Fri, 3 Mar 2017 02:11:11 -0500 Received: from szxga03-in.huawei.com ([45.249.212.189]:3455 "EHLO dggrg03-dlp.huawei.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751882AbdCCHKx (ORCPT ); Fri, 3 Mar 2017 02:10:53 -0500 Received: from 172.30.72.53 (EHLO DGGEML403-HUB.china.huawei.com) ([172.30.72.53]) by dggrg03-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id AJM23995; Fri, 03 Mar 2017 14:59:35 +0800 (CST) Received: from huawei.com (10.175.124.28) by DGGEML403-HUB.china.huawei.com (10.3.17.33) with Microsoft SMTP Server id 14.3.301.0; Fri, 3 Mar 2017 14:59:31 +0800 From: Hou Tao To: CC: , Subject: [PATCH] block: use put_io_context_active() to disassociate bio from a task Date: Fri, 3 Mar 2017 15:01:10 +0800 Message-ID: <1488524470-570-1-git-send-email-houtao1@huawei.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 X-Originating-IP: [10.175.124.28] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A090201.58B91458.0019, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: cee63e7885002aec97b13105bb79afb3 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP bio_associate_current() invokes get_io_context_active() to tell CFQ scheduler that the current io_context is still issuing IOs by increasing active_ref. When the bio is done, we also need to invoke put_io_context_active() to decrease active_ref else the associated io_context will always be active. Signed-off-by: Hou Tao --- block/bio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/block/bio.c b/block/bio.c index 5eec5e0..d8ed36f 100644 --- a/block/bio.c +++ b/block/bio.c @@ -2072,7 +2072,7 @@ EXPORT_SYMBOL_GPL(bio_associate_current); void bio_disassociate_task(struct bio *bio) { if (bio->bi_ioc) { - put_io_context(bio->bi_ioc); + put_io_context_active(bio->bi_ioc); bio->bi_ioc = NULL; } if (bio->bi_css) {