Commit 328e0f12 authored by Philipp Reisner's avatar Philipp Reisner

drbd: Broadcast sync progress no more often than once per second

Signed-off-by: default avatarPhilipp Reisner <philipp.reisner@linbit.com>
Signed-off-by: default avatarLars Ellenberg <lars.ellenberg@linbit.com>
parent 518a4d53
...@@ -965,6 +965,7 @@ struct drbd_conf { ...@@ -965,6 +965,7 @@ struct drbd_conf {
unsigned long rs_mark_time[DRBD_SYNC_MARKS]; unsigned long rs_mark_time[DRBD_SYNC_MARKS];
/* current index into rs_mark_{left,time} */ /* current index into rs_mark_{left,time} */
int rs_last_mark; int rs_last_mark;
unsigned long rs_last_bcast; /* [unit jiffies] */
/* where does the admin want us to start? (sector) */ /* where does the admin want us to start? (sector) */
sector_t ov_start_sector; sector_t ov_start_sector;
......
...@@ -3295,6 +3295,12 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib) ...@@ -3295,6 +3295,12 @@ void drbd_bcast_event(struct drbd_conf *mdev, const struct sib_info *sib)
unsigned seq; unsigned seq;
int err = -ENOMEM; int err = -ENOMEM;
if (sib->sib_reason == SIB_SYNC_PROGRESS &&
time_after(jiffies, mdev->rs_last_bcast + HZ))
mdev->rs_last_bcast = jiffies;
else
return;
seq = atomic_inc_return(&drbd_genl_seq); seq = atomic_inc_return(&drbd_genl_seq);
msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO); msg = genlmsg_new(NLMSG_GOODSIZE, GFP_NOIO);
if (!msg) if (!msg)
......
...@@ -1696,6 +1696,10 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side) ...@@ -1696,6 +1696,10 @@ void drbd_start_resync(struct drbd_conf *mdev, enum drbd_conns side)
write_unlock_irq(&global_state_lock); write_unlock_irq(&global_state_lock);
if (r == SS_SUCCESS) { if (r == SS_SUCCESS) {
/* reset rs_last_bcast when a resync or verify is started,
* to deal with potential jiffies wrap. */
mdev->rs_last_bcast = jiffies - HZ;
dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n", dev_info(DEV, "Began resync as %s (will sync %lu KB [%lu bits set]).\n",
drbd_conn_str(ns.conn), drbd_conn_str(ns.conn),
(unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10), (unsigned long) mdev->rs_total << (BM_BLOCK_SHIFT-10),
......
...@@ -52,8 +52,8 @@ ...@@ -52,8 +52,8 @@
#endif #endif
extern const char *drbd_buildtag(void); extern const char *drbd_buildtag(void);
#define REL_VERSION "8.3.11" #define REL_VERSION "8.4.2"
#define API_VERSION 88 #define API_VERSION 1
#define PRO_VERSION_MIN 86 #define PRO_VERSION_MIN 86
#define PRO_VERSION_MAX 101 #define PRO_VERSION_MAX 101
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment