public inbox for [email protected]
 help / color / mirror / Atom feed
From: Olivier Langlois <[email protected]>
To: Pavel Begunkov <[email protected]>,
	io-uring <[email protected]>
Subject: Re: IORING_OP_POLL_ADD/IORING_OP_POLL_REMOVE questions
Date: Thu, 06 May 2021 04:42:10 -0400	[thread overview]
Message-ID: <[email protected]> (raw)
In-Reply-To: <[email protected]>

On Wed, 2021-05-05 at 23:17 -0400, Olivier Langlois wrote:
> Note that the poll remove sqe and the following poll add sqe don't have
> exactly the same user_data.
> 
> I have this statement in between:
> /* increment generation counter to avoid handling old events */
>           ++anfds [fd].egen;
> 
> poll remove cancel the previous poll add having gen 1 in its user data.
> the next poll add has it user_data storing gen var set to 2:
> 
> 1 3 remove 85 1
> 1 3 add 85 2
> 
> 85 gen 1 res -125
> 85 gen 1 res 4
> 
Good news!

I have used the io_uring tracepoints and they confirm that io_uring
works as expected:

For the above printfs, I get the following perf traces:

 11940.259 Execution SVC/134675 io_uring:io_uring_submit_sqe(ctx:
0xffff9d3c4368c000, opcode: 7, force_nonblock: 1)
 11940.270 Execution SVC/134675 io_uring:io_uring_complete(ctx:
0xffff9d3c4368c000, user_data: 4294967382, res: -125)
 11940.272 Execution SVC/134675 io_uring:io_uring_complete(ctx:
0xffff9d3c4368c000)
 11940.275 Execution SVC/134675 io_uring:io_uring_file_get(ctx:
0xffff9d3c4368c000, fd: 86)
 11940.277 Execution SVC/134675 io_uring:io_uring_submit_sqe(ctx:
0xffff9d3c4368c000, opcode: 6, user_data: 4294967382, force_nonblock:
1)
 11940.279 Execution SVC/134675 io_uring:io_uring_complete(ctx:
0xffff9d3c4368c000, user_data: 4294967382, res: 4)

So, it seems the compiler is playing games on me. It prints the correct
gen 2 value but is passing 1 to io_uring_sqe_set_data()...

I'll try to turn optimization off to see if it helps.

thx a lot again for your exceptional work!



  reply	other threads:[~2021-05-06  8:42 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-04 18:06 IORING_OP_POLL_ADD/IORING_OP_POLL_REMOVE questions Olivier Langlois
2021-05-05 17:20 ` Olivier Langlois
2021-05-05 17:56 ` Pavel Begunkov
2021-05-06  3:17   ` Olivier Langlois
2021-05-06  8:42     ` Olivier Langlois [this message]
2021-05-06 15:46       ` Olivier Langlois
2021-05-06 16:59         ` Pavel Begunkov
2021-05-06 19:32         ` Olivier Langlois
2021-05-06 17:09     ` 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 \
    --in-reply-to=7fa90154d1fbe1969383261539b7fbee20caad43.camel@trillion01.com \
    [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