io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiaoguang Wang <xiaoguang.wang@linux.alibaba.com>
To: io-uring <io-uring@vger.kernel.org>
Cc: "axboe@kernel.dk" <axboe@kernel.dk>,
	Pavel Begunkov <asml.silence@gmail.com>,
	Stefano Garzarella <sgarzare@redhat.com>
Subject: Question about patch "io_uring: add submission polling"
Date: Fri, 16 Oct 2020 16:55:45 +0800	[thread overview]
Message-ID: <635218e1-da08-4ab5-7a95-fb74de46c741@linux.alibaba.com> (raw)

hi,

I have questions about below code comments, which was included in patch
"io_uring: add submission polling",
------------------------------------------------------------
     /*
      * Drop cur_mm before scheduling, we can't hold it for
      * long periods (or over schedule()). Do this before
      * adding ourselves to the waitqueue, as the unuse/drop
      * may sleep.
      */
     if (cur_mm) {
             unuse_mm(cur_mm);
             mmput(cur_mm);
             cur_mm = NULL;
     }

     prepare_to_wait(&ctx->sqo_wait, &wait, TASK_INTERRUPTIBLE);
-------------------------------------------------------------
Stefano submited a patch "io_uring: prevent sq_thread from spinning when it should stop",
I understand what issue Stefano fixed, but don't understand below comments.

Can anyone help to explain why we need to rop cur_mm before scheduling, or
why we can't hold it for long periods (or over schedule()), and if we
unuse/drop mm after adding ourselves to the waitqueue, what issue will
happen when unuse/drop sleeps, thanks.

Regards,
Xiaoguang Wang

             reply	other threads:[~2020-10-16  8:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-16  8:55 Xiaoguang Wang [this message]
2020-10-16 13:27 ` Question about patch "io_uring: add submission polling" Jens Axboe
2020-10-19  2:52   ` Xiaoguang Wang

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=635218e1-da08-4ab5-7a95-fb74de46c741@linux.alibaba.com \
    --to=xiaoguang.wang@linux.alibaba.com \
    --cc=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=sgarzare@redhat.com \
    /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).