[DRBD-cvs] svn commit by phil - r2436 - in trunk: drbd user - *
Removed an informative WARN()ing from the worker * Ch
drbd-cvs at lists.linbit.com
drbd-cvs at lists.linbit.com
Wed Sep 20 17:16:53 CEST 2006
Author: phil
Date: 2006-09-20 17:16:51 +0200 (Wed, 20 Sep 2006)
New Revision: 2436
Modified:
trunk/drbd/drbd_actlog.c
trunk/drbd/drbd_int.h
trunk/drbd/drbd_nl.c
trunk/drbd/drbd_worker.c
trunk/user/drbdadm_main.c
Log:
* Removed an informative WARN()ing from the worker
* Changed the drbd_try_clear_on_disk_bm() to work with a bigger
resync LRU effectiv. No longer loops over it.
* Increased the size of the resync LRU, to get the number of
recount events down in case you have heavy IO during resync.
* in case an allocation of an UDW fails, hande this gracefull.
* Fixed a inconsistency in one of the drbadm command names.
Modified: trunk/drbd/drbd_actlog.c
===================================================================
--- trunk/drbd/drbd_actlog.c 2006-09-20 10:52:03 UTC (rev 2435)
+++ trunk/drbd/drbd_actlog.c 2006-09-20 15:16:51 UTC (rev 2436)
@@ -618,16 +618,15 @@
}
-/* ATTENTION. The AL's extents are 4MB each, while the extents in the *
- * resync LRU-cache are 16MB each. *
+/* ATTENTION. The AL's extents are 4MB each, while the extents in the
+ * resync LRU-cache are 16MB each.
*
* TODO will be obsoleted once we have a caching lru of the on disk bitmap
*/
STATIC void drbd_try_clear_on_disk_bm(struct Drbd_Conf *mdev,sector_t sector,
int cleared)
{
- struct list_head *le, *tmp;
- struct bm_extent* ext, *ext1;
+ struct bm_extent* ext;
struct update_odbm_work * udw;
unsigned int enr;
@@ -652,9 +651,12 @@
return;
}
} else {
- //WARN("Recounting sectors in %d (resync LRU too small?)\n", enr);
+ //WARN("Counting bits in %d (resync LRU small?)\n",enr);
// This element should be in the cache
// since drbd_rs_begin_io() pulled it already in.
+
+ // OR an application write finished, and therefore
+ // we set something in this area in sync.
int rs_left = drbd_bm_e_weight(mdev,enr);
if (ext->flags != 0) {
WARN("changing resync lce: %d[%u;%02lx]"
@@ -668,42 +670,24 @@
}
lc_put(mdev->resync,&ext->lce);
// no race, we are within the al_lock!
+
+ if (ext->rs_left == 0) {
+ udw=kmalloc(sizeof(*udw),GFP_ATOMIC);
+ if(udw) {
+ udw->enr = ext->lce.lc_number;
+ udw->w.cb = w_update_odbm;
+ drbd_queue_work_front(&mdev->data.work,&udw->w);
+ } else {
+ WARN("Could not kmalloc an udw\n");
+ set_bit(WRITE_BM_AFTER_RESYNC,&mdev->flags);
+ }
+ }
} else {
ERR("lc_get() failed! locked=%d/%d flags=%lu\n",
atomic_read(&mdev->resync_locked),
mdev->resync->nr_elements,
mdev->resync->flags);
}
-
- list_for_each_safe(le,tmp,&mdev->resync->lru) {
- ext1=(struct bm_extent *)list_entry(le,struct lc_element,list);
- if(ext1->rs_left == 0) {
- if(ext1 == ext) ext=NULL;
- udw=kmalloc(sizeof(*udw),GFP_ATOMIC);
- if(!udw) {
- WARN("Could not kmalloc an udw\n");
- break;
- }
- udw->enr = ext1->lce.lc_number;
- udw->w.cb = w_update_odbm;
- drbd_queue_work_front(&mdev->data.work,&udw->w);
- if (ext1->flags != 0) {
- WARN("deleting resync lce: %d[%u;%02lx]\n",
- ext1->lce.lc_number, ext1->rs_left,
- ext1->flags);
- ext1->flags = 0;
- }
- lc_del(mdev->resync,&ext1->lce);
- }
- }
-
- if(ext) {
- if (ext->rs_left == 0) {
- ERR("BUG! missed lc_number:%u refcnt: %u\n",
- ext->lce.lc_number,
- ext->lce.refcnt);
- }
- }
}
/* clear the bit corresponding to the piece of storage in question:
Modified: trunk/drbd/drbd_int.h
===================================================================
--- trunk/drbd/drbd_int.h 2006-09-20 10:52:03 UTC (rev 2435)
+++ trunk/drbd/drbd_int.h 2006-09-20 15:16:51 UTC (rev 2436)
@@ -711,7 +711,8 @@
CLUSTER_ST_CHANGE, // Cluster wide state change going on...
CL_ST_CHG_SUCCESS,
CL_ST_CHG_FAIL,
- CRASHED_PRIMARY // This node was a crashed primary
+ CRASHED_PRIMARY, // This node was a crashed primary
+ WRITE_BM_AFTER_RESYNC // A kmalloc() during resync failed
};
struct drbd_bitmap; // opaque for Drbd_Conf
Modified: trunk/drbd/drbd_nl.c
===================================================================
--- trunk/drbd/drbd_nl.c 2006-09-20 10:52:03 UTC (rev 2435)
+++ trunk/drbd/drbd_nl.c 2006-09-20 15:16:51 UTC (rev 2436)
@@ -670,7 +670,7 @@
goto fail;
}
- resync_lru = lc_alloc("resync",7, sizeof(struct bm_extent),mdev);
+ resync_lru = lc_alloc("resync",31, sizeof(struct bm_extent),mdev);
if(!resync_lru) {
retcode=KMallocFailed;
goto fail;
Modified: trunk/drbd/drbd_worker.c
===================================================================
--- trunk/drbd/drbd_worker.c 2006-09-20 10:52:03 UTC (rev 2435)
+++ trunk/drbd/drbd_worker.c 2006-09-20 15:16:51 UTC (rev 2436)
@@ -326,11 +326,8 @@
break;
// Be always aligned
- if (sector & ((1<<(align+3))-1) ) {
- WARN("sector %llu w.b. unaligned size "
- "%d (%d)\n",sector,size,align);
+ if (sector & ((1<<(align+3))-1) )
break;
- }
// do not cross extent boundaries
if (( (bit+1) & BM_BLOCKS_PER_BM_EXT_MASK ) == 0)
@@ -418,6 +415,11 @@
mdev->p_uuid = NULL;
}
+ if (test_and_clear_bit(WRITE_BM_AFTER_RESYNC,&mdev->flags)) {
+ WARN("Writing the whole bitmap, due to failed kmalloc\n");
+ drbd_bm_write(mdev);
+ }
+
drbd_request_state(mdev,NS3(conn,Connected,
disk,UpToDate,
pdsk,UpToDate));
Modified: trunk/user/drbdadm_main.c
===================================================================
--- trunk/user/drbdadm_main.c 2006-09-20 10:52:03 UTC (rev 2435)
+++ trunk/user/drbdadm_main.c 2006-09-20 15:16:51 UTC (rev 2436)
@@ -197,7 +197,7 @@
{ "primary", adm_generic_s, 1,1,0 },
{ "secondary", adm_generic_s, 1,1,0 },
{ "invalidate", adm_generic_l, 1,1,0 },
- { "invalidate_remote", adm_generic_l, 1,1,1 },
+ { "invalidate-remote", adm_generic_l, 1,1,1 },
{ "outdate", adm_generic_b, 1,1,0 },
{ "resize", adm_resize, 1,1,1 },
{ "syncer", adm_syncer, 1,1,1 },
More information about the drbd-cvs
mailing list