public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [RFC] migrating mm
Date: Tue, 12 Nov 2019 14:14:22 +0300	[thread overview]
Message-ID: <[email protected]> (raw)

There is a case I'm not sure about, but which bothers me.
What would happen, if we try to use io_uring with offloading (i.e.
IORING_SETUP_SQPOLL), after its creator is gone? The thing is that
io_sq_thread() is getting mm by using ctx->sqo_mm, which is current->mm
of the creator process, which potentially may be released.


The case in mind:
let: @parent has a @child process

@child:
    uring_fd = io_uring_create(IORING_SETUP_SQPOLL)
    pass_fd_via_pipe(uring_fd, to=@parent);
    exit()

@parent:
    uring_fd = get_fd_from_pipe()
    wait(@child)

    sqe = create_sqe_which_needs_mm();
    io_submit_sqe(uring_fd, sqe)
    // io_uring tries to grab mm of @child, which is gone.



What do you think?

-- 
Pavel Begunkov

             reply	other threads:[~2019-11-12 11:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-12 11:14 Pavel Begunkov [this message]
2019-11-12 12:23 ` [RFC] migrating mm 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] \
    /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