From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.6 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_GIT autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3F3CC38A29 for ; Sat, 18 Apr 2020 17:21:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD0E020776 for ; Sat, 18 Apr 2020 17:21:24 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PKlV8rD5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725903AbgDRRVY (ORCPT ); Sat, 18 Apr 2020 13:21:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57212 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725887AbgDRRVY (ORCPT ); Sat, 18 Apr 2020 13:21:24 -0400 Received: from mail-wm1-x332.google.com (mail-wm1-x332.google.com [IPv6:2a00:1450:4864:20::332]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A64B9C061A0C; Sat, 18 Apr 2020 10:21:23 -0700 (PDT) Received: by mail-wm1-x332.google.com with SMTP id z6so6384698wml.2; Sat, 18 Apr 2020 10:21:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=3Mmyrgp0gwbPy6iOJUPF/mmRY393aiDlZLAI44AwPnY=; b=PKlV8rD5CiWKWjGUgZHEn7MV3BvKjxu5WxiIqR1UnvYtq3UeE/1Np9m4rHOGycHAcz Qv02GlkcSHX34Obl14fZcil8Yn2wuBVtJ/Df8WudJ+mONpXAhQXH3gjbXTMhd9cjmGVM vke2AET9Wk63y+GQcxFmPgRplSNAy28LR5bAPL2T9PkFy1ymGI5q/wU+JM3ZVov42GjV kSNAWf+2KRNXz7gzS9K2PnAO9kifPYoBPjV8EqPSokrH+JsGc0hPuL6NmePyWmcTgx+C ucRLyIxrmMXzRHYu7qjtAb5yhGskSoa/PdiQ7q6lAg4ITP0JYT937x5Vckzvy+1YGybJ cW3Q== 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:mime-version :content-transfer-encoding; bh=3Mmyrgp0gwbPy6iOJUPF/mmRY393aiDlZLAI44AwPnY=; b=FFahLyrNtWF5MrL4YAzJAOPYOsJK0Gtt025obq2X85VJ0MXWGUUjw0F/t3Q7tdT/P7 +kRUf9x1jOyXpKewtN3rqJbTdUgLrtNPTIx0lzH7tJSFkff6Ftiso+Xh7bl5JbLMFb4l rlVFBFMzBHLE4EuXRW2u6OVx1FmMrjieL45MGTBn/EAfnFiWhpsz862ks2RUlrWs/CNE kKkz0aI2PHE5uBcCI8NbFcGu8O1giEvBc0+d0xZvHjEtRYgvHa6/868U8x97ejQDQja7 mf/9loiW4TuqjiiZbp2LlFQOMUxzKwElb7mbjbncDYrnLln+xj7Rkr9bYYeC9gDCcQJN wskg== X-Gm-Message-State: AGi0PuaFe/BQbpTVeyp9frH/8vn4agrMQgp2J+jqoFxd+HJcuF7aVF2B 7VEE9DM5O+hHMBEuV3HgyWBmuSuO X-Google-Smtp-Source: APiQypIRlBCTZlXxHVqWq17ZY/wPksDEr9J5qLbuTCyeGbBLxwEaquHKaj9BCAioBLUjmVAeDNGuIg== X-Received: by 2002:a7b:c944:: with SMTP id i4mr9501673wml.144.1587230482199; Sat, 18 Apr 2020 10:21:22 -0700 (PDT) Received: from localhost.localdomain ([109.126.129.227]) by smtp.gmail.com with ESMTPSA id b85sm12538247wmb.21.2020.04.18.10.21.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Apr 2020 10:21:21 -0700 (PDT) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH 0/2] CQ vs SQ timeout accounting Date: Sat, 18 Apr 2020 20:20:09 +0300 Message-Id: X-Mailer: git-send-email 2.24.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: io-uring-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org The first patch do the job, and triggers after __any__ CQEs, including ones from other timeouts. And it obviously fails to pass the tests. The second patch makes it to count only non-timeout CQEs, and passes the tests. Feel free to squash them. Fixes Hrvoje's issue. Also, there is one more bug to be fixed. It's related to bulk completion, and manifests itself with both implementations. Pavel Begunkov (2): io_uring: trigger timeout after any sqe->off CQEs io_uring: don't trigger timeout with another t-out fs/io_uring.c | 107 ++++++++++++++++---------------------------------- 1 file changed, 33 insertions(+), 74 deletions(-) -- 2.24.0