From: Tejun Heo <htejun@gmail.com>
To: Boaz Harrosh <bharrosh@panasas.com>
Cc: Christoph Hellwig <hch@infradead.org>,
axboe@kernel.dk, linux-kernel@vger.kernel.org,
bzolnier@gmail.com
Subject: Re: [PATCH UPDATED 09/14] block: clean up request completion API
Date: Thu, 23 Apr 2009 18:59:46 +0900 [thread overview]
Message-ID: <49F03C12.1040507@gmail.com> (raw)
In-Reply-To: <49F0382A.6050306@panasas.com>
Hello, Boaz.
Boaz Harrosh wrote:
> Rrrr.
>
> This patch could be nice, but not after I've seen the previous one.
> The first one was much^3 nicer.
Heh... can't make everyone happy. :-)
> Maybe all you need to do is push the lock flag into blk_finish_request()
>
> <original patch>
> + if (!locked) {
>> + spin_lock_irqsave(q->queue_lock, flags);
>> + finish_request(rq, error);
>> + spin_unlock_irqrestore(q->queue_lock, flags);
>> + } else
>> + finish_request(rq, error);
>>
> </original patch>
>
> Then you have only one call site to finish_request() inside blk_end_io().
>
> finish_request() will become the ugly site, but if looking at the
> alternative I think it is worth it. Code is smaller, cleaner, and
> clearer. (Sometimes principles must be sacrificed)
>
> At the end, I hate that lock around finish_request(), I wish the
> req->end_io() was not called with the lock held and the plain
> blk_put_request() (locking version) could be called. Having
> req->end_io() under lock is a pain in the ass that makes you go
> through loops when you need proper error handling. One day I will
> get rid of it.
>
> Tejun? now that you done both, which one do you like better? or is
> it just me?
Frankly, I don't care one way or the other as long as there's no
duplication in code paths. Pros and cons of both approaches are
minimal and/or cosmetic. One might remove a branch at the cost of
minutely larger code. It just doesn't matter all that much.
I think it's best to let the maintainer have his/her way on things
like this. I mean, maintainership is a hard work. There gotta be
some perks. :-)
Joke aside, I think it's a good idea to follow maintainer's decisions
on things like this as it helps making the subsystem code more
consistent which is usually way more important than minute technical
or cosmetic advantages.
Thanks.
--
tejun
next prev parent reply other threads:[~2009-04-23 9:59 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-04-21 16:37 [GIT PATCH linux-2.6-block] block: cleanup patches, take#3 Tejun Heo
2009-04-21 16:37 ` [PATCH 01/14] block: merge blk_invoke_request_fn() into __blk_run_queue() Tejun Heo
2009-04-21 16:37 ` [PATCH 02/14] block: kill blk_start_queueing() Tejun Heo
2009-04-21 16:37 ` [PATCH 03/14] block: don't set REQ_NOMERGE unnecessarily Tejun Heo
2009-04-21 16:37 ` [PATCH 04/14] block: cleanup REQ_SOFTBARRIER usages Tejun Heo
2009-04-21 16:37 ` [PATCH 05/14] block: clean up misc stuff after block layer timeout conversion Tejun Heo
2009-04-21 16:37 ` [PATCH 06/14] block: reorder request completion functions Tejun Heo
2009-04-21 16:37 ` [PATCH 07/14] block: reorganize request fetching functions Tejun Heo
2009-04-21 17:07 ` Christoph Hellwig
2009-04-22 10:09 ` Jens Axboe
2009-04-23 1:23 ` Tejun Heo
2009-04-21 16:37 ` [PATCH 08/14] block: kill blk_end_request_callback() Tejun Heo
2009-04-21 16:37 ` [PATCH 09/14] block: clean up request completion API Tejun Heo
2009-04-21 17:59 ` Christoph Hellwig
2009-04-23 1:24 ` Tejun Heo
2009-04-23 2:08 ` [PATCH UPDATED " Tejun Heo
2009-04-23 9:43 ` Boaz Harrosh
2009-04-23 9:59 ` Tejun Heo [this message]
2009-04-21 16:37 ` [PATCH 10/14] block: move rq->start_time initialization to blk_rq_init() Tejun Heo
2009-04-21 16:37 ` [PATCH 11/14] block: implement and use [__]blk_end_request_all() Tejun Heo
2009-04-21 16:37 ` [PATCH 12/14] block: replace end_request() with [__]blk_end_request_cur() Tejun Heo
2009-04-21 18:25 ` Joerg Dorchain
2009-04-21 20:35 ` Laurent Vivier
2009-04-22 9:25 ` Geert Uytterhoeven
2009-04-22 16:04 ` Grant Likely
2009-04-21 16:38 ` [PATCH 13/14] block: don't abuse rq->data Tejun Heo
2009-04-21 16:38 ` [PATCH 14/14] block-kill-data Tejun Heo
2009-04-21 16:42 ` [PATCH 14/14] block: kill rq->data Tejun Heo
2009-04-22 10:10 ` [GIT PATCH linux-2.6-block] block: cleanup patches, take#3 Jens Axboe
2009-04-23 2:10 ` Tejun Heo
2009-04-23 6:09 ` Jens Axboe
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=49F03C12.1040507@gmail.com \
--to=htejun@gmail.com \
--cc=axboe@kernel.dk \
--cc=bharrosh@panasas.com \
--cc=bzolnier@gmail.com \
--cc=hch@infradead.org \
--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