linux-block.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff Moyer <jmoyer@redhat.com>
To: Dan Carpenter <dan.carpenter@oracle.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, linux-kernel@vger.kernel.org,
	kernel-janitors@vger.kernel.org
Subject: Re: [PATCH] iocost: add a comment about locking in ioc_weight_write()
Date: Mon, 04 Nov 2019 06:59:32 -0500	[thread overview]
Message-ID: <x491runq2cb.fsf@segfault.boston.devel.redhat.com> (raw)
In-Reply-To: <20191104101811.GA20821@mwanda> (Dan Carpenter's message of "Mon, 4 Nov 2019 13:18:11 +0300")

Dan Carpenter <dan.carpenter@oracle.com> writes:

> It wasn't very clear that blkg_conf_prep() disables IRQ and that they
> are enabled in blkg_conf_finish() so this patch adds a comment about it.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Reviewed-by: Jeff Moyer <jmoyer@redhat.com>

Thanks, Dan!

> ---
> I don't know if it's too late to fold this in with the previous patch?
>
>  block/blk-iocost.c | 2 ++
>  1 file changed, 2 insertions(+)
>
> diff --git a/block/blk-iocost.c b/block/blk-iocost.c
> index a7ed434eae03..c5a8703ca6aa 100644
> --- a/block/blk-iocost.c
> +++ b/block/blk-iocost.c
> @@ -2095,6 +2095,7 @@ static ssize_t ioc_weight_write(struct kernfs_open_file *of, char *buf,
>  		return nbytes;
>  	}
>  
> +	/* blkg_conf_prep() takes the q->queue_lock and disables IRQs */
>  	ret = blkg_conf_prep(blkcg, &blkcg_policy_iocost, buf, &ctx);
>  	if (ret)
>  		return ret;
> @@ -2115,6 +2116,7 @@ static ssize_t ioc_weight_write(struct kernfs_open_file *of, char *buf,
>  	weight_updated(iocg);
>  	spin_unlock(&iocg->ioc->lock);
>  
> +	/* blkg_conf_finish() unlocks the q->queue_lock and enables IRQs */
>  	blkg_conf_finish(&ctx);
>  	return nbytes;


      reply	other threads:[~2019-11-04 11:59 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-31 10:53 [PATCH] iocost: don't nest spin_lock_irq in ioc_weight_write() Dan Carpenter
2019-10-31 16:50 ` Tejun Heo
2019-10-31 17:38 ` Jens Axboe
2019-11-01 15:39 ` Jeff Moyer
2019-11-04 10:18   ` [PATCH] iocost: add a comment about locking " Dan Carpenter
2019-11-04 11:59     ` Jeff Moyer [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=x491runq2cb.fsf@segfault.boston.devel.redhat.com \
    --to=jmoyer@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dan.carpenter@oracle.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-block@vger.kernel.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;
as well as URLs for NNTP newsgroup(s).