* [PATCH] blk-throttle: Make total_nr_queued unsigned
@ 2011-06-13 15:54 Joe Perches
2011-06-13 17:09 ` Vivek Goyal
2011-06-13 18:19 ` Jens Axboe
0 siblings, 2 replies; 3+ messages in thread
From: Joe Perches @ 2011-06-13 15:54 UTC (permalink / raw)
To: Jens Axboe; +Cc: Vivek Goyal, linux-kernel
cc: Vivek Goyal <vgoyal@redhat.com>
The total of two unsigned values should also be unsigned.
Update throtl_log output to unsigned.
Update total_nr_queued test to non-zero to be the
same as the other total_nr_queued tests.
Signed-off-by: Joe Perches <joe@perches.com>
---
block/blk-throttle.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/block/blk-throttle.c b/block/blk-throttle.c
index 3689f83..f6a7941 100644
--- a/block/blk-throttle.c
+++ b/block/blk-throttle.c
@@ -142,9 +142,9 @@ static inline struct throtl_grp *tg_of_blkg(struct blkio_group *blkg)
return NULL;
}
-static inline int total_nr_queued(struct throtl_data *td)
+static inline unsigned int total_nr_queued(struct throtl_data *td)
{
- return (td->nr_queued[0] + td->nr_queued[1]);
+ return td->nr_queued[0] + td->nr_queued[1];
}
static inline struct throtl_grp *throtl_ref_get_tg(struct throtl_grp *tg)
@@ -927,7 +927,7 @@ static int throtl_dispatch(struct request_queue *q)
bio_list_init(&bio_list_on_stack);
- throtl_log(td, "dispatch nr_queued=%d read=%u write=%u",
+ throtl_log(td, "dispatch nr_queued=%u read=%u write=%u",
total_nr_queued(td), td->nr_queued[READ],
td->nr_queued[WRITE]);
@@ -970,7 +970,7 @@ throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay)
struct delayed_work *dwork = &td->throtl_work;
/* schedule work if limits changed even if no bio is queued */
- if (total_nr_queued(td) > 0 || td->limits_changed) {
+ if (total_nr_queued(td) || td->limits_changed) {
/*
* We might have a work scheduled to be executed in future.
* Cancel that and schedule a new one.
--
1.7.6.rc1
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-throttle: Make total_nr_queued unsigned
2011-06-13 15:54 [PATCH] blk-throttle: Make total_nr_queued unsigned Joe Perches
@ 2011-06-13 17:09 ` Vivek Goyal
2011-06-13 18:19 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Vivek Goyal @ 2011-06-13 17:09 UTC (permalink / raw)
To: Joe Perches; +Cc: Jens Axboe, linux-kernel
On Mon, Jun 13, 2011 at 08:54:48AM -0700, Joe Perches wrote:
> cc: Vivek Goyal <vgoyal@redhat.com>
>
> The total of two unsigned values should also be unsigned.
>
> Update throtl_log output to unsigned.
> Update total_nr_queued test to non-zero to be the
> same as the other total_nr_queued tests.
>
> Signed-off-by: Joe Perches <joe@perches.com>
Thanks. Looks good to me.
Acked-by: Vivek Goyal <vgoyal@redhat.com>
Vivek
> ---
> block/blk-throttle.c | 8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/block/blk-throttle.c b/block/blk-throttle.c
> index 3689f83..f6a7941 100644
> --- a/block/blk-throttle.c
> +++ b/block/blk-throttle.c
> @@ -142,9 +142,9 @@ static inline struct throtl_grp *tg_of_blkg(struct blkio_group *blkg)
> return NULL;
> }
>
> -static inline int total_nr_queued(struct throtl_data *td)
> +static inline unsigned int total_nr_queued(struct throtl_data *td)
> {
> - return (td->nr_queued[0] + td->nr_queued[1]);
> + return td->nr_queued[0] + td->nr_queued[1];
> }
>
> static inline struct throtl_grp *throtl_ref_get_tg(struct throtl_grp *tg)
> @@ -927,7 +927,7 @@ static int throtl_dispatch(struct request_queue *q)
>
> bio_list_init(&bio_list_on_stack);
>
> - throtl_log(td, "dispatch nr_queued=%d read=%u write=%u",
> + throtl_log(td, "dispatch nr_queued=%u read=%u write=%u",
> total_nr_queued(td), td->nr_queued[READ],
> td->nr_queued[WRITE]);
>
> @@ -970,7 +970,7 @@ throtl_schedule_delayed_work(struct throtl_data *td, unsigned long delay)
> struct delayed_work *dwork = &td->throtl_work;
>
> /* schedule work if limits changed even if no bio is queued */
> - if (total_nr_queued(td) > 0 || td->limits_changed) {
> + if (total_nr_queued(td) || td->limits_changed) {
> /*
> * We might have a work scheduled to be executed in future.
> * Cancel that and schedule a new one.
> --
> 1.7.6.rc1
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] blk-throttle: Make total_nr_queued unsigned
2011-06-13 15:54 [PATCH] blk-throttle: Make total_nr_queued unsigned Joe Perches
2011-06-13 17:09 ` Vivek Goyal
@ 2011-06-13 18:19 ` Jens Axboe
1 sibling, 0 replies; 3+ messages in thread
From: Jens Axboe @ 2011-06-13 18:19 UTC (permalink / raw)
To: Joe Perches; +Cc: Vivek Goyal, linux-kernel
On 2011-06-13 17:54, Joe Perches wrote:
> cc: Vivek Goyal <vgoyal@redhat.com>
>
> The total of two unsigned values should also be unsigned.
>
> Update throtl_log output to unsigned.
> Update total_nr_queued test to non-zero to be the
> same as the other total_nr_queued tests.
Thanks, I pulled this into for-3.1/core with the ack from Vivek.
--
Jens Axboe
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-06-13 18:19 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-06-13 15:54 [PATCH] blk-throttle: Make total_nr_queued unsigned Joe Perches
2011-06-13 17:09 ` Vivek Goyal
2011-06-13 18:19 ` Jens Axboe
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox