Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp1395707ybf; Sun, 1 Mar 2020 08:19:54 -0800 (PST) X-Google-Smtp-Source: APXvYqx39f7ignBUQvHamQDuNcSmDsInFsp+9wDlgCOQKbvbt06iHl7toc1/BPMaxFq0RrfQY9OG X-Received: by 2002:a9d:7508:: with SMTP id r8mr10173840otk.116.1583079594336; Sun, 01 Mar 2020 08:19:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1583079594; cv=none; d=google.com; s=arc-20160816; b=WKhGsQHu01XCX8JTlKtj6iOsfsQgwYVn3N739HGQLBPhTP3x4+B4P7QgOXHL66cvyq Yf+qAcQXd24P0a6Z06U8+uNLUKPzVhfRvUVWV8dk4bEQBSxJrIlAahY3/vs1zhgennKW mZDFUX2uRH8grG0XyrmhSiH8iibT8xY7X/P1SIY/u4oKH+DFDQiwi2S0iFMQFjZu+adB 18JMaTFuBxxqWsFYDKSRP9WucJ4HU2fzfnoVwM/R3nQR3L8/3o6P4FLZs4YFGDZMPXgq yzg7+222KSZG71jU3BUDlxTILDh9VO3YODv1BxBedYA/Ydx7JQGcCd86byRN/Uv0O3OH pboQ== 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:to:from:dkim-signature; bh=vW+Ty405jQ8HcjAn8g6TletdwFBEFprHNMTBYXmVxvw=; b=y/59UjSTLj8ClRtV5tQGXTbxPriGKCkmaAaKvX1LDq3o58//4s5UA0KBvTC94I9WHq tLD5y4qaQ8hS6RZJKT1EeGKY2OQqFfsHjnpEbzynQyOrweaW/6m3YCp7QSGVOz17W503 c2UeXTkAMtOX7c14u3zpRn93JUOkhZvSR54QXFtH/iczgep4JhnxkAPjmrSj7tODsT5a rfjQYVvYvsHOGYAmRlDtG9cXvNHjoK1WjZkBbHx08BbN2zBXETnlcrZ3NMmArfjwZ5to BUNPNwYvJTOf4VOJgNeDse2WLx+XVQiMqxe2zAZPBolK56PhJUw1vuDcqwu0sdkfC8ia FdvA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=WiDrt86p; 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 q11si2947214oti.270.2020.03.01.08.19.39; Sun, 01 Mar 2020 08:19:54 -0800 (PST) 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=WiDrt86p; 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 S1726783AbgCAQTf (ORCPT + 99 others); Sun, 1 Mar 2020 11:19:35 -0500 Received: from mail-wm1-f67.google.com ([209.85.128.67]:51547 "EHLO mail-wm1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726627AbgCAQTf (ORCPT ); Sun, 1 Mar 2020 11:19:35 -0500 Received: by mail-wm1-f67.google.com with SMTP id 9so2270436wmo.1; Sun, 01 Mar 2020 08:19:32 -0800 (PST) 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=vW+Ty405jQ8HcjAn8g6TletdwFBEFprHNMTBYXmVxvw=; b=WiDrt86p2qgfDc3uubQrmC204LYld9wyx9Ibu2TPRNo8CxkGZf4SUHnwkqTgqlDtYK n7VoqwhP7/D7N+8mZvgtOLWgUs5fgLS1FgjkEqz7eYY0cOhDr1GaHVIZDp5GaFZ9/NBy CvnrW2inMePmNagrot2v5xHlYf6ldAubWFVCzYfibQBcgUckjqfvn5irK/1IRlKocyIS /I56cbkn1vj+Uv7evpeKIw/GVQfGwTyXXnAECSgqsWKsfQk7W1DQJc2ZLvPUiqOS3OoB 0HAXMmBoJWPttCz1/DEQXp5qFk4Oie4cOEk1m1qD216ibcfp/mTNVFsQiIy4l7gv9ezK NZ2A== 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=vW+Ty405jQ8HcjAn8g6TletdwFBEFprHNMTBYXmVxvw=; b=InzhvAMRyI6ZIl+1qbBVXdllmTYUWeRhEJ2/eORXIpakp3UPD+uWvWMkn6dkvz7q1p yqGCzoeHnH3Qz/nLmtv5RoQu0cXp38iuqNGyGkm7OuAn6kXxmfEPN7turuRcfPVZbKhv jp55JPKjHtcvg9wglWJoy3qXWmNp0ZvfR08aqVjTkKHAd77VcaMAxknbWmd06vcTasQN 3IYawFl5Ea8rzyVn3QGMP6I/lkJBEXKM7yI3TwqrVuobk6jthBLGGVa0ioawrQwWOnHO NQbe6EGx5TupVEbV1OzDJQGji3TG+HaLvY8yu1258PMz3Cgx6WbSUELl3ud7bf++tEYV bP9Q== X-Gm-Message-State: APjAAAV/ue+oiXz4WuCEbm45QgfqSRowYhUwQvyl61rnxHeSI0E3BpPw uFkpTQ2uarOrFdbkkFHhXfE3VBYx X-Received: by 2002:a05:600c:2951:: with SMTP id n17mr6916119wmd.97.1583079571366; Sun, 01 Mar 2020 08:19:31 -0800 (PST) Received: from localhost.localdomain ([109.126.130.242]) by smtp.gmail.com with ESMTPSA id q9sm15864741wrn.8.2020.03.01.08.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 01 Mar 2020 08:19:30 -0800 (PST) From: Pavel Begunkov To: Jens Axboe , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH RFC 0/9] nxt propagation + locking optimisation Date: Sun, 1 Mar 2020 19:18:17 +0300 Message-Id: X-Mailer: git-send-email 2.24.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 There are several independent parts in the patchset, but bundled to make a point. 1-2: random stuff, that implicitly used later. 3-5: restore @nxt propagation 6-8: optimise locking in io_worker_handle_work() 9: optimise io_uring refcounting The next propagation bits are done similarly as it was before, but - nxt stealing is now at top-level, but not hidden in handlers - ensure there is no with REQ_F_DONT_STEAL_NEXT [6-8] is the reason to dismiss the previous @nxt propagation appoach, I didn't found a good way to do the same. Even though it looked clearer and without new flag. Performance tested it with link-of-nops + IOSQE_ASYNC: link size: 100 orig: 501 (ns per nop) 0-8: 446 0-9: 416 link size: 10 orig: 826 0-8: 776 0-9: 756 Pavel Begunkov (9): io_uring: clean up io_close io-wq: fix IO_WQ_WORK_NO_CANCEL cancellation io_uring: make submission ref putting consistent io_uring: remove @nxt from handlers io_uring: get next req on subm ref drop io-wq: shuffle io_worker_handle_work() code io-wq: io_worker_handle_work() optimise locking io-wq: optimise double lock for io_get_next_work() io_uring: pass submission ref to async fs/io-wq.c | 162 ++++++++++++---------- fs/io_uring.c | 366 ++++++++++++++++++++++---------------------------- 2 files changed, 258 insertions(+), 270 deletions(-) -- 2.24.0