Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp864569ybi; Fri, 14 Jun 2019 04:45:33 -0700 (PDT) X-Google-Smtp-Source: APXvYqw+Se0EKzAmJanrhZlmhb3OEpoQglKZ1t3Nlt8twn4ssJ7Ox2ZXb3o68lFTAPVrSNVtx48v X-Received: by 2002:a17:90a:9382:: with SMTP id q2mr10804498pjo.131.1560512733705; Fri, 14 Jun 2019 04:45:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560512733; cv=none; d=google.com; s=arc-20160816; b=xKZ1lHV214QyjRM2x8RLNuA3fWHwZNkURyhFRxiPWblO4NwlUzPOZey+ODkvraoKhA 3rT7v/NBFikoGBHtIVw0lWof3Qr5lcqKsT9Few8RmUnsix7hURB7F+9JstrAZOfUUa/a E4+LzHpVbN1k9a9Y2pjhTyrfYqOr6tBajz4XXpGWddJtP9P8CScm2X+VKgaZWkGJG2tr ebQGevCAK7LXfX+NwVmZOgxtYLTPv1bch/2t0kIMjTiiWApzCndiAsDeGE7m5bNlQKNL 6SgROHdsUqQcEPeiznmrvRFeQwhtT4Ys3gC1xh32n9hcDRrzOVth14Mg/gL7mF3aYAus KgGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=nfOL/QEZKCqwjy4s7vi3c4DFfSxvD/93w3BZ2MZj8Vk=; b=g10/VN+tIwu6QfH4xmP8WrDb1KV1A8qJI+FnTKEtqlOB5Enfxqy1herLUF6/NmMxCw Hnzqas19riMfKG2ztEt79jAspeucB5Brk/S2UvdUCLyCPNveQS1AMlCFqNWWVnTrea8S OybDqACUcV2J/LPppsdNlJ48ST4ZwUzPVGiIEwhaI8+VEhxuEUwRR1AiTZFyZEZuJbI/ vFS9Cec2JEsPckaPSRvj2xGwmeIqzKFjzBeQVWpAGKFBBC4OmAHgN49i0XEKJQBh3pkW qDHUH+JQC0Z4pjosjOT2hCaV5/N53lfAoDxJJoW6zzQH6+DN3t/+5UdQhBbIg3jTaWbp HDvQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uX+dN39E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q6si2389548pgb.234.2019.06.14.04.45.17; Fri, 14 Jun 2019 04:45:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=uX+dN39E; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727637AbfFNLob (ORCPT + 99 others); Fri, 14 Jun 2019 07:44:31 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:41555 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727164AbfFNLoa (ORCPT ); Fri, 14 Jun 2019 07:44:30 -0400 Received: by mail-wr1-f67.google.com with SMTP id c2so2182539wrm.8; Fri, 14 Jun 2019 04:44:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nfOL/QEZKCqwjy4s7vi3c4DFfSxvD/93w3BZ2MZj8Vk=; b=uX+dN39E3i0FIlS5Q321OQ/Ml+GopVkhaRtA0MOAhayeHrvd5so3euF27cf7H/Z5Ei GIqhyq/D9j1Nxkqn43pH1JIlHBQsWCfBcp7RBiLSX/3mKx6JWVaZZ9HHsD/rYwk6Ogar 2bH5E/jYfTzaBsB7sEPA2q+Qgy45fLc0uQ4JSrZLBQMs45zYLbTGt79Hzh/KjBtvJIe4 S5HzMUt9HyOKba9ccuFk2Xhc+hlcsIZfsvAyCvxWsXr3ADCe6WfetwaRr4QeOREkV6lA Pe3p+ISTmpo1cIvUho0yivmqAdaqJF8duYIu84mIjn3HUQSAJgYJ5e7ixUVkCsFZg62L qlpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=nfOL/QEZKCqwjy4s7vi3c4DFfSxvD/93w3BZ2MZj8Vk=; b=eGHkm6CvRfEVwQ3FhRgtST/xZar29f1vW2PhzbA+2dExgtkLToLnwEsiDUWhCAbSPc rIs2W/pzInHyPlXydVF45tPatU1ComCzuOV07+2qje88vLskCip1E7iJFAtQ4rwFMoeG 9QaQYJcvigI/foT8d8EpHQ5sxIBS6jrJQAihOxbZOlTB7zPQc9WTbIVcYm4T3A/lEfS3 oeKQVLRiGwK8WPrpHew2zGe/8KRM2FW11HweMe+n/MjLCxtE+cz832Gt0Fis/NLbU3zl x2dtf5ZdDHM+9Y4sq5djbDjrenXmjuAIMxrx4bB2ZzojcjoN71aN862UEfJSaOjIHjxJ C8iw== X-Gm-Message-State: APjAAAUnH7Sf6XU2Vgl19xMRecE3fhzF3SgUaXQ9TVktgBn7SlLu/F6F LVbgzMDKgbNIbcMqQIPR9Qs= X-Received: by 2002:a5d:6b12:: with SMTP id v18mr65017972wrw.306.1560512668442; Fri, 14 Jun 2019 04:44:28 -0700 (PDT) Received: from localhost.localdomain ([185.107.117.129]) by smtp.gmail.com with ESMTPSA id b14sm2955592wro.5.2019.06.14.04.44.26 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 14 Jun 2019 04:44:27 -0700 (PDT) From: "Pavel Begunkov (Silence)" To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, josef@toxicpanda.com, dennis@kernel.org Cc: Pavel Begunkov Subject: [PATCH 0/2] Fix misuse of blk_rq_stats in blk-iolatency Date: Fri, 14 Jun 2019 14:44:11 +0300 Message-Id: X-Mailer: git-send-email 2.22.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Begunkov There are implicit assumptions about struct blk_rq_stats, which make it's very easy to misuse. The first patch fixes consequences, and the second employs type-system to prevent recurrences. Pavel Begunkov (2): blk-iolatency: Fix zero mean in previous stats blk-stats: Introduce explicit stat staging buffers block/blk-iolatency.c | 60 ++++++++++++++++++++++++++++++--------- block/blk-stat.c | 48 +++++++++++++++++++++++-------- block/blk-stat.h | 9 ++++-- include/linux/blk_types.h | 6 ++++ 4 files changed, 94 insertions(+), 29 deletions(-) -- 2.22.0