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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 505B8C433EF for ; Wed, 24 Nov 2021 04:46:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229732AbhKXEuF (ORCPT ); Tue, 23 Nov 2021 23:50:05 -0500 Received: from out30-133.freemail.mail.aliyun.com ([115.124.30.133]:54610 "EHLO out30-133.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229588AbhKXEuF (ORCPT ); Tue, 23 Nov 2021 23:50:05 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R141e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=haoxu@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0Uy45oE2_1637729208; Received: from e18g09479.et15sqa.tbsite.net(mailfrom:haoxu@linux.alibaba.com fp:SMTPD_---0Uy45oE2_1637729208) by smtp.aliyun-inc.com(127.0.0.1); Wed, 24 Nov 2021 12:46:54 +0800 From: Hao Xu To: Jens Axboe Cc: io-uring@vger.kernel.org, Pavel Begunkov , Joseph Qi Subject: [RFC 0/9] fixed worker: a new way to handle io works Date: Wed, 24 Nov 2021 12:46:39 +0800 Message-Id: <20211124044648.142416-1-haoxu@linux.alibaba.com> X-Mailer: git-send-email 2.24.4 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: io-uring@vger.kernel.org There is big contension in current io-wq implementation. Introduce a new type io-worker called fixed-worker to solve this problem. it is also a new way to handle works. In this new system, works are dispatched to different private queues rather than a long shared queue. Detail introduction and data in 7/9. To be done: 1) the hash optimization isn't applied yet 2) user interface 3) cannot ensure linear order for works of same reg file writing since we now have multiple work lists. 4) code clean Sent this for suggestions. The test program used in this patchset: // nop_test.c // remove some error handling, variable definition, header files etc. typedef long long ll; ll usecs(struct timeval tv) { return tv.tv_sec*(ll)1000*1000+tv.tv_usec; } static int test_single_nop(struct io_uring *ring, int depth) { for (i=0; iflags |= IOSQE_ASYNC; } ret = io_uring_submit(ring); for(i=0; ilock io-wq: reduce acct->lock crossing functions lock/unlock io-wq: update check condition for lock io-wq: use IO_WQ_ACCT_NR rather than hardcoded number io-wq: move hash wait entry to io_wqe_acct io-wq: add infra data structure for fix workers io-wq: implement fixed worker logic io-wq: batch the handling of fixed worker private works io-wq: small optimization for __io_worker_busy() fs/io-wq.c | 415 ++++++++++++++++++++++++++++++++++++++--------------- fs/io-wq.h | 5 + 2 files changed, 308 insertions(+), 112 deletions(-) -- 2.24.4