All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-block@vger.kernel.org, dm-devel@redhat.com,
	"Alasdair G. Kergon" <agk@redhat.com>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 3/3] block: return just one value from part_in_flight
Date: Thu, 29 Nov 2018 19:30:18 -0500	[thread overview]
Message-ID: <20181130003018.GB10015@redhat.com> (raw)
In-Reply-To: <20181128004251.504425345@debian.vm>

On Tue, Nov 27 2018 at  7:42pm -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> The previous patches deleted all the code that needed the second value
> returned from part_in_flight - now the kernel only uses the first value.
> 
> Consequently, part_in_flight (and blk_mq_in_flight) may be changed so that
> it only returns one value.
> 
> This patch just refactors the code, there's no functional change.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  block/blk-mq.c            |    6 ++++--
>  block/blk-mq.h            |    3 +--
>  block/genhd.c             |   32 +++++++++++---------------------
>  block/partition-generic.c |    6 +++---
>  include/linux/genhd.h     |    3 +--
>  5 files changed, 20 insertions(+), 30 deletions(-)
> 
> Index: linux-block/block/blk-mq.c
> ===================================================================
> --- linux-block.orig/block/blk-mq.c	2018-11-28 00:39:16.000000000 +0100
> +++ linux-block/block/blk-mq.c	2018-11-28 00:39:16.000000000 +0100
> @@ -113,13 +113,15 @@ static bool blk_mq_check_inflight(struct
>  	return true;
>  }
>  
> -void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part,
> -		      unsigned int inflight[2])
> +unsigned int blk_mq_in_flight(struct request_queue *q, struct hd_struct *part)
>  {
> +	unsigned inflight[2];
>  	struct mq_inflight mi = { .part = part, .inflight = inflight, };
>  
>  	inflight[0] = inflight[1] = 0;
>  	blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi);
> +
> +	return inflight[0];
>  }


I don't think this change goes deep enough.  You're leaving unnecessary
work (relative to mi->inflight[1]) in blk_mq_check_inflight().

Mike

WARNING: multiple messages have this Message-ID (diff)
From: Mike Snitzer <snitzer@redhat.com>
To: Mikulas Patocka <mpatocka@redhat.com>
Cc: Jens Axboe <axboe@kernel.dk>,
	dm-devel@redhat.com, linux-block@vger.kernel.org,
	"Alasdair G. Kergon" <agk@redhat.com>,
	Christoph Hellwig <hch@infradead.org>
Subject: Re: [PATCH 3/3] block: return just one value from part_in_flight
Date: Thu, 29 Nov 2018 19:30:18 -0500	[thread overview]
Message-ID: <20181130003018.GB10015@redhat.com> (raw)
In-Reply-To: <20181128004251.504425345@debian.vm>

On Tue, Nov 27 2018 at  7:42pm -0500,
Mikulas Patocka <mpatocka@redhat.com> wrote:

> The previous patches deleted all the code that needed the second value
> returned from part_in_flight - now the kernel only uses the first value.
> 
> Consequently, part_in_flight (and blk_mq_in_flight) may be changed so that
> it only returns one value.
> 
> This patch just refactors the code, there's no functional change.
> 
> Signed-off-by: Mikulas Patocka <mpatocka@redhat.com>
> 
> ---
>  block/blk-mq.c            |    6 ++++--
>  block/blk-mq.h            |    3 +--
>  block/genhd.c             |   32 +++++++++++---------------------
>  block/partition-generic.c |    6 +++---
>  include/linux/genhd.h     |    3 +--
>  5 files changed, 20 insertions(+), 30 deletions(-)
> 
> Index: linux-block/block/blk-mq.c
> ===================================================================
> --- linux-block.orig/block/blk-mq.c	2018-11-28 00:39:16.000000000 +0100
> +++ linux-block/block/blk-mq.c	2018-11-28 00:39:16.000000000 +0100
> @@ -113,13 +113,15 @@ static bool blk_mq_check_inflight(struct
>  	return true;
>  }
>  
> -void blk_mq_in_flight(struct request_queue *q, struct hd_struct *part,
> -		      unsigned int inflight[2])
> +unsigned int blk_mq_in_flight(struct request_queue *q, struct hd_struct *part)
>  {
> +	unsigned inflight[2];
>  	struct mq_inflight mi = { .part = part, .inflight = inflight, };
>  
>  	inflight[0] = inflight[1] = 0;
>  	blk_mq_queue_tag_busy_iter(q, blk_mq_check_inflight, &mi);
> +
> +	return inflight[0];
>  }


I don't think this change goes deep enough.  You're leaving unnecessary
work (relative to mi->inflight[1]) in blk_mq_check_inflight().

Mike

  reply	other threads:[~2018-11-30  0:30 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-11-28  0:42 [PATCH 3/3] block: return just one value from part_in_flight Mikulas Patocka
2018-11-28  0:42 ` Mikulas Patocka
2018-11-30  0:30 ` Mike Snitzer [this message]
2018-11-30  0:30   ` Mike Snitzer

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=20181130003018.GB10015@redhat.com \
    --to=snitzer@redhat.com \
    --cc=agk@redhat.com \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=hch@infradead.org \
    --cc=linux-block@vger.kernel.org \
    --cc=mpatocka@redhat.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.