diff options
author | Peter Galbavy <peter@cvs.openbsd.org> | 1999-08-03 13:56:39 +0000 |
---|---|---|
committer | Peter Galbavy <peter@cvs.openbsd.org> | 1999-08-03 13:56:39 +0000 |
commit | e4ad7ec5153f083d6c217951f62c45f7b5bef1bf (patch) | |
tree | 534f382aaaf300943319bc2085376472d570447e /sys/dev/raidframe/rf_driver.c | |
parent | 770ef6ff81279f6a89955b304db960c0cd5aa562 (diff) |
* rf_reconstruct.c: adopt nilkas' suggestion regard statics and
__inline__ - this is a proof of concept and will cover the raidframe
source as a whole over coming updates. Update namespace of function to
prefix with rf_ - comments again welcome.
* overall: rework the macros in rf_etimer.h and the resultant changes
to their use to count microseconds and not clock ticks. Restore the code
in rf_revent.c to a similar strcuture to before the previous commit,
and use the system timers to govern resource usage.
Tested with local i386/IDE and the reconstruction of a disk in my
array - performance has improved for reconstruction at no noticable
CPU cost.
Diffstat (limited to 'sys/dev/raidframe/rf_driver.c')
-rw-r--r-- | sys/dev/raidframe/rf_driver.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/sys/dev/raidframe/rf_driver.c b/sys/dev/raidframe/rf_driver.c index 5581cbfd316..887d16d44c2 100644 --- a/sys/dev/raidframe/rf_driver.c +++ b/sys/dev/raidframe/rf_driver.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rf_driver.c,v 1.3 1999/07/30 14:45:32 peter Exp $ */ +/* $OpenBSD: rf_driver.c,v 1.4 1999/08/03 13:56:37 peter Exp $ */ /* $NetBSD: rf_driver.c,v 1.12 1999/07/19 01:36:07 oster Exp $ */ /*- * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -964,8 +964,6 @@ rf_ConfigureDebug(cfgPtr) } /* performance monitoring stuff */ -#define TIMEVAL_TO_US(t) (((long) t.tv_sec) * 1000000L + (long) t.tv_usec) - #if !defined(_KERNEL) && !defined(SIMULATE) /* @@ -1014,7 +1012,7 @@ rf_StopThroughputStats(RF_Raid_t * raidPtr) if (raidPtr->throughputstats.num_out_ios == 0) { RF_GETTIME(raidPtr->throughputstats.stop); RF_TIMEVAL_DIFF(&raidPtr->throughputstats.start, &raidPtr->throughputstats.stop, &diff); - raidPtr->throughputstats.sum_io_us += TIMEVAL_TO_US(diff); + raidPtr->throughputstats.sum_io_us += RF_TIMEVAL_TO_US(diff); } RF_UNLOCK_MUTEX(raidPtr->throughputstats.mutex); } @@ -1063,7 +1061,7 @@ rf_PrintUserStats(RF_Raid_t * raidPtr) struct timeval diff; RF_TIMEVAL_DIFF(&raidPtr->userstats.start, &raidPtr->userstats.stop, &diff); - elapsed_us = TIMEVAL_TO_US(diff); + elapsed_us = RF_TIMEVAL_TO_US(diff); /* 2000 sectors per megabyte, 10000000 microseconds per second */ if (elapsed_us) |