From: Greg KH <firstname.lastname@example.org> To: Luis Chamberlain <email@example.com> Cc: firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, email@example.com, firstname.lastname@example.org, Omar Sandoval <email@example.com>, Hannes Reinecke <firstname.lastname@example.org>, Michal Hocko <email@example.com>, Christoph Hellwig <firstname.lastname@example.org> Subject: Re: [PATCH v4 1/5] block: revert back to synchronous request_queue removal Date: Sun, 10 May 2020 08:20:58 +0200 [thread overview] Message-ID: <20200510062058.GA3394360@kroah.com> (raw) In-Reply-To: <email@example.com> On Sat, May 09, 2020 at 03:10:54AM +0000, Luis Chamberlain wrote: > Commit dc9edc44de6c ("block: Fix a blk_exit_rl() regression") merged on > v4.12 moved the work behind blk_release_queue() into a workqueue after a > splat floated around which indicated some work on blk_release_queue() > could sleep in blk_exit_rl(). This splat would be possible when a driver > called blk_put_queue() or blk_cleanup_queue() (which calls blk_put_queue() > as its final call) from an atomic context. > > blk_put_queue() decrements the refcount for the request_queue kobject, > and upon reaching 0 blk_release_queue() is called. Although blk_exit_rl() > is now removed through commit db6d9952356 ("block: remove request_list code") > on v5.0, we reserve the right to be able to sleep within blk_release_queue() > context. > > The last reference for the request_queue must not be called from atomic > context. *When* the last reference to the request_queue reaches 0 varies, > and so let's take the opportunity to document when that is expected to > happen and also document the context of the related calls as best as possible > so we can avoid future issues, and with the hopes that the synchronous > request_queue removal sticks. > > We revert back to synchronous request_queue removal because asynchronous > removal creates a regression with expected userspace interaction with > several drivers. An example is when removing the loopback driver, one > uses ioctls from userspace to do so, but upon return and if successful, > one expects the device to be removed. Likewise if one races to add another > device the new one may not be added as it is still being removed. This was > expected behavior before and it now fails as the device is still present > and busy still. Moving to asynchronous request_queue removal could have > broken many scripts which relied on the removal to have been completed if > there was no error. Document this expectation as well so that this > doesn't regress userspace again. > > Using asynchronous request_queue removal however has helped us find > other bugs. In the future we can test what could break with this > arrangement by enabling CONFIG_DEBUG_KOBJECT_RELEASE. You are adding documenation and might_sleep() calls all over the place in here, making the "real" change in the patch hard to pick out. How about you split this up into 3 patches, one for documentation, one for might_sleep() and one for the real change? Or maybe just 2 patches, but what you have here seems excessive. thanks, greg k-h
next prev parent reply other threads:[~2020-05-10 6:21 UTC|newest] Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-05-09 3:10 [PATCH v4 0/5] block: fix blktrace debugfs use after free Luis Chamberlain 2020-05-09 3:10 ` [PATCH v4 1/5] block: revert back to synchronous request_queue removal Luis Chamberlain 2020-05-10 0:36 ` Bart Van Assche 2020-05-10 6:20 ` Greg KH [this message] 2020-05-11 13:41 ` Luis Chamberlain 2020-05-09 3:10 ` [PATCH v4 2/5] block: move main block debugfs initialization to its own file Luis Chamberlain 2020-05-09 3:10 ` [PATCH v4 3/5] blktrace: fix debugfs use after free Luis Chamberlain 2020-05-10 0:58 ` Bart Van Assche 2020-05-11 13:44 ` Luis Chamberlain 2020-05-10 6:26 ` Greg KH 2020-05-11 14:03 ` Luis Chamberlain 2020-05-09 3:10 ` [PATCH v4 4/5] blktrace: break out of blktrace setup on concurrent calls Luis Chamberlain 2020-05-10 1:09 ` Bart Van Assche 2020-05-11 13:39 ` Luis Chamberlain 2020-05-16 1:39 ` Luis Chamberlain 2020-05-16 1:39 ` Luis Chamberlain 2020-05-09 3:10 ` [PATCH v4 5/5] loop: be paranoid on exit and prevent new additions / removals Luis Chamberlain
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=20200510062058.GA3394360@kroah.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --email@example.com \ --firstname.lastname@example.org \ --subject='Re: [PATCH v4 1/5] block: revert back to synchronous request_queue removal' \ /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
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.