public inbox for [email protected]
 help / color / mirror / Atom feed
* Question regarding process context
@ 2020-08-12 15:45 Shuveb Hussain
  0 siblings, 0 replies; only message in thread
From: Shuveb Hussain @ 2020-08-12 15:45 UTC (permalink / raw)
  To: io-uring

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2020-08-12 15:45 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-08-12 15:45 Question regarding process context Shuveb Hussain

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