mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Muchun Song <muchun.song@linux.dev>
To: Yu Kuai <yukuai1@huaweicloud.com>
Cc: Muchun Song <songmuchun@bytedance.com>,
	mingo@redhat.com, peterz@infradead.org, chengming.zhou@linux.dev,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	tj@kernel.org, "yukuai (C)" <yukuai3@huawei.com>,
	axboe@kernel.dk
Subject: Re: [PATCH] block: refactor rq_qos_wait()
Date: Tue, 29 Oct 2024 15:30:08 +0800	[thread overview]
Message-ID: <C50E9EB1-809B-4F69-86E1-96D307BF077C@linux.dev> (raw)
In-Reply-To: <9c6099ba-8d95-f2f6-fe36-7333f706c0fc@huaweicloud.com>



> On Oct 25, 2024, at 15:50, Yu Kuai <yukuai1@huaweicloud.com> wrote:
> 
> Hi,
> 
> +CC Tejun
> 
> 在 2024/10/24 12:35, Muchun Song 写道:
>> When rq_qos_wait() is first introduced, it is easy to understand. But
>> with some bug fixes applied, it is not easy for newcomers to understand
>> the whole logic under those fixes. In this patch, rq_qos_wait() is
>> refactored and more comments are added for better understanding. There
>> are 4 points for the improvement:
>>     1) Use waitqueue_active() instead of wq_has_sleeper() to eliminate
>>        unnecessary memory barrier in wq_has_sleeper() which is supposed
>>        to be used in waker side. In this case, we do need the barrier.
>>        So use the cheaper one to locklessly test for waiters on the queue.
>>     2) There is already a macro DEFINE_WAIT_FUNC() to declare a
>>        wait_queue_entry with a specified waking function. But there is not
>>        a counterpart for initializing one wait_queue_entry with a
>>        specified waking function. So introducing init_wait_func() for
>>        this, which also could be used elsewhere (like filemap.c). It can
>>        be used in rq_qos_wait() to use default_wake_function() to wake up
>>        waiters, which could remove ->task field from rq_qos_wait_data.
> 
> I think it's better to cook point 2 as a seperate patch.
> 
> Whether or not, this patch LGTM.

Either is OK for me. I can update this in v2.

> Reviewed-by: Yu Kuai <yukuai3@huawei.com>

Thanks for your review.

Thanks,
Muchun

      reply	other threads:[~2024-10-29  7:31 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-10-24  4:35 Muchun Song
2024-10-25  7:50 ` Yu Kuai
2024-10-29  7:30   ` Muchun Song [this message]

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=C50E9EB1-809B-4F69-86E1-96D307BF077C@linux.dev \
    --to=muchun.song@linux.dev \
    --cc=axboe@kernel.dk \
    --cc=chengming.zhou@linux.dev \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=songmuchun@bytedance.com \
    --cc=tj@kernel.org \
    --cc=yukuai1@huaweicloud.com \
    --cc=yukuai3@huawei.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

all inboxes | Powered by JetHome®