io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shuveb Hussain <shuveb@gmail.com>
To: io-uring@vger.kernel.org
Subject: Question regarding process context
Date: Wed, 12 Aug 2020 21:15:02 +0530	[thread overview]
Message-ID: <CAF=AFaKBvUNjWx0-N9bR3z14dPBUzkcCR-4S5de-_=ovda7Fjw@mail.gmail.com> (raw)

Hello,

I added a new operation for signalfd() and got it working. However,
the kernel's signalfd implementation uses "current" to get process
context details and adds the current process to a wait queue. When
trying to wake up, however, it gets called from the io_wqe_worker
context and the wake up would not normally happen since current now
resolves to io_wqe_worker. I've taken care of this by saving "current"
in the struct file's private_data when submitting and using that
instead during completion from the signalfd code. It works.
Essentially, current resolves to different tasks in the submission and
completion paths and this had to be taken care of for signalfd.

However, under io_uring, there are many cases where current will not
resolve to the user space process. For example, when being called from
io_sq_thread.

Since io_uring deals with calling code that originally implements
paths that are called from various system calls, they might internally
use current. What is the general strategy to handle the fact that
current can point to different tasks when submitting and completing?

Thanks!
-- 
Shuveb Hussain

                 reply	other threads:[~2020-08-12 15:45 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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='CAF=AFaKBvUNjWx0-N9bR3z14dPBUzkcCR-4S5de-_=ovda7Fjw@mail.gmail.com' \
    --to=shuveb@gmail.com \
    --cc=io-uring@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).