From patchwork Fri Aug 16 18:01:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13766746 Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C2EB01AC8BE for ; Fri, 16 Aug 2024 18:01:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.171 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723831311; cv=none; b=c+DyWVKKIIOWu2OTpkzmcOY1HAbRi2IomFd5Q3VF5Am4sELciIOYaRUkGYloc7sMvpu8wTwVphxs5MDcmNKFJC8We+XDE5dIpcuhIg/iE1hpPQeTAs+PaalyCAPSMYsOs1w/QvWwkZA73UGBMemODZs8z4/nJ5vooI+faQUONLY= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723831311; c=relaxed/simple; bh=1pjiXVrs23bAZoampHMpZnf6iRv1ZrGUp9ewj3/VB1k=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lcqvKoKjYRJc4NEGxYY5W8GMUmbKyb+i+aQjZIocC+xAN7pLu+KF4n9bhVbjDJYbpmMA2RsPjmoFytuw65Cjjk6eal6IldQlGbJ1DMTaxa8aIyXWM68ynt1kqoctDme7a+BC/RH1nr1xNtzcykCjTdlXDXoARLEyi2mrfip/u4I= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=XxQG/vqK; arc=none smtp.client-ip=209.85.214.171 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="XxQG/vqK" Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-2021a99af5eso20995ad.1 for ; Fri, 16 Aug 2024 11:01:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1723831309; x=1724436109; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=ke3AOIKA3Yax3N7x8wo2tJPHEZgh5pyF9+zELxS8yp8=; b=XxQG/vqKoMu2ZrWxkXiFv7vQ080p36YKI7CytQMzSfXVdo4RQ8RNSHqMUwwYZhWsET fJSrS7OLDSlWaJN7tmlb0gWgO0BSCKs6WUxcrEVKGJMXAwMZ2CPxfd6KnI3cyDtrqNEG aUDXW3kN2tTzkz8k75rhIrCj4bkguzuDnIfzPeTJ9DScsNncT06N5LqIzHY4677ZjMhH 9tv4gXXE64M+GSlluTJQmtzIwTn5sle6mRH3W67avVypxQvLHawlPTYpq6lHNb19CEFi weOLF36EnlukVJhvDe9GcXM6AD3CB0LU8p2ckhVozyKXD8m86l68y6Wr9Hx1chs97iiL GVIQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723831309; x=1724436109; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=ke3AOIKA3Yax3N7x8wo2tJPHEZgh5pyF9+zELxS8yp8=; b=dlHeKdSSUvSZgcsiqW7UoxKujU7b9DTQ8CjsEYeP+sgUjLUBh/BczaKUXTn4EBZQsq uUkcntfKq7MfpG5US1i1HKrB2UkvbjZnBi6Fx+g2mG1Unlq0rt2AUw/p2F1kQD8RvaCY Cf7Tbf58C9ADy7P79eWsN5krzWobkkNof4ow0QnwmRpWxtYkuPVgLEPR4DB/Z8y+LpTt sT7yRv/sLUvbF+Cl08x29wpqymyXGPbKhSwx2TsuusTZtvlNz4YEXshdSGPqS8RqUSOj Bu+cku/6Pz1tpxFmOZv++USOJCGl8LP1hMCUGl/iImkvzyyhgXfSEaud1TS5hW+mRDN7 EpJw== X-Gm-Message-State: AOJu0YxArp+AtnKRU30yThpWK63PA1qm0P0vFoOPBCGv9YZdpkzmtsXE kEUqy9G7Sn+qD6wX/9vXRrJ+xCHuYEC3eVQXZZk66pSpsWGr7WR1VvzH/ctNC0OyISR7p6O5BFz O X-Google-Smtp-Source: AGHT+IHcykNSsTlSbGSzSJrsVdVrFLeqaOLXk44GywjB/Q42UrmX6yXIF3reLxiP1Y9pxEwmgWQyvQ== X-Received: by 2002:a17:902:db09:b0:1fd:a1d2:c03b with SMTP id d9443c01a7336-20203f4d83cmr45634835ad.59.1723831308601; Fri, 16 Aug 2024 11:01:48 -0700 (PDT) Received: from localhost (fwdproxy-prn-003.fbsv.net. [2a03:2880:ff:3::face:b00c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f03753c9sm28232195ad.167.2024.08.16.11.01.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 11:01:48 -0700 (PDT) From: David Wei To: io-uring@vger.kernel.org Cc: Jens Axboe , Pavel Begunkov Subject: [PATCH v1 1/3] io_uring: add IORING_ENTER_NO_IOWAIT flag Date: Fri, 16 Aug 2024 11:01:43 -0700 Message-ID: <20240816180145.14561-2-dw@davidwei.uk> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240816180145.14561-1-dw@davidwei.uk> References: <20240816180145.14561-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add IORING_ENTER_NO_IOWAIT flag. If this is set then io_uring will not set current->in_iowait prior to waiting. Signed-off-by: David Wei --- include/uapi/linux/io_uring.h | 1 + io_uring/io_uring.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 48c440edf674..2552d4927511 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -508,6 +508,7 @@ struct io_cqring_offsets { #define IORING_ENTER_EXT_ARG (1U << 3) #define IORING_ENTER_REGISTERED_RING (1U << 4) #define IORING_ENTER_ABS_TIMER (1U << 5) +#define IORING_ENTER_NO_IOWAIT (1U << 6) /* * Passed in for io_uring_setup(2). Copied back with updated info on success diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 20229e72b65c..4cc905b228a5 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3155,7 +3155,7 @@ SYSCALL_DEFINE6(io_uring_enter, unsigned int, fd, u32, to_submit, if (unlikely(flags & ~(IORING_ENTER_GETEVENTS | IORING_ENTER_SQ_WAKEUP | IORING_ENTER_SQ_WAIT | IORING_ENTER_EXT_ARG | IORING_ENTER_REGISTERED_RING | - IORING_ENTER_ABS_TIMER))) + IORING_ENTER_ABS_TIMER | IORING_ENTER_NO_IOWAIT))) return -EINVAL; /* From patchwork Fri Aug 16 18:01:44 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13766747 Received: from mail-pl1-f182.google.com (mail-pl1-f182.google.com [209.85.214.182]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4FC22817 for ; Fri, 16 Aug 2024 18:01:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.182 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723831311; cv=none; b=a0tqzQbCkOe4wAKzEmFm2evyFa+/U0AygJ8iJTDGomKS4g90OcWqeFaSQ1GsbXgeF/i3D4+ZhP6I4Jsn23DehBBA7lhxoEMLdMIvf1BEoxH4lCLPtuPsUKwAhD+iP+EsODkfrD6T3os3pgT+vGnhKrm0XGHdWNFfZBgVpNGO49o= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723831311; c=relaxed/simple; bh=yFKGedKuPBa3S0+7uB7UWdAyJrfTNFU8KGIzmwuXnbM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=B9wTf4NZfLSH3As/TzDiS1yOF0yBo3JMwzUkeTGb/Kg9ar+8+V67OksTuIFPtQE0XCzxngwOhxIWzNRsmuad9O25Rjz3Pb5RYSb3b9rDkhIBtbZmHayKusnuLNuQZ+IR0uS6lCTlYc9qceBMFiVyMWcoeIDARLsE6T/ASydmdVw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=GBRyhW7Y; arc=none smtp.client-ip=209.85.214.182 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="GBRyhW7Y" Received: by mail-pl1-f182.google.com with SMTP id d9443c01a7336-1fc587361b6so22755865ad.2 for ; Fri, 16 Aug 2024 11:01:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1723831310; x=1724436110; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=+ODSNCq3XO6ZTig/ZFVCsOJdFuiYzJaGhHl4OgxeGI0=; b=GBRyhW7Y+S/chTxcdDZHw0MqVU53e6NjfqKDyvldxdGhxBn7WHoEGMyxEQR48DPmTj IJEgKrT3cIiH7XN2uKd1xmhSfi69bnR32hHtgrsiDGPnMRrzuYWZOQGsFrcMnfKxnlGV qdPKLLRk6keKJZFIuXmX5qEHxUSJknbU8Uw4Ij8rMDnYiNVO1z6Jl+/r2ytFtj1ynKVR ByCiYl+952xvvSnuBKIhYjo5BQRJJjKg7xgxhJrUeoeXR7yTLm32NOAgoY8cwA3fyYth q894cz5KytmxkVg3YKqud94+nSRff1a++viOKzeqaG1L4XtiBqbeVeJtQqvXUEFZmak+ xxpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723831310; x=1724436110; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=+ODSNCq3XO6ZTig/ZFVCsOJdFuiYzJaGhHl4OgxeGI0=; b=IipEcH7+ZB71HZNqfvzM78DojQN09gGgrKINnrtHG+E1+HUwX10QZ+iOfFDX+WYUeZ 6yuVhOfOuBD0aQJQv6bKUcII5BqDN2irO7MgJ1EsRKuGzqvBLSPSGy8MIJmn6ch08JRS s9x20ofEUkbPnSokFkseCloeSkrbF8yE2alo2iow0en1ZufQtRsUCOPZVYLdiviJqo0x tL1fbqowvVMv4mz2NzD85DUS3ISCLPCU7fS77XyCrPTfcAElDBWsRJP8SpKZTOLDkMXR uTM8w0vNMmGrO4Yw3xb/02kILcjy8S6wNY3IB4B7HwSYZj0I6bgTfqRPfac6gDMuYVFv 2BUg== X-Gm-Message-State: AOJu0Yx6hp9f7yduW/g+xwPjUuWOwLEjvekYSyIhfruJbJqwRK7pVORh YwcKv997/P3Z29RTQdMRSpCC1Flncrnn6+Msf2QUcV6W0YxQtVWAToIkyfTBedRunfQ7H0po8Yg W X-Google-Smtp-Source: AGHT+IEP0HQo6RYpMQ6Wm2uO3cHAroAu069Rt2Uf+SthnJsbp9NvmCbiY1NTzPikoIop2N/4nMKrrg== X-Received: by 2002:a17:902:e74d:b0:1fd:78dd:8578 with SMTP id d9443c01a7336-20203f4fdb5mr48748585ad.55.1723831309511; Fri, 16 Aug 2024 11:01:49 -0700 (PDT) Received: from localhost (fwdproxy-prn-020.fbsv.net. [2a03:2880:ff:14::face:b00c]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-201f037589bsm28245345ad.166.2024.08.16.11.01.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 11:01:49 -0700 (PDT) From: David Wei To: io-uring@vger.kernel.org Cc: Jens Axboe , Pavel Begunkov Subject: [PATCH v1 2/3] io_uring: do not set no_iowait if IORING_ENTER_NO_WAIT Date: Fri, 16 Aug 2024 11:01:44 -0700 Message-ID: <20240816180145.14561-3-dw@davidwei.uk> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240816180145.14561-1-dw@davidwei.uk> References: <20240816180145.14561-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Check for IORING_ENTER_NO_WAIT and do not set current->in_iowait if it is set. To maintain existing behaviour, by default this flag is not set. This is to prevent waiting for completions being accounted as iowait time. Some userspace tools consider iowait time to be 'utilisation' time which is misleading since the task is not scheduled and the CPU is free to run other tasks. High iowait time might be indicative of issues for block IO, but not for network IO i.e. recv() where we do not control when IO happens. Signed-off-by: David Wei --- io_uring/io_uring.c | 4 +++- io_uring/io_uring.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 4cc905b228a5..9438875e43ea 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -2372,7 +2372,7 @@ static inline int io_cqring_wait_schedule(struct io_ring_ctx *ctx, * can take into account that the task is waiting for IO - turns out * to be important for low QD IO. */ - if (current_pending_io()) + if (!iowq->no_iowait && current_pending_io()) current->in_iowait = 1; ret = 0; if (iowq->timeout == KTIME_MAX) @@ -2414,6 +2414,8 @@ static int io_cqring_wait(struct io_ring_ctx *ctx, int min_events, u32 flags, iowq.nr_timeouts = atomic_read(&ctx->cq_timeouts); iowq.cq_tail = READ_ONCE(ctx->rings->cq.head) + min_events; iowq.timeout = KTIME_MAX; + if (flags & IORING_ENTER_NO_IOWAIT) + iowq.no_iowait = true; if (uts) { struct timespec64 ts; diff --git a/io_uring/io_uring.h b/io_uring/io_uring.h index 9935819f12b7..e35fecca4445 100644 --- a/io_uring/io_uring.h +++ b/io_uring/io_uring.h @@ -41,6 +41,7 @@ struct io_wait_queue { unsigned cq_tail; unsigned nr_timeouts; ktime_t timeout; + bool no_iowait; #ifdef CONFIG_NET_RX_BUSY_POLL ktime_t napi_busy_poll_dt; From patchwork Fri Aug 16 18:01:45 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Wei X-Patchwork-Id: 13766748 Received: from mail-pf1-f180.google.com (mail-pf1-f180.google.com [209.85.210.180]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2B6FA1C2309 for ; Fri, 16 Aug 2024 18:01:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.180 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723831312; cv=none; b=nS+4XKqOqke1pTKSoOhgorCyR5ntQ1buXIVe0JKBakvtNK6b0d4OtT/4VdPYLIsyYjbysOJilbwvUwVjPp+uZxhxhq3uBySSdGbnuQy98El0JGMTnxpiGEEnceDWEYNFvNTlOV4NUoQz0Qy9xLyZGte6y9qxEEtoG6Ie0W/U/JU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1723831312; c=relaxed/simple; bh=EYKC43c5kzp1VyPdjoRUOK76uMP/FapHfpSEmr/KslA=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=oH+CKhHoyTtZr0W/eFBZL1FSiadKRPF3j1I966rKC2GfGicyIQkAprJPtgVj9DkFmjBdTrYqGHj3marsgNQGVt3ZX22awoI+RnSZDpRDr9B8lqCoxOwZOzJEJBPL1d7aUs0Wq64qvBhQ6AS0xr/BRC4Dwy6aP4OVs1dqaFQrXa8= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk; spf=none smtp.mailfrom=davidwei.uk; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b=m8oXL+bl; arc=none smtp.client-ip=209.85.210.180 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=davidwei.uk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=davidwei-uk.20230601.gappssmtp.com header.i=@davidwei-uk.20230601.gappssmtp.com header.b="m8oXL+bl" Received: by mail-pf1-f180.google.com with SMTP id d2e1a72fcca58-7105043330aso2050996b3a.0 for ; Fri, 16 Aug 2024 11:01:51 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=davidwei-uk.20230601.gappssmtp.com; s=20230601; t=1723831310; x=1724436110; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=FIwcB7az5fnFRKyT3m48GY3wRI7BR9/OZ/wY5w1Yjm8=; b=m8oXL+bl9BGvjOzYDHPnv8ZJ0u5L7z6pmE8l/xyR14bqcNabQ+bXks1p30lMGakhfZ BQHUZzZv1EqxSJZbTHlCXeCqA3e71qE0/u6QqFjlNt+53ov7HtDdBK5SLng/Bw4IHswT Ctk36knr78K7fZXyV02fhubkpdLHBgO3KvvPU7msBXQ1IrCV8dBYi1NSQCPeWp9jpi2c GqbrRM8NX4qOl6UhUFwqSHF1lm/46RdXnAemFxniSl/7D3GZPFcrsVD81KPqGUthgCPG cU8dVjvOe31iZXjM8P78+PNStTm8ugMT7NFLBd4F4I2n9pkmf6XuvAEhLOeL8i8Bdqqx p2rg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1723831310; x=1724436110; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=FIwcB7az5fnFRKyT3m48GY3wRI7BR9/OZ/wY5w1Yjm8=; b=Na4U58+AgcMrGDdHqnnpQJDIApmlSFh2jY1O1/G/oDmIswVHk+LQzcPXviO/uYy8KU hu7KlYstaRFqBIkHDPnoUHDP+4r1HhtpKIY/T9Sgx327iDMOWBnVM3X98FoOulhx3pyA 211qHmdWK4gjIvrj8jboDnTnaTcDArX1jDo3RnACsNgK29/9eIWRvSrjAubALC/86+qz bggJQV1KxE/VcIUsf/6zC2GOzRCV+gsFew0esktxefiTiwN90r8fl27fHh1ZxX0xC+zH Nq7shGAWQzDNhjB/XWZv2Upj9pglSUUDW1GQaMJ2HQYxNrX0tiTtuANJUeQL+3R7MR47 Cb2A== X-Gm-Message-State: AOJu0YxLZsp7mTk/vwchlZIGrxJY6mCCwS7bUlAv4hGYF7lha2LSCv8z ucNUgG3n+aqhN7rEoj5VQr1efXKTGZlFu9uvCCq5IOWPG4Q4m+OtI55DPY5445ker68NsrCQsqv d X-Google-Smtp-Source: AGHT+IFbTi4XLrwVukMTdSWWkQ2Bo0Dh/NoNrp0RusPDPVVhtXi9x+pA+Tqq/Q61tCCDVCoIFO0uOw== X-Received: by 2002:a05:6a21:3a96:b0:1c8:b10d:eaf4 with SMTP id adf61e73a8af0-1c90502ae4dmr4575402637.41.1723831310548; Fri, 16 Aug 2024 11:01:50 -0700 (PDT) Received: from localhost (fwdproxy-prn-042.fbsv.net. [2a03:2880:ff:2a::face:b00c]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-7127af3d11esm2869607b3a.217.2024.08.16.11.01.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2024 11:01:50 -0700 (PDT) From: David Wei To: io-uring@vger.kernel.org Cc: Jens Axboe , Pavel Begunkov Subject: [PATCH v1 3/3] io_uring: add IORING_FEAT_IOWAIT_TOGGLE feature flag Date: Fri, 16 Aug 2024 11:01:45 -0700 Message-ID: <20240816180145.14561-4-dw@davidwei.uk> X-Mailer: git-send-email 2.43.5 In-Reply-To: <20240816180145.14561-1-dw@davidwei.uk> References: <20240816180145.14561-1-dw@davidwei.uk> Precedence: bulk X-Mailing-List: io-uring@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Add IORING_FEAT_IOWAIT_TOGGLE and return it in io_uring_create(). This will be used by liburing to check for this feature. Signed-off-by: David Wei --- include/uapi/linux/io_uring.h | 1 + io_uring/io_uring.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/include/uapi/linux/io_uring.h b/include/uapi/linux/io_uring.h index 2552d4927511..3a94afa8665e 100644 --- a/include/uapi/linux/io_uring.h +++ b/include/uapi/linux/io_uring.h @@ -544,6 +544,7 @@ struct io_uring_params { #define IORING_FEAT_LINKED_FILE (1U << 12) #define IORING_FEAT_REG_REG_RING (1U << 13) #define IORING_FEAT_RECVSEND_BUNDLE (1U << 14) +#define IORING_FEAT_IOWAIT_TOGGLE (1U << 15) /* * io_uring_register(2) opcodes and arguments diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 9438875e43ea..006bccd55984 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -3541,7 +3541,7 @@ static __cold int io_uring_create(unsigned entries, struct io_uring_params *p, IORING_FEAT_EXT_ARG | IORING_FEAT_NATIVE_WORKERS | IORING_FEAT_RSRC_TAGS | IORING_FEAT_CQE_SKIP | IORING_FEAT_LINKED_FILE | IORING_FEAT_REG_REG_RING | - IORING_FEAT_RECVSEND_BUNDLE; + IORING_FEAT_RECVSEND_BUNDLE | IORING_FEAT_IOWAIT_TOGGLE; if (copy_to_user(params, p, sizeof(*p))) { ret = -EFAULT;