Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp6663280ybn; Mon, 30 Sep 2019 01:32:27 -0700 (PDT) X-Google-Smtp-Source: APXvYqzzG/V3YopSPTt5mEeaM8eXchKVlaO1q/oP+ddTR4fFI/NmSdK65nxVmueqjhcPVwobroZx X-Received: by 2002:a17:906:5382:: with SMTP id g2mr7794574ejo.203.1569832347008; Mon, 30 Sep 2019 01:32:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569832347; cv=none; d=google.com; s=arc-20160816; b=iWcXV6BplcARBDO6FMu6lQCBu9lOCNs6G5/Gikvvqu1irNaaaPiNdwd3K98M77qsiD pGrJuxzpL0NEOpAZ04uSPeFnwJLZsVYhNqVezAGqSIfk1gms+0ik7lNMDhbB2LaegW/E TPpjyjKAHlBfSvvQXEpQwEsSuTuWzP/1eNP4ST6+4rfHgaBylMGJRZaWGLKuBgbX8NXx dVi6yNw5WYyhqilpHOHkgW4JctZK5Jyfoi2Y7tfNx+ddo1ZoJgu6o3Yzh38xZfa/Ga5z PEnF0JBklL+ldvSJ+CTbQcxIhE9QietHkHCWoFM+IYVzE1rA7Sd599NDNnNIc2BE5EsI XbZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:mime-version:user-agent:date :message-id:subject:autocrypt:from:references:to:dkim-signature; bh=cMSmKksRpZvm7DjI+W2FPVfuQhvxd33fHRo5ksvWmP4=; b=z7331hQY0csq1q/INNovlbDrRG86avLczK8ZCu1IbA4qrfcB8Vy4ZKyfHjXyfbDNN3 PkpWws9pWI7Mxo2JFZETJevgiofTaC+rkg9oDaLPDPglKZsxnpCp1Q+nNmwjgwxvXlvY jsr27MJOexrUvkAXbtKiJSNEU7GXdZEXJ6IYApCrJQ2tCdaR9b09j2+4xcXQ8g9aczaz H7+JhIXq9Qu0SCpqTLvEttZHrI6yRrovWDkgy9ile8nlKmcRkHiXe2kH/sNRi3YzFKC5 v6YGpDYbuk5WgJDmeTIUob5Xq2m0ZkQCPt/j3XMu6PCM8OZYN7kF21wzV1ftQTJH4xsS d5tA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=dRuBx2TC; 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 x45si6445994edd.388.2019.09.30.01.32.02; Mon, 30 Sep 2019 01:32:26 -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=dRuBx2TC; 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 S1729943AbfI3I31 (ORCPT + 99 others); Mon, 30 Sep 2019 04:29:27 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:41660 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726121AbfI3I31 (ORCPT ); Mon, 30 Sep 2019 04:29:27 -0400 Received: by mail-wr1-f65.google.com with SMTP id h7so10168078wrw.8; Mon, 30 Sep 2019 01:29:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:references:from:autocrypt:subject:message-id:date:user-agent :mime-version:in-reply-to; bh=cMSmKksRpZvm7DjI+W2FPVfuQhvxd33fHRo5ksvWmP4=; b=dRuBx2TC1uq36DDhogFse6nwMfAp/ucimdeY6k5ppTn2Xho+z3y/ZjUdHhQcPoazXo cUl5M2Tc2K6mKaKlg+SBDvdy7Oi3X7/ikExmnGLRT8sGsNOpxOiEHe6QK7uPo/VY0CXK CVzAd7AnOL8C+caYQYuaodnOP3e54tWdY5iqQe/Cyb8kAEKxKQs1s1QktwlZCCLiO/VU u/RomifRoQXgVF/ZB3ahSgGkC3anJWf1MWewAskf6e5kleYuhEMhhAW5MmC81Er9o0Et N8BH6XxrP3+LHJxEPhEDwii7muqWvRD/et3s8ml3IWlUZYc7iWKvuRtsKTfBeoTgGStr Gkaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:references:from:autocrypt:subject:message-id :date:user-agent:mime-version:in-reply-to; bh=cMSmKksRpZvm7DjI+W2FPVfuQhvxd33fHRo5ksvWmP4=; b=GvrvsqXd6V1kWtjWAu/+XmDmeFHLaYYsaBeLKimkmaSJEIDanSG0rvFFJEGs+zJlyX 6pFAOnOYkc3YSvL/7GhskG3jcyPwi3Fbi75nyA2JTA7ycYt/UDSA6OenfHMDuNbAhxWH dfTigWD2rXTcC/1ArGfAoOpjD3P8mWS2UkvwPiBQ5MA/vbp9eVdJORy+LPrM0oZqJmAN nAwh/lrhDJZTdk8Sm+vHz9OCTnbl2oNxOvE/P+5+8W3/TzZQgw768xG5fiMnl212DdOa 54/5W+eRuCCDEoZWE6qGoPMS17gUcn3oZXFwwRNJXQ/lYgABwe5kv8uvdLMeaj2EKrJ0 2EnQ== X-Gm-Message-State: APjAAAVoFbPLykxTnSLw+2FI2XrHUYu7FQcL/35AbYq8TuOUeTiw4Ltu +QXwIU1Bh7AkrhYRIyQiYiyK5TgazyU= X-Received: by 2002:adf:e348:: with SMTP id n8mr11126221wrj.299.1569832162487; Mon, 30 Sep 2019 01:29:22 -0700 (PDT) Received: from [192.168.43.187] ([109.126.142.9]) by smtp.gmail.com with ESMTPSA id a7sm25567078wra.43.2019.09.30.01.29.19 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 30 Sep 2019 01:29:21 -0700 (PDT) To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, josef@toxicpanda.com, Tejun Heo , cgroups@vger.kernel.org References: From: Pavel Begunkov Autocrypt: addr=asml.silence@gmail.com; prefer-encrypt=mutual; keydata= mQINBFmKBOQBEAC76ZFxLAKpDw0bKQ8CEiYJRGn8MHTUhURL02/7n1t0HkKQx2K1fCXClbps bdwSHrhOWdW61pmfMbDYbTj6ZvGRvhoLWfGkzujB2wjNcbNTXIoOzJEGISHaPf6E2IQx1ik9 6uqVkK1OMb7qRvKH0i7HYP4WJzYbEWVyLiAxUj611mC9tgd73oqZ2pLYzGTqF2j6a/obaqha +hXuWTvpDQXqcOZJXIW43atprH03G1tQs7VwR21Q1eq6Yvy2ESLdc38EqCszBfQRMmKy+cfp W3U9Mb1w0L680pXrONcnlDBCN7/sghGeMHjGKfNANjPc+0hzz3rApPxpoE7HC1uRiwC4et83 CKnncH1l7zgeBT9Oa3qEiBlaa1ZCBqrA4dY+z5fWJYjMpwI1SNp37RtF8fKXbKQg+JuUjAa9 Y6oXeyEvDHMyJYMcinl6xCqCBAXPHnHmawkMMgjr3BBRzODmMr+CPVvnYe7BFYfoajzqzq+h EyXSl3aBf0IDPTqSUrhbmjj5OEOYgRW5p+mdYtY1cXeK8copmd+fd/eTkghok5li58AojCba jRjp7zVOLOjDlpxxiKhuFmpV4yWNh5JJaTbwCRSd04sCcDNlJj+TehTr+o1QiORzc2t+N5iJ NbILft19Izdn8U39T5oWiynqa1qCLgbuFtnYx1HlUq/HvAm+kwARAQABtDFQYXZlbCBCZWd1 bmtvdiAoc2lsZW5jZSkgPGFzbWwuc2lsZW5jZUBnbWFpbC5jb20+iQJOBBMBCAA4FiEE+6Ju PTjTbx479o3OWt5b1Glr+6UFAlmKBOQCGwMFCwkIBwIGFQgJCgsCBBY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RactyNtF8jZQbhMCC8vMGukZtWaAwpjWiiH bA== Subject: Re: [RESEND RFC PATCH 0/2] Fix misuse of blk_rq_stats in blk-iolatency Message-ID: <276a02f3-3b1a-0580-54fb-497f85103ae3@gmail.com> Date: Mon, 30 Sep 2019 11:29:21 +0300 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="vpDpuljOak4VUjubg0p6HLJIDCCP6aiBm" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --vpDpuljOak4VUjubg0p6HLJIDCCP6aiBm Content-Type: multipart/mixed; boundary="iwCQfC1143W97Fjrsn5ILXvfBDPud4pYO"; protected-headers="v1" From: Pavel Begunkov To: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, josef@toxicpanda.com, Tejun Heo , cgroups@vger.kernel.org Message-ID: <276a02f3-3b1a-0580-54fb-497f85103ae3@gmail.com> Subject: Re: [RESEND RFC PATCH 0/2] Fix misuse of blk_rq_stats in blk-iolatency References: In-Reply-To: --iwCQfC1143W97Fjrsn5ILXvfBDPud4pYO Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: quoted-printable Hi, I claim, that there is a bug, that hopefully doesn't show itself apart from a minor disabled optimisation. It's _too_ easy to misuse, and if somebody try to reuse, this could lead to quite interesting issues. Could somebody at last take a look? Thanks On 25/07/2019 00:35, Pavel Begunkov (Silence) wrote: > From: Pavel Begunkov >=20 > 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. >=20 > Acked-by: Josef Bacik >=20 > Pavel Begunkov (2): > blk-iolatency: Fix zero mean in previous stats > blk-stats: Introduce explicit stat staging buffers >=20 > 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(-) >=20 --=20 Yours sincerely, Pavel Begunkov --iwCQfC1143W97Fjrsn5ILXvfBDPud4pYO-- --vpDpuljOak4VUjubg0p6HLJIDCCP6aiBm Content-Type: application/pgp-signature; name="signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEE+6JuPTjTbx479o3OWt5b1Glr+6UFAl2RvOEACgkQWt5b1Glr +6UKiBAAgW2BL4yvqLYVizbAQnkdFQG/KreGrf5vyKZhcv2UHjoMvO2EUQzpwX2v FMaHbFAx5tOnjeoWmwXjYuAJLAnu3qT1+tGtVUFxWcDbyTnrnqAEMB9dItDr2Ga5 K6smdf9rZhnFufPiJfJ0dFqBlfqJ1YhY3L5PG8as5/9Um9B/JCCb0Hjft5yoG2Gs lsVh+RFzw8hHSptJOru/Fz6oKVDiMloqRSCWhiS7hXquMUhcPusAJLzGPhQ8Kv7o W8bZOcs99Ijp8Ye5xlgLtohBtpN1C/+ZFMHVxv4UH+JrPvwFzLDCD/mCfGLWTbUK N8ypzi5AW4KmlBAbzUs8HjQk7FvswcazyWRRm9bg4JWEE1TLgUMrrWmUsHxLlnDO knNWMjD9+PO7BrYtQm6OUX4+0Jz9wUtYBGSZF7IXLCutJ9/NloHRTFIQWXnp2NX8 WWhB1x590ljZ1REULO1312qztHOQyEOgI9vGV1jlMMQPp5RzRAHeJyC2Ay0JSt43 RZBkbjkG5tcSZ/atpzi/LhXW4PIN3IBvto9F1WYpf465ISjFhmHfEk7K+Tcfa+S1 QfHO3/t2dmFEH/2vm2/foff0av4HedV3gtulofAjpH7c4SVFWJGRjGDewrsap/C2 zMKGPSyJnh8D+boNOMkiLV8qI0juyFQD7MTybazl6u8vHqVssVQ= =CxFQ -----END PGP SIGNATURE----- --vpDpuljOak4VUjubg0p6HLJIDCCP6aiBm--