Re: [PATCH 4/9] btrfs: Avoid a rescan for a device which was already not found.

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

 



On Thu, Sep 27, 2018 at 08:34:59PM +0200, Goffredo Baroncelli wrote:
> From: Goffredo Baroncelli <kreijack@xxxxxxxxx>
>
> Change the behavior of find_device(): before the patch, a read of a missed
> device may trigger a rescan. However, it is never recorded that a device
> is missed, so each single read of a missed device may triggers a rescan.
> It is the caller who decides if a rescan is performed in case of a missed
> device. And it does quite often, without considering if in the past a
> devices was already found as "missed"
> This behavior causes a lot of unneeded rescan, causing a huge slowdown in
> case of a missed device.
>
> After the patch, the "missed device" information is stored in the
> data->devices_attached[] array (as a NULL value in the field dev). A rescan
> is triggered only if no information at all is found. This means that only
> the first time a read of a missed device triggers a rescan.
>
> The change in the code is done removing "return NULL" when the disk is not
> found. So it is always executed the code which stores in the
> data->devices_attached[] array the value returned by grub_device_iterate():
> NULL if the device is missed, or a valid data otherwise.
>
> Signed-off-by: Goffredo Baroncelli <kreikack@xxxxxxxxx>

Commit message still begs for improvement. I will send you a proposal shortly.

Daniel



[Index of Archives]     [Linux Filesystem Development]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux