[Drbd-dev] [PATCH] - DRBD 8.0: Add standard disk counters toDRBD devices

Graham, Simon Simon.Graham at stratus.com
Tue Apr 15 00:10:34 CEST 2008


> > +/* Update disk stats at start of I/O request */
> > +static inline void _drbd_start_io_acct(drbd_dev *mdev,
> drbd_request_t *req, struct bio *bio)
> > +{
> > +	int rw = bio_data_dir(bio);
> > +
> > +	MUST_HOLD(&mdev->req_lock)
> > +
> > +	disk_stat_inc(mdev->vdisk, ios[rw]);
> > +	disk_stat_add(mdev->vdisk, sectors[rw], bio_sectors(bio));
> > +	preempt_disable();
> 
> we are inside a spin_lock, no need to manipulate preempt,
> there is no preemptible spin_lock yet.
> 

I'll take your word for it BUT this is what ll_rw_blk.c/md do... well,
at least I think they do... I did merge some code in my version so maybe
they don't hold the lock when they call disk_round_stats()...

Simon



More information about the drbd-dev mailing list