[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1f9f6c41-6b67-ef33-f7d0-9c0e42a231c9@linux.dev>
Date: Mon, 31 Jul 2023 22:27:25 +0800
From: Chengming Zhou <chengming.zhou@...ux.dev>
To: Christoph Hellwig <hch@....de>
Cc: axboe@...nel.dk, ming.lei@...hat.com, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org, zhouchengming@...edance.com
Subject: Re: [PATCH v2 3/4] blk-flush: kill the flush state machine
On 2023/7/31 14:19, Christoph Hellwig wrote:
> On Tue, Jul 25, 2023 at 09:01:01PM +0800, chengming.zhou@...ux.dev wrote:
>> From: Chengming Zhou <zhouchengming@...edance.com>
>>
>> Since now we put preflush and postflush requests in separate queues,
>> we don't need the flush sequence to record anymore.
>>
>> REQ_FSEQ_PREFLUSH: blk_enqueue_preflush()
>> REQ_FSEQ_POSTFLUSH: blk_enqueue_postflush()
>> REQ_FSEQ_DONE: blk_end_flush()
>>
>> In blk_flush_complete(), we have two list to handle: preflush_running
>> and postflush_running. We just blk_end_flush() directly for postflush
>> requests, but need to move preflush requests to requeue_list to
>> dispatch.
>>
>> This patch just kill the flush state machine and directly call these
>> functions, in preparation for the next patch.
>
>> +static void blk_enqueue_postflush(struct request *rq, struct blk_flush_queue *fq)
>
> Please avoid the overly long here. Maybe just rename enqueue to queue
> here and for the preflush version as we don't really use enqueue in
> the flush code anyway.
Ok, will rename to queue.
>
>> +{
>> + unsigned int nr_requeue = 0;
>> + struct list_head *preflush_running;
>> + struct list_head *postflush_running;
>> + struct request *rq, *n;
>> +
>> + preflush_running = &fq->preflush_queue[fq->flush_running_idx];
>> + postflush_running = &fq->postflush_queue[fq->flush_running_idx];
>
> I'd initialize these ad declaration time:
>
> struct list_head *preflush_running =
> &fq->preflush_queue[fq->flush_running_idx];
> struct list_head *postflush_running =
> &fq->postflush_queue[fq->flush_running_idx];
> unsigned int nr_requeue = 0;
> struct request *rq, *n;
>
LGTM, will change these.
Thanks for your review!
>> +
>> + list_for_each_entry_safe(rq, n, postflush_running, queuelist) {
>> + blk_end_flush(rq, fq, error);
>> }
>
> No need for the braces.
>
Powered by blists - more mailing lists