All of lore.kernel.org
 help / color / mirror / Atom feed
From: Christoph Hellwig <hch@infradead.org>
To: Mike Snitzer <snitzer@redhat.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, dm-devel@redhat.com
Subject: Re: [dm-devel] [PATCH 1/3] block: add __bio_start_io_acct() to control start_time
Date: Thu, 27 Jan 2022 12:01:30 -0800	[thread overview]
Message-ID: <YfL6GgqQPqj7jxbF@infradead.org> (raw)
In-Reply-To: <20220127190742.12776-2-snitzer@redhat.com>

> -static unsigned long __part_start_io_acct(struct block_device *part,
> -					  unsigned int sectors, unsigned int op)
> +static void __part_start_io_acct(struct block_device *part, unsigned int sectors,
> +				 unsigned int op, unsigned long start_time)

Please avoid the overly long line.

> +/**
> + * __bio_start_io_acct - start I/O accounting for bio based drivers
> + * @bio:	bio to start account for
> + * @start_time:	start time that should be passed back to bio_end_io_acct().
> + */
> +void __bio_start_io_acct(struct bio *bio, unsigned long start_time)

I'd name this something like bio_start_io_acct_time to be a little more
descriptive

> +	unsigned long now = READ_ONCE(jiffies);
> +	__bio_start_io_acct(bio, now);
> +	return now;

Plase add an empty line after the variable declaration.

>  }
>  EXPORT_SYMBOL_GPL(bio_start_io_acct);
>  
>  unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
>  				 unsigned int op)
>  {
> -	return __part_start_io_acct(disk->part0, sectors, op);
> +	unsigned long now = READ_ONCE(jiffies);
> +	__part_start_io_acct(disk->part0, sectors, op, now);
> +	return now;

I wonder if just returning the passed in time from __part_start_io_acct
wouldn't be a bit cleaner to avoid all the extra local variables.

WARNING: multiple messages have this Message-ID (diff)
From: Christoph Hellwig <hch@infradead.org>
To: Mike Snitzer <snitzer@redhat.com>
Cc: axboe@kernel.dk, linux-block@vger.kernel.org, dm-devel@redhat.com
Subject: Re: [dm-devel] [PATCH 1/3] block: add __bio_start_io_acct() to control start_time
Date: Thu, 27 Jan 2022 12:01:30 -0800	[thread overview]
Message-ID: <YfL6GgqQPqj7jxbF@infradead.org> (raw)
In-Reply-To: <20220127190742.12776-2-snitzer@redhat.com>

> -static unsigned long __part_start_io_acct(struct block_device *part,
> -					  unsigned int sectors, unsigned int op)
> +static void __part_start_io_acct(struct block_device *part, unsigned int sectors,
> +				 unsigned int op, unsigned long start_time)

Please avoid the overly long line.

> +/**
> + * __bio_start_io_acct - start I/O accounting for bio based drivers
> + * @bio:	bio to start account for
> + * @start_time:	start time that should be passed back to bio_end_io_acct().
> + */
> +void __bio_start_io_acct(struct bio *bio, unsigned long start_time)

I'd name this something like bio_start_io_acct_time to be a little more
descriptive

> +	unsigned long now = READ_ONCE(jiffies);
> +	__bio_start_io_acct(bio, now);
> +	return now;

Plase add an empty line after the variable declaration.

>  }
>  EXPORT_SYMBOL_GPL(bio_start_io_acct);
>  
>  unsigned long disk_start_io_acct(struct gendisk *disk, unsigned int sectors,
>  				 unsigned int op)
>  {
> -	return __part_start_io_acct(disk->part0, sectors, op);
> +	unsigned long now = READ_ONCE(jiffies);
> +	__part_start_io_acct(disk->part0, sectors, op, now);
> +	return now;

I wonder if just returning the passed in time from __part_start_io_acct
wouldn't be a bit cleaner to avoid all the extra local variables.

--
dm-devel mailing list
dm-devel@redhat.com
https://listman.redhat.com/mailman/listinfo/dm-devel


  reply	other threads:[~2022-01-27 20:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 19:07 [PATCH 0/3] block/dm: fix bio-based DM IO accounting Mike Snitzer
2022-01-27 19:07 ` [dm-devel] " Mike Snitzer
2022-01-27 19:07 ` [PATCH 1/3] block: add __bio_start_io_acct() to control start_time Mike Snitzer
2022-01-27 19:07   ` [dm-devel] " Mike Snitzer
2022-01-27 20:01   ` Christoph Hellwig [this message]
2022-01-27 20:01     ` Christoph Hellwig
2022-01-27 19:07 ` [PATCH 2/3] dm: revert partial fix for redundant bio-based IO accounting Mike Snitzer
2022-01-27 19:07   ` [dm-devel] " Mike Snitzer
2022-01-27 19:07 ` [PATCH 3/3] dm: properly fix " Mike Snitzer
2022-01-27 19:07   ` [dm-devel] " 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=YfL6GgqQPqj7jxbF@infradead.org \
    --to=hch@infradead.org \
    --cc=axboe@kernel.dk \
    --cc=dm-devel@redhat.com \
    --cc=linux-block@vger.kernel.org \
    --cc=snitzer@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.