From: Jens Axboe <axboe@kernel.dk>
To: Andreas Mohr <andi@lisas.de>, Junxiao Bi <junxiao.bi@oracle.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH] block: make nr_requests tunable for loop
Date: Mon, 09 Jun 2014 09:53:48 -0600 [thread overview]
Message-ID: <5395D88C.6070007@kernel.dk> (raw)
In-Reply-To: <20140609072942.GA30728@rhlx01.hs-esslingen.de>
On 2014-06-09 01:29, Andreas Mohr wrote:
> Hi,
>
> having had a look at current mainline sources,
> frankly I've (well, initially...) got trouble understanding
> what this patch is doing.
>
> It's replacing an aggressive error-type bail-out (-EINVAL) for NULL request_fn
> with an inoccuous-looking "return ret;", yet that ret content currently
> *implicitly* is a >= 0 value (resulting from processing by earlier code
> which may or may not get incomprehensibly rewritten in future).
> I don't understand the reasons for this huge change in return value handling
> (since it's now not assigning a specific return value
> for this modified bail-out case).
>
> OK, well... you could say that since all this function ever was
> interested in is the result value of queue_var_store()
> (except for error bail-out cases), doing an interim "return ret;"
> (which is exactly what the function tail is also doing)
> is exactly right.
>
> But still simple textual appearance of the resulting patch hunks
> seems strangely asymmetric
> which may easily be a canary for structurally wrong layering of this function.
> Not to mention the now required extra spin_unlock_irq()
> in interim return handler...
>
>
> Well, after further analysis I would come to the conclusion
> that in general queue_requests_store() does a LOT more than it should -
> since blk-sysfs.c's only (expected!) purpose is
> to do parameterization of request_queue behaviour as gathered
> from sysfs attribute space,
> all that function should ever be concerned with is parsing that sysfs value
> and then calling a blk helper for configuration of that very attribute value
> which would *internally* do all the strange internal queue magic
> that is currently being updated *open-coded*
> at this supposedly *sysfs*-specific place. Ugh.
> Main question here: what would one do if one decided to rip out sysfs
> and use something entirely different for parameterization?
> Yeah indeed - thought so...
>
>
> So yeah, I'd definitely say that that function is lacking some cleanup
> which would possibly then even lead (or: would have led ;)
> to a much more nicely symmetric textual appearance
> of the patch hunk of the small but quite likely useful change
> that you currently intend to have here.
If you are done ranting, look at the current tree where it has been
split out. There was no reason to have it split before, since the sysfs
entry point was the only place where we updated nr_requests. If that
code has been duplicated, there would have been a justified reason for
writing two pages about it.
--
Jens Axboe
next prev parent reply other threads:[~2014-06-09 15:53 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-06-09 7:29 [PATCH] block: make nr_requests tunable for loop Andreas Mohr
2014-06-09 15:53 ` Jens Axboe [this message]
2014-06-10 1:35 ` Junxiao Bi
2014-06-10 1:58 ` Jens Axboe
-- strict thread matches above, loose matches on Subject: below --
2014-06-09 6:07 Junxiao Bi
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=5395D88C.6070007@kernel.dk \
--to=axboe@kernel.dk \
--cc=andi@lisas.de \
--cc=junxiao.bi@oracle.com \
--cc=linux-kernel@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