mirror of
git://sourceware.org/git/lvm2.git
synced 2024-12-21 13:34:40 +03:00
pooldaemon: increase min polling interval
Although we support '0' interval - it's highly inefficent to do so many scans in busy-loop. So ATM raise minimal rescan time to 100ms. TODO: revisit whole timing logic here as it does have some sideeffect hiddent impact and can considerably eat CPU in some cases.
This commit is contained in:
parent
5edb353062
commit
1a451207b8
@ -21,7 +21,7 @@
|
||||
|
||||
#include <time.h>
|
||||
|
||||
#define WAIT_AT_LEAST_NANOSECS 100000
|
||||
#define WAIT_AT_LEAST_NANOSECS 100000000
|
||||
|
||||
progress_t poll_mirror_progress(struct cmd_context *cmd,
|
||||
struct logical_volume *lv, const char *name,
|
||||
@ -127,7 +127,7 @@ static void _nanosleep(unsigned secs, unsigned allow_zero_time)
|
||||
|
||||
static void _sleep_and_rescan_devices(struct cmd_context *cmd, struct daemon_parms *parms)
|
||||
{
|
||||
if (parms->interval && !parms->aborting) {
|
||||
if (!parms->aborting) {
|
||||
/*
|
||||
* FIXME: do we really need to drop everything and then rescan
|
||||
* everything between each iteration? What change exactly does
|
||||
@ -136,7 +136,7 @@ static void _sleep_and_rescan_devices(struct cmd_context *cmd, struct daemon_par
|
||||
*/
|
||||
lvmcache_destroy(cmd, 1, 0);
|
||||
label_scan_destroy(cmd);
|
||||
_nanosleep(parms->interval, 1);
|
||||
_nanosleep(parms->interval, 0);
|
||||
lvmcache_label_scan(cmd);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user