From patchwork Fri Jul 27 21:14:07 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Josef Bacik X-Patchwork-Id: 10547737 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 396FF139A for ; Fri, 27 Jul 2018 21:14:12 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2AAE31FFE5 for ; Fri, 27 Jul 2018 21:14:12 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1EA6F2BC82; Fri, 27 Jul 2018 21:14:12 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI 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 EE55D1FFE5 for ; Fri, 27 Jul 2018 21:14:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389523AbeG0Whu (ORCPT ); Fri, 27 Jul 2018 18:37:50 -0400 Received: from mail-qt0-f196.google.com ([209.85.216.196]:39043 "EHLO mail-qt0-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2389459AbeG0Whu (ORCPT ); Fri, 27 Jul 2018 18:37:50 -0400 Received: by mail-qt0-f196.google.com with SMTP id q12-v6so6490176qtp.6 for ; Fri, 27 Jul 2018 14:14:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=toxicpanda-com.20150623.gappssmtp.com; s=20150623; h=from:to:subject:date:message-id; bh=Oil6pIfYQk9xDDvMSqL4sNW62GRgF0gsJHfTIyWKs2A=; b=wtPzoLEcEQyHa7Wc50qUCpzwd9ROwTbva3QHOQQ1ceOvralpcWFHTbEcoVl/GJfB/4 zzrMUenKNTJCpEtM6+zh0f1eYY1qBe0eV9Dg7Fk0erRcTevfZzFuEtwOUonTWLT5Syme gXoa4yhI8kZzKI+P7NnHZU4IDkZqw0Bmf8vjgI0FWWfCN/eHdIJh1z+zlmpcDMZoeyBz pt5moL9/RKyalwMroWg8EKsorauN2rKoGeR36R8X+oCkhOgPT5FDH8+NnBPMLGxycOgq LuONvL7xrDlUCPqFCGTGDLH+JK9RTNkMgmsLwdfQzVlU5CRB+fVpxjQ1OBEIrjON/Nr5 MCUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id; bh=Oil6pIfYQk9xDDvMSqL4sNW62GRgF0gsJHfTIyWKs2A=; b=s+1Yzd8gzcfmYZkXg54h4bN8Jk6jeaUt1TjwHG6bZZ7TPQ4B7j3aSkcV1CQgApBPal 4Ghq+YNbT2HwtoDQfBM3YP1C5a0iixk4P48pUoNyE/EWnCut53lh6cft43Sq7SxBTT4W VNK9orSXergg5AA7BohfLBF5Mtr/h3GvDaMhPXj513vr9H3w01jN+BE3YlVJW68bkt+T skrgfIoDGP+ykoaPrc8kblAeQDYETgsOwqWBdBCKhdAp5UdlYlWbGnKhZMMMjCjY7V5O 1se25IThi6jQ9bHTMNKMQzBvhMAI16fl09LjqlUCoUoVHX1ZuLdlVLoEQHv1iZwt9ctq b+8w== X-Gm-Message-State: AOUpUlFPUL8pDn7yQCJ+9UBmRtcm+1Z1ypX0YRS448eNxTDqeE4wENCJ BCgD3eOaY8WqV3/XG33BjozqGUfMIc0= X-Google-Smtp-Source: AAOMgpc0xq5twV0eXKq8PrXL0d0L2nuVeDUBDUvcO5HZlQ+/mhHD8QTHkkO8OBFMrweclMdzYtgMYA== X-Received: by 2002:a0c:f611:: with SMTP id r17-v6mr7221288qvm.103.1532726049040; Fri, 27 Jul 2018 14:14:09 -0700 (PDT) Received: from localhost ([107.15.81.208]) by smtp.gmail.com with ESMTPSA id b62-v6sm3925193qkj.48.2018.07.27.14.14.08 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 27 Jul 2018 14:14:08 -0700 (PDT) From: Josef Bacik To: linux-block@vger.kernel.org, kernel-team@fb.com Subject: [PATCH] block: don't do cgroup accounting for split bio's Date: Fri, 27 Jul 2018 17:14:07 -0400 Message-Id: <20180727211407.24318-1-josef@toxicpanda.com> X-Mailer: git-send-email 2.14.3 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 We need to check in blkcg_bio_issue_check if the bio is flagged as QUEUE_ENTERED, because if it is then we've already accounted for the IO in the cgroup stats. Reported-by: Tejun Heo Signed-off-by: Josef Bacik --- include/linux/blk-cgroup.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/include/linux/blk-cgroup.h b/include/linux/blk-cgroup.h index 3bed5e02a873..a977c31688ae 100644 --- a/include/linux/blk-cgroup.h +++ b/include/linux/blk-cgroup.h @@ -767,7 +767,8 @@ static inline bool blkcg_bio_issue_check(struct request_queue *q, throtl = blk_throtl_bio(q, blkg, bio); - if (!throtl) { + if (!throtl && + !bio_flagged(bio, BIO_QUEUE_ENTERED)) { blkg = blkg ?: q->root_blkg; blkg_rwstat_add(&blkg->stat_bytes, bio->bi_opf, bio->bi_iter.bi_size);