public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: lizetao <[email protected]>,
	"[email protected]" <[email protected]>
Cc: Anuj Gupta <[email protected]>, Kanchan Joshi <[email protected]>
Subject: Re: [PATCH 2/4] io_uring: add registered request arguments
Date: Mon, 6 Jan 2025 16:40:58 +0000	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On 1/6/25 11:33, lizetao wrote:
> Hi,
> 
>> -----Original Message-----
>> From: Pavel Begunkov <[email protected]>
>> Sent: Monday, December 30, 2024 9:30 PM
>> To: [email protected]
>> Cc: [email protected]; Anuj Gupta <[email protected]>; Kanchan
>> Joshi <[email protected]>
>> Subject: [PATCH 2/4] io_uring: add registered request arguments
>>
>> Similarly to registered wait arguments we want to have a pre-mapped space
>> for various request arguments. Use the same parameter region, however as -
>>> wait_args has different lifetime rules, add a new instance of struct
>> io_reg_args.
>>
>> Signed-off-by: Pavel Begunkov <[email protected]>
>> ---
>>   include/linux/io_uring_types.h | 2 ++
>>   io_uring/register.c            | 3 +++
>>   2 files changed, 5 insertions(+)
>>
>> diff --git a/include/linux/io_uring_types.h b/include/linux/io_uring_types.h
>> index 49008f00d064..cd6642855533 100644
>> --- a/include/linux/io_uring_types.h
>> +++ b/include/linux/io_uring_types.h
>> @@ -299,6 +299,8 @@ struct io_ring_ctx {
>>
>>   		struct io_submit_state	submit_state;
>>
>> +		struct io_reg_args	sqe_args;
>> +
>>   		/*
>>   		 * Modifications are protected by ->uring_lock and -
>>> mmap_lock.
>>   		 * The flags, buf_pages and buf_nr_pages fields should be
>> stable diff --git a/io_uring/register.c b/io_uring/register.c index
>> b926eb053408..d2232b90a81d 100644
>> --- a/io_uring/register.c
>> +++ b/io_uring/register.c
>> @@ -607,6 +607,9 @@ static int io_register_mem_region(struct io_ring_ctx
>> *ctx, void __user *uarg)
>>   		ctx->wait_args.ptr = io_region_get_ptr(&ctx->param_region);
>>   		ctx->wait_args.size = rd.size;
>>   	}
>> +
>> +	ctx->sqe_args.ptr = io_region_get_ptr(&ctx->param_region);
>> +	ctx->sqe_args.size = rd.size;
> 
> Why not add an enum value against sqe_args? Will mixing it with

Not sure what you mean

> IORING_MEM_REGION_REG_WAIT_ARG cause management confusion?

This specific region was added to be shared for multiple use
cases, the rest is up to the userspace. liburing will need to
have a clear API

-- 
Pavel Begunkov


  reply	other threads:[~2025-01-06 16:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-30 13:30 [RFC 0/4] pre-mapped rw attributes Pavel Begunkov
2024-12-30 13:30 ` [PATCH 1/4] io_uring: add structure for registered arguments Pavel Begunkov
2024-12-30 13:30 ` [PATCH 2/4] io_uring: add registered request arguments Pavel Begunkov
2025-01-06 11:33   ` lizetao
2025-01-06 16:40     ` Pavel Begunkov [this message]
2024-12-30 13:30 ` [PATCH 3/4] io_uring/rw: use READ_ONCE with rw attributes Pavel Begunkov
2024-12-30 13:30 ` [PATCH 4/4] io_uring/rw: pre-mapped " Pavel Begunkov
2025-01-06 11:13   ` lizetao
2025-01-06 16:53     ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox