Re: [PATCH v3 1/3] block: add bio_start_io_acct_time() to control start_time

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Jan 28 2022 at  1:13P -0500,
Christoph Hellwig <hch@xxxxxx> wrote:

> On Thu, Jan 27, 2022 at 11:17:51PM -0500, Mike Snitzer wrote:
> > +	__part_start_io_acct(bio->bi_bdev, bio_sectors(bio),
> > +			     bio_op(bio), start_time);
> >  }
> > +EXPORT_SYMBOL_GPL(bio_start_io_acct_time);
> >  
> >  /**
> >   * bio_start_io_acct - start I/O accounting for bio based drivers
> > @@ -1084,14 +1096,15 @@ static unsigned long __part_start_io_acct(struct block_device *part,
> >   */
> >  unsigned long bio_start_io_acct(struct bio *bio)
> >  {
> > -	return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio), bio_op(bio));
> > +	return __part_start_io_acct(bio->bi_bdev, bio_sectors(bio),
> > +				    bio_op(bio), jiffies);
> 
> Is droppingthe READ_ONCE safe here?  This is a honest question as these
> helpers still confuse me.

I'm not sure either, commit 956d510ee78ca ("block: add disk/bio-based
accounting helpers") doesn't offer any insight on the need.

Very little kernel code uses READ_ONCE(jiffies).

git diff 24d69293d9a561645e0b4d78c2fb179827e35f53^..e722fff238bbfe6308d7778a8c2163c181bf998a
shows that at the time the outgoing generic_{start,end}_io_acct didn't
use READ_ONCE (nor did any of the drivers that were updated to use the
new helpers).

ACCESS_ONCE() was used prior to READ_ONCE() -- see commit
cbbce82209490 and then 316c1608d15c7.

Anyway, looks to be cargo cult at this point right?
(if so, implies the use of READ_ONCE() in patch 3 isn't needed either)

> The rest looks good:
> 
> Reviewed-by: Christoph Hellwig <hch@xxxxxx>

Thanks.

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




[Index of Archives]     [DM Crypt]     [Fedora Desktop]     [ATA RAID]     [Fedora Marketing]     [Fedora Packaging]     [Fedora SELinux]     [Yosemite Discussion]     [KDE Users]     [Fedora Docs]

  Powered by Linux