[DRBD-cvs] r1696 - in branches/drbd-0.7: drbd testing
svn at svn.drbd.org
svn at svn.drbd.org
Mon Jan 10 20:50:54 CET 2005
Author: phil
Date: 2005-01-10 20:50:51 +0100 (Mon, 10 Jan 2005)
New Revision: 1696
Modified:
branches/drbd-0.7/drbd/drbd_int.h
branches/drbd-0.7/drbd/drbd_main.c
branches/drbd-0.7/drbd/drbd_receiver.c
branches/drbd-0.7/testing/write_gc.pl
Log:
* On this brand new dual Xeon system the counting of
epoch_size is broken. Probabely this revision of Xeons
is doing memory access reordering more agressive than
previous versions. Converting epoch size form
int to atomic_t solved the issue.
* When reading from an IBM-ServRaid controller (ips),
we need to call run_disk_queue() from time to time
to get sane performance of it.
* On this RHAT3 box the write_gc.pl program failed
to correctly write DRBD's magic number.
(probabely a bug in the perl version included
with RHAT3.)
Modified: branches/drbd-0.7/drbd/drbd_int.h
===================================================================
--- branches/drbd-0.7/drbd/drbd_int.h 2005-01-04 15:00:48 UTC (rev 1695)
+++ branches/drbd-0.7/drbd/drbd_int.h 2005-01-10 19:50:51 UTC (rev 1696)
@@ -796,7 +796,7 @@
atomic_t resync_locked; // Number of locked elements in resync LRU
int open_cnt;
u32 gen_cnt[GEN_CNT_SIZE];
- int epoch_size;
+ atomic_t epoch_size;
spinlock_t ee_lock;
struct list_head free_ee; // available
struct list_head active_ee; // IO in progress
Modified: branches/drbd-0.7/drbd/drbd_main.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_main.c 2005-01-04 15:00:48 UTC (rev 1695)
+++ branches/drbd-0.7/drbd/drbd_main.c 2005-01-10 19:50:51 UTC (rev 1696)
@@ -1452,9 +1452,9 @@
if ( mdev->ee_in_use != 0
|| mdev->ee_vacant != 32 /* EE_MININUM */
- || mdev->epoch_size != 0)
+ || atomic_read(&mdev->epoch_size) != 0)
ERR("ee_in_use:%d ee_vacant:%d epoch_size:%d\n",
- mdev->ee_in_use, mdev->ee_vacant, mdev->epoch_size);
+ mdev->ee_in_use, mdev->ee_vacant, atomic_read(&mdev->epoch_size));
#define ZAP(x) memset(&x,0,sizeof(x))
ZAP(mdev->conf);
ZAP(mdev->sync_conf);
Modified: branches/drbd-0.7/drbd/drbd_receiver.c
===================================================================
--- branches/drbd-0.7/drbd/drbd_receiver.c 2005-01-04 15:00:48 UTC (rev 1695)
+++ branches/drbd-0.7/drbd/drbd_receiver.c 2005-01-10 19:50:51 UTC (rev 1696)
@@ -810,8 +810,8 @@
spin_lock_irq(&mdev->ee_lock);
rv = _drbd_process_ee(mdev,1);
- epoch_size=mdev->epoch_size;
- mdev->epoch_size=0;
+ epoch_size=atomic_read(&mdev->epoch_size);
+ atomic_set(&mdev->epoch_size,0);
spin_unlock_irq(&mdev->ee_lock);
rv &= drbd_send_b_ack(mdev, p->barrier, epoch_size);
@@ -1023,7 +1023,7 @@
sector_t sector = drbd_ee_get_sector(e);
int ok=1;
- mdev->epoch_size++;
+ atomic_inc(&mdev->epoch_size);
if(mdev->conf.wire_protocol == DRBD_PROT_C) {
if(likely(drbd_bio_uptodate(&e->private_bio))) {
ok=drbd_send_ack(mdev,WriteAck,e);
@@ -1194,7 +1194,11 @@
mdev->read_cnt += size >> 9;
inc_unacked(mdev);
drbd_generic_make_request(READ,&e->private_bio);
+ if (atomic_read(&mdev->local_cnt) >= (mdev->conf.max_epoch_size>>4) ) {
+ drbd_kick_lo(mdev);
+ }
+
return TRUE;
}
@@ -1818,7 +1822,7 @@
D_ASSERT(list_empty(&mdev->sync_ee)); // done here
D_ASSERT(list_empty(&mdev->done_ee)); // done here
- mdev->epoch_size=0;
+ atomic_set(&mdev->epoch_size,0);
mdev->rs_total=0;
if(atomic_read(&mdev->unacked_cnt)) {
Modified: branches/drbd-0.7/testing/write_gc.pl
===================================================================
--- branches/drbd-0.7/testing/write_gc.pl 2005-01-04 15:00:48 UTC (rev 1695)
+++ branches/drbd-0.7/testing/write_gc.pl 2005-01-10 19:50:51 UTC (rev 1696)
@@ -61,8 +61,8 @@
if($ConnectedInd) { $Flags |= 0x04; }
if($WantFullSync) { $Flags |= 0x08; }
- $out = pack("N6", $Flags,$HumanCnt,$TimeoutCnt,$ConnectedCnt,
- $ArbitraryCnt, DRBD_MD_MAGIC);
+ $out = pack("N5", $Flags,$HumanCnt,$TimeoutCnt,$ConnectedCnt,
+ $ArbitraryCnt);
$rr = syswrite(GCF, $out, length($out));
die "syswrite failed: $!\n" unless $rr == length($out);
More information about the drbd-cvs
mailing list