Re: [PATCH 6/7] dm: track the maximum number of bios in a cloned request

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

 



On Thu, Sep 12 2013 at  6:55pm -0400,
Mikulas Patocka <mpatocka@xxxxxxxxxx> wrote:

> There's a race condition (it's not serious):
> 
> +               if (num_bios > ACCESS_ONCE(peak_rq_based_ios))
> +                       ACCESS_ONCE(peak_rq_based_ios) = num_bios;
> 
> You can double-check it using code like this:
> if (num_bios > ACCESS_ONCE(peak_rq_based_ios)) {
> 	spin_lock_irqsave(&peak_rq_based_ios_lock, flags);
> 	if (num_bios > peak_rq_based_ios)
> 		peak_rq_based_ios = num_bios;
> 	spin_unlock_irqrestore(&peak_rq_based_ios_lock, flags);
> }

Yeah I thought about using double checked locking but didn't want to
incur the extra locking.  Figured precise answer for peak_rq_based_ios
wasn't of utmost importance.  But I'll think about doing it.

> Maybe - reset the value peak_rq_based_ios if the user clears 
> track_peak_rq_based_ios?

Well until patch 7 there isn't a convenient place to trap the change.
And you already took issue with how I did it in that patch.

--
dm-devel mailing list
dm-devel@xxxxxxxxxx
https://www.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