From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.openvz.org (unknown [69.168.225.77]) by lore.virtuozzo.com (Postfix) with ESMTPS id 1676F8017D for ; Thu, 1 Oct 2026 15:26:09 +0000 (UTC) Received: from mail.openvz.org (localhost [127.0.0.1]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 691FOqRu005154; Thu, 1 Oct 2026 18:24:53 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 691FOqRu005154 Authentication-Results: mail.openvz.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=virtuozzo.com header.i=@virtuozzo.com header.b="Qp1jvmLo" Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by mail.openvz.org (8.14.4/8.14.4) with ESMTP id 691FOpVo005150 (version=TLSv1/SSLv3 cipher=AES128-GCM-SHA256 bits=128 verify=FAIL) for ; Thu, 1 Oct 2026 18:24:51 +0300 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.openvz.org 691FOpVo005150 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-49953abe51fso43693145e9.1 for ; Thu, 01 Oct 2026 08:24:51 -0700 (PDT) X-Gm-Message-State: AFq9FYJHxrcUEBgmCxrP3iD3Dw2MT/6haQwH1GMHT2TzYcj2l/qcch1B rBb3QIZLJ12AYliGb0HEA3+tpdtM71uFXOh7BAqBGJQ1mJ4HD6Um8bqf8rjxnLSyT2tN+1ztJ4S cGhBBCUreorSmK9A3aMZWJJbmrg/bWRd8JuRzKTgESu+K30fWDVfSQQ== X-Gm-Gg: AYBFou323jlVIj5yP745wMNCbYsuAAc/H2YGk/JzZAcgQkEucXaZm2aw8GeQ7uRMfGj dEm+21euIW9+S1GTSBcp7e6uE58i+Dwm83SGjA8f/8LyeOSpt/Wn0vhG9fiv9CXLaFeZH0wnNXC OEHZ7jKFNBuW8v5z6NIDUmqyFY3G2PAMq4AOe8iXeR/mPAkxszJBwpHLn1WDvjcpKFWd4et+WWc KDdRGaroZW9HmWc2DGyVgMuZcEH5TVwe8L53inM3HlU9zoF9+RdtT2lSAz7J47AMBU+kqtFr05Q mNDjLyhxjUHBXo3lfLGebUfAle7irLAL4ZXKormqL9REytB8Zr5hy9Z9NIvhqXGIUTvTGe4j14P m8r6rVfg7zquluEapkooF4OCUaX6UrIM= X-Received: by 2002:a05:6000:40ca:b0:487:ab6:bc1b with SMTP id ffacd0b85a97d-48b024d8c35mr8586824f8f.9.1790868290467; Thu, 01 Oct 2026 08:24:50 -0700 (PDT) X-Received: by 2002:a05:6000:40ca:b0:487:ab6:bc1b with SMTP id ffacd0b85a97d-48b024d8c35mr8586713f8f.9.1790868289334; Thu, 01 Oct 2026 08:24:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1790868289; cv=none; d=google.com; s=arc-20260327; b=NH+C1ru0L4aAEyfW+y7oZ8mS7MjR4AdDhn/gE4AOEk5LL24hO/7++odjC6sBRB8R08 szp9+COhQvU7Zf3DYxQpwYhHPLkTAgJBDIxLfpgQWDdv0hlS2GvmVrqdUYA9VenWCpox VgFXXKRSndpwkIprmueu23z4f48qvw7qjnk7ABMIGHX3hpLBsU7mbAL47KMzesXCaEVX Y/FHkJmo+rn9/eMoNWHj7SITtdwUOk02wr5b8dp/rHI/xgRT5Kum47hxuxueEoFd3Ody QCtXUiXpVmlO3kXq0QsBGLbkDFymzrrjqLsjJRLh3gbLnVu9A1zJQKJn/bVw5VX2LYGe kblg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20260327; h=cc:to:message-id:content-transfer-encoding:mime-version:subject :date:from:dkim-signature; bh=CvaOAW5ZTAebBN4MiB573Mq2BEgdAbIEVoFPeY8Jmf4=; fh=26FXTO6eY/S3gvyMXNKNKTFHQ0lD1bPkQ8wRpe0tMZI=; b=L0FrFqeuEN0hIPnL60XjNJrro0mEnbVCmUwkBOUqn2cPHLYe+m8uDu4VUYnVUAQl+6 gq3+AibO18w5v2vExXHqp23IlRrXMyDpZy5KXu5aDZj2lQOyyMTWESgfkq7pNPXbN29m 4n8XMFiLP7gAs09mQhbXDJYOa0oR6u/JZj+fdyPlnbhkRCkbAQb9JYwEI9Hge8bkI98V RbBqwSoqhea+umr9BP6mYrXarMpQ2puXzTvlChV9jfJJbp5GXmZugTxpzR5allPr2cBj WnU4m38xLcZBH8hGzm2uZ2nFEoWoX2FA0EK9KYxapAEYu4P9soWsfTZB4Qkr++coGALZ 3prQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Qp1jvmLo; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com Received: from relay.virtuozzo.com (relay.virtuozzo.com. [130.117.225.111]) by mx.google.com with ESMTPS id ffacd0b85a97d-48b06b424bfsi6221816f8f.379.2026.10.01.08.24.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2026 08:24:49 -0700 (PDT) Received-SPF: pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) client-ip=130.117.225.111; Authentication-Results: mx.google.com; dkim=pass header.i=@virtuozzo.com header.s=relay header.b=Qp1jvmLo; spf=pass (google.com: domain of vasileios.almpanis@virtuozzo.com designates 130.117.225.111 as permitted sender) smtp.mailfrom=vasileios.almpanis@virtuozzo.com; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=virtuozzo.com DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=virtuozzo.com; s=relay; h=Message-Id:Content-Type:MIME-Version:Subject:Date :From; bh=CvaOAW5ZTAebBN4MiB573Mq2BEgdAbIEVoFPeY8Jmf4=; b=Qp1jvmLoKSwcJVGamhc ulphavshA+4TRqIHLI8fsnoOK8IfkKmia22uETRZq7enkKWW8VUrZ19qiXSrjwkOF4zzm8cBArKn9 xbOR0Ey8NqnBDAk8gLtaYpuhj/l2wY9Q5PIRjsmslqQAtvaITNjoqpmrb7AlwXfaBSBy6mUm40nic LRdpdwUVqtogemq8RE265mknrupz8zPODrqgN2B1dXhnu407jmdL2KCyt3tiUFZbdjdhPI5okcGV5 qZv7Y8RHjZJ+QyUpdkOz0NaIrWSJ1wf7/soqPLJtGn+wD/YIKGZko633jJa7myAXieYSDe0u6/jrQ H6CJ3VZ7Z8s2h/w==; Received: from [130.117.225.5] (helo=dev010.ch-qa.vzint.dev) by relay.virtuozzo.com with esmtp (Exim 4.96) (envelope-from ) id 1xCIbH-00HKmx-1e; Thu, 01 Oct 2026 17:24:46 +0200 From: Vasileios Almpanis Date: Thu, 01 Oct 2026 15:23:59 +0000 MIME-Version: 1.0 Message-Id: <20261001-blk-flush-ts-plug-v1-1-22d9a1f0c9bf@virtuozzo.com> X-B4-Tracking: v=1; b=H4sIAA57vmoC/yWMQQ6CMBAAv0L27JptbQz4FeNB6kIXGiRdakwIf 7fCcTKZWUE5CSvcqhUSf0TlPRUwpwp8eE49o7wKgyV7NUQG2zhiF7MGXBTnmHsk66hm1/jm4qB 0c+JOvvvzDsEL1mcDj0Nobgf2y/8I2/YDZy9Esn4AAAA= X-Change-ID: 20261001-blk-flush-ts-plug-02408e49c934 To: Konstantin Khorenko X-Mailer: b4 0.16.0 X-Developer-Signature: v=1; a=ed25519-sha256; t=1790868288; l=2157; i=vasileios.almpanis@virtuozzo.com; s=20260812; h=from:subject:message-id; bh=rajVyGQLOMXn4aGWKUj9s9RWn6orw/jXHX1XgZ5Qz70=; b=k9pE63wA5L+nIlhzn3f67kjz4+kLEpkaqSTToGSTw/QbZ/tN0HdygkbL0u4CkGO0JZbQwvOVo lHLdB38dy3kCRbPwO4oCxaSLKGg9yfBqyG+uAw/dinVAPKeRZo6fB9B X-Developer-Key: i=vasileios.almpanis@virtuozzo.com; a=ed25519; pk=HhuHDXAcPva9A8zccWEMRsb36reu+y4IVbBjXKxNUjw= X-OZ-Fwd: true Cc: devel@openvz.org Subject: [Devel] [PATCH hci-8.1] ms/block: drop the cached plug time when blk_add_rq_to_plug() flushes X-BeenThere: devel@openvz.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: OpenVZ development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: devel-bounces@openvz.org Errors-To: devel-bounces@openvz.org blk_time_get_ns() caches the current time in the task's plug. The idea is that the cache lives for one plug and is dropped when the plug is flushed. __blk_flush_plug() and finish_task_switch() do that. blk_add_rq_to_plug() also flushes, when the plug has too many requests or the last request is at least BLK_PLUG_FLUSH_SIZE. But it calls blk_mq_flush_plug_list() directly and never drops the cached time. So a task that keeps submitting without sleeping stamps every request after that with the time first cached in the plug. start_time_ns and io_start_time_ns are stale and the disk stats charge each request for the whole time since the plug began. Drop the cached time after the flush, same as __blk_flush_plug() does. Fixes: da4c8c3d0975 ("block: cache current nsec time in struct blk_plug") Cc: stable@vger.kernel.org Signed-off-by: Vasileios Almpanis Link: https://patch.msgid.link/20260930-blk-plug-ts-flush-v1-1-bf8ca7bc5cd6@virtuozzo.com Signed-off-by: Jens Axboe (cherry picked from commit e0f2224433b15a57125d6ac5d46182f99c6c9d08) Rebase note: the commit is in the block tree (axboe/linux.git) and not in mainline yet. In this kernel blk_plug_invalidate_ts() still takes the task as an argument, so pass current. https://virtuozzo.atlassian.net/browse/VSTOR-147945 Feature: fix ms/block Signed-off-by: Vasileios Almpanis --- block/blk-mq.c | 1 + 1 file changed, 1 insertion(+) diff --git a/block/blk-mq.c b/block/blk-mq.c index 14d29634c531..12ae5928a768 100644 --- a/block/blk-mq.c +++ b/block/blk-mq.c @@ -1387,6 +1387,7 @@ static void blk_add_rq_to_plug(struct blk_plug *plug, struct request *rq) (!blk_queue_nomerges(rq->q) && blk_rq_bytes(last) >= BLK_PLUG_FLUSH_SIZE)) { blk_mq_flush_plug_list(plug, false); + blk_plug_invalidate_ts(current); last = NULL; trace_block_plug(rq->q); } --- base-commit: dcd9000e6b239a27d1450a9ac7927a41596733e8 change-id: 20261001-blk-flush-ts-plug-02408e49c934 -- Best regards, Vasileios Almpanis Software Developer, Virtuozzo. _______________________________________________ Devel mailing list Devel@openvz.org https://lists.openvz.org/mailman/listinfo/devel