public inbox for [email protected]
 help / color / mirror / Atom feed
* [PATCH liburing v3 0/2] add support for new timeout feature
@ 2020-08-05  3:04 Jiufei Xue
  0 siblings, 0 replies; 4+ messages in thread
From: Jiufei Xue @ 2020-08-05  3:04 UTC (permalink / raw)
  To: axboe; +Cc: io-uring, metze

Kernel can handle timeout when feature IORING_FEAT_GETEVENTS_TIMEOUT
supported. Applications should use io_uring_set_cqwait_timeout()
explicitly to asked for the new feature.

Changes since v2:
- bump the version to 2.0.7 since we have changed the size of io_uring
- add more pad to structure io_uring for future flexibility

Jiufei Xue (2):
io_uring_enter: add timeout support
test/timeout: add testcase for new timeout feature

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH liburing v3 0/2] add support for new timeout feature
@ 2020-08-05  3:28 Carter Li 李通洲
  2020-08-05  5:17 ` Jiufei Xue
  0 siblings, 1 reply; 4+ messages in thread
From: Carter Li 李通洲 @ 2020-08-05  3:28 UTC (permalink / raw)
  To: Jiufei Xue; +Cc: io-uring

> diff --git a/src/include/liburing.h b/src/include/liburing.h
> index 0505a4f..82c2980 100644
> --- a/src/include/liburing.h
> +++ b/src/include/liburing.h
> @@ -56,6 +56,9 @@ struct io_uring {
>  	struct io_uring_sq sq;
>  	struct io_uring_cq cq;
>  	unsigned flags;
> +	unsigned flags_internal;
> +	unsigned features;
> +	unsigned pad[4];
>  	int ring_fd;
>  };

Won't it break existing code runs on newer kernel?
Won't it break code compiled with new liburing but runs on older kernel?

IMO In this case, a new syscall `io_uring_setup2` is required at least.

Regards,
Carter


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH liburing v3 0/2] add support for new timeout feature
  2020-08-05  3:28 [PATCH liburing v3 0/2] add support for new timeout feature Carter Li 李通洲
@ 2020-08-05  5:17 ` Jiufei Xue
  2020-08-05  6:18   ` Carter Li 李通洲
  0 siblings, 1 reply; 4+ messages in thread
From: Jiufei Xue @ 2020-08-05  5:17 UTC (permalink / raw)
  To: Carter Li 李通洲; +Cc: io-uring



On 2020/8/5 上午11:28, Carter Li 李通洲 wrote:
>> diff --git a/src/include/liburing.h b/src/include/liburing.h
>> index 0505a4f..82c2980 100644
>> --- a/src/include/liburing.h
>> +++ b/src/include/liburing.h
>> @@ -56,6 +56,9 @@ struct io_uring {
>>  	struct io_uring_sq sq;
>>  	struct io_uring_cq cq;
>>  	unsigned flags;
>> +	unsigned flags_internal;
>> +	unsigned features;
>> +	unsigned pad[4];
>>  	int ring_fd;
>>  };
> 
> Won't it break existing code runs on newer kernel?

io_uring is a structure that used in userspace. It breaks the API
with existing compiled application. So I have changed the soname
to 2.0.7.

And for syscall io_uring_enter(), I have added a new feature bit
IORING_FEAT_GETEVENTS_TIMEOUT and io_uring_enter() flag
IORING_ENTER_GETEVENTS_TIMEOUT. Here are 3 cases below:

1) old liburing <-> new kernel: old liburing can not pass the flag
   IORING_ENTER_GETEVENTS_TIMEOUT, so new kernel will parse the arguments
   the original way.

2) new liburing <-> old kernel: feature IORING_FEAT_GETEVENTS_TIMEOUT
   not supported, liburing will do things like before.

3) new liburing <-> new kernel: feature IORING_FEAT_GETEVENTS_TIMEOUT
   supported, liburing pass the new arguments with the flag
   IORING_ENTER_GETEVENTS_TIMEOUT which helps kernel parse the arguments
   correctly.

Thanks,
Jiufei.

> Won't it break code compiled with new liburing but runs on older kernel?
> 

> IMO In this case, a new syscall `io_uring_setup2` is required at least.
> 
> Regards,
> Carter
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH liburing v3 0/2] add support for new timeout feature
  2020-08-05  5:17 ` Jiufei Xue
@ 2020-08-05  6:18   ` Carter Li 李通洲
  0 siblings, 0 replies; 4+ messages in thread
From: Carter Li 李通洲 @ 2020-08-05  6:18 UTC (permalink / raw)
  To: Jiufei Xue; +Cc: io-uring

Sorry. I was thinking the pointer of io_uring will be passed with
io_uring_setup. My fault.

> 2020年8月5日 下午1:17,Jiufei Xue <[email protected]> 写道:
> 
> 
> 
> On 2020/8/5 上午11:28, Carter Li 李通洲 wrote:
>>> diff --git a/src/include/liburing.h b/src/include/liburing.h
>>> index 0505a4f..82c2980 100644
>>> --- a/src/include/liburing.h
>>> +++ b/src/include/liburing.h
>>> @@ -56,6 +56,9 @@ struct io_uring {
>>> 	struct io_uring_sq sq;
>>> 	struct io_uring_cq cq;
>>> 	unsigned flags;
>>> +	unsigned flags_internal;
>>> +	unsigned features;
>>> +	unsigned pad[4];
>>> 	int ring_fd;
>>> };
>> 
>> Won't it break existing code runs on newer kernel?
> 
> io_uring is a structure that used in userspace. It breaks the API
> with existing compiled application. So I have changed the soname
> to 2.0.7.
> 
> And for syscall io_uring_enter(), I have added a new feature bit
> IORING_FEAT_GETEVENTS_TIMEOUT and io_uring_enter() flag
> IORING_ENTER_GETEVENTS_TIMEOUT. Here are 3 cases below:
> 
> 1) old liburing <-> new kernel: old liburing can not pass the flag
>   IORING_ENTER_GETEVENTS_TIMEOUT, so new kernel will parse the arguments
>   the original way.
> 
> 2) new liburing <-> old kernel: feature IORING_FEAT_GETEVENTS_TIMEOUT
>   not supported, liburing will do things like before.
> 
> 3) new liburing <-> new kernel: feature IORING_FEAT_GETEVENTS_TIMEOUT
>   supported, liburing pass the new arguments with the flag
>   IORING_ENTER_GETEVENTS_TIMEOUT which helps kernel parse the arguments
>   correctly.
> 
> Thanks,
> Jiufei.
> 
>> Won't it break code compiled with new liburing but runs on older kernel?
>> 
> 
>> IMO In this case, a new syscall `io_uring_setup2` is required at least.
>> 
>> Regards,
>> Carter


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-08-05  6:34 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-05  3:28 [PATCH liburing v3 0/2] add support for new timeout feature Carter Li 李通洲
2020-08-05  5:17 ` Jiufei Xue
2020-08-05  6:18   ` Carter Li 李通洲
  -- strict thread matches above, loose matches on Subject: below --
2020-08-05  3:04 Jiufei Xue

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox