Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp5919785pxj; Wed, 23 Jun 2021 11:52:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyFkhYP+RmW02f8keLTyMC33FcA89D9znfcdH5UI2gRQ6TkE8Xp0wU/6B1toOd9MwwzjbPt X-Received: by 2002:a92:b00d:: with SMTP id x13mr655124ilh.181.1624474350054; Wed, 23 Jun 2021 11:52:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1624474350; cv=none; d=google.com; s=arc-20160816; b=IU6RbOVscfR5xZlrmkGkqK1FT5q5zQUDDQSoXwtiLG5ZXzULnBNOKpDe32Ba1g0thJ CuWwEbGyQ7jryDa8TdGQM1Zgk7QoANtW8VQwzBMcOVO7FhGwqIAL24q+q8nrgLJOQJYd yfHlKZuEvt+uPupxVAOn1y2OpsHa2xdStgcaNbOkegb87ShODdHlZ2KkjnIfw9mTtP56 Ardvb3YqcwAEvj11NxLLi2ieGK+fGqJ6CkkkeZs0C19wSVxEYNsfsJ9nJBURUMBwVyfL O1IEaW6USCRjebAPRXo50uNS524/DX70gXp+4FDEJ/5vRClSyRyO0x82WOfKqMVmkLKf ruKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:references:in-reply-to:message-id:cc:to :from:date; bh=S31Z4gXUFJU6w7cpk/OgrV1d1DLhc32fSkZ6tVi7j7w=; b=rBanigq8hVrtVyT49MZ6JK8wKOQJASUod+ncEENiU0DPXvhmKG+0TFi75ZHqBG/R5H MtdyaHN3A60NXPWFhD3FSl29aC8Dc9LrUTUmSW+V6skgy/gqyCJCE7903JmCH9c1IV74 erg49+uj+7RUvWLJvI2Us3JKhcNkq6GRszZu8Lo9VmSZQGadDKobUYtNN3IQrkLo5HRv 3/OZ4hQgAyeI+jwLQcdN/cvbODY7ZKsjmyezHWdZCRMWRl1sCA2jK7EanRFKTWULRLc8 jANU4kzoQqSLAsO8/wa0lhLXjp51N1XdY76zlOwL0ogrj7yUKYc0nu/Z353B/DZB37fG dBiA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j12si717819jar.85.2021.06.23.11.52.18; Wed, 23 Jun 2021 11:52:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230037AbhFWSwk (ORCPT + 99 others); Wed, 23 Jun 2021 14:52:40 -0400 Received: from cloud48395.mywhc.ca ([173.209.37.211]:41170 "EHLO cloud48395.mywhc.ca" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229660AbhFWSwi (ORCPT ); Wed, 23 Jun 2021 14:52:38 -0400 Received: from [173.237.58.148] (port=33338 helo=localhost) by cloud48395.mywhc.ca with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1lw7x5-0008I4-MG; Wed, 23 Jun 2021 14:50:19 -0400 Date: Wed, 23 Jun 2021 11:50:18 -0700 From: Olivier Langlois To: Jens Axboe , Pavel Begunkov , io-uring@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Olivier Langlois Message-Id: In-Reply-To: References: Subject: [PATCH v2 2/2] io_uring: Create define to modify a SQPOLL parameter X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - cloud48395.mywhc.ca X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - trillion01.com X-Get-Message-Sender-Via: cloud48395.mywhc.ca: authenticated_id: olivier@trillion01.com X-Authenticated-Sender: cloud48395.mywhc.ca: olivier@trillion01.com X-Source: X-Source-Args: X-Source-Dir: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The magic number used to cap the number of entries extracted from an io_uring instance SQ before moving to the other instances is an interesting parameter to experiment with. A define has been created to make it easy to change its value from a single location. Signed-off-by: Olivier Langlois --- fs/io_uring.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/fs/io_uring.c b/fs/io_uring.c index 7c545fa66f31..e7997f9bf879 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -89,6 +89,7 @@ #define IORING_MAX_ENTRIES 32768 #define IORING_MAX_CQ_ENTRIES (2 * IORING_MAX_ENTRIES) +#define IORING_SQPOLL_CAP_ENTRIES_VALUE 8 /* * Shift of 9 is 512 entries, or exactly one page on 64-bit archs @@ -6797,8 +6798,8 @@ static int __io_sq_thread(struct io_ring_ctx *ctx, bool cap_entries) to_submit = io_sqring_entries(ctx); /* if we're handling multiple rings, cap submit size for fairness */ - if (cap_entries && to_submit > 8) - to_submit = 8; + if (cap_entries && to_submit > IORING_SQPOLL_CAP_ENTRIES_VALUE) + to_submit = IORING_SQPOLL_CAP_ENTRIES_VALUE; if (!list_empty(&ctx->iopoll_list) || to_submit) { unsigned nr_events = 0; -- 2.32.0