The patch ...
On Wed, Feb 21, 2001 at 08:26:14AM -0500, Jean-Louis Martineau wrote:
> On Tue, Feb 20, 2001 at 07:53:20PM -0500, John R. Jackson wrote:
> > There are two categories of dumpers, "little" and "big". The first three
> > (LITTLE_DUMPERS in driver.c) dumpers from "inparallel" are assigned
> > to "little" duty, everyone else is "big". Little dumpers pick entries
> > from the head (shortest estimated time) of the queue. Big dumpers take
> > entries from the end (longest estimated time) of the queue.
>
> I'm working on a patch where each dumpers can have different criteria for
> the disk it pick according to (smallest or biggest: bandwidth, size or time)
>
> The criteria I'm using might not be good for you, but it give me a good
> speedup. You update the type_dumpers array to change the criteria for
> a dumper.
>
> Jean-Louis
> --
> Jean-Louis Martineau email: [EMAIL PROTECTED]
> Departement IRO, Universite de Montreal
> C.P. 6128, Succ. CENTRE-VILLE Tel: (514) 343-6111 ext. 3529
> Montreal, Canada, H3C 3J7 Fax: (514) 343-5834
--
Jean-Louis Martineau email: [EMAIL PROTECTED]
Departement IRO, Universite de Montreal
C.P. 6128, Succ. CENTRE-VILLE Tel: (514) 343-6111 ext. 3529
Montreal, Canada, H3C 3J7 Fax: (514) 343-5834
--- server-src/driver.c.orig Thu Nov 9 21:39:23 2000
+++ server-src/driver.c Thu Nov 9 21:32:50 2000
@@ -47,6 +47,37 @@
#include "driverio.h"
#include "server_util.h"
+#define D_SMALL_SIZE 0
+#define D_BIG_SIZE 1
+#define D_SMALL_TIME 2
+#define D_BIG_TIME 3
+#define D_SMALL_KPS 4
+#define D_BIG_KPS 5
+
+/*#int type_dumpers[MAX_DUMPERS] = { D_SMALL_SIZE, D_SMALL_SIZE, D_SMALL_SIZE,\
+ D_BIG_SIZE , D_BIG_SIZE , D_BIG_SIZE ,};*/
+int type_dumpers[MAX_DUMPERS]= { D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS,\
+ D_BIG_TIME, D_BIG_KPS, D_BIG_TIME,\
+ D_BIG_KPS, D_BIG_TIME, D_BIG_KPS};
+
disklist_t waitq, runq, tapeq, roomq;
int pending_aborts, inside_dump_to_tape;
int use_lffo;
@@ -495,9 +536,9 @@
disklist_t *rq;
{
int total, cur_idle;
- disk_t *diskp, *big_degraded_diskp;
+ disk_t *diskp, *diskp_accept;
dumper_t *dumper;
- assignedhd_t **holdp=NULL, **big_degraded_holdp=NULL;
+ assignedhd_t **holdp=NULL, **holdp_accept;
time_t now = time(NULL);
total = 0;
@@ -532,9 +573,9 @@
for(dumper = dmptable; dumper < dmptable+inparallel; dumper++) {
if(dumper->busy || dumper->down) continue;
/* found an idle dumper, now find a disk for it */
- if(is_bigdumper(dumper)) diskp = rq->tail;
- else diskp = rq->head;
- big_degraded_diskp = NULL;
+ diskp = rq->head;
+ diskp_accept = NULL;
+ holdp_accept = NULL;
if(idle_reason == IDLE_NO_DUMPERS)
idle_reason = NOT_IDLE;
@@ -573,28 +614,38 @@
} else {
/* disk fits, dump it */
- if(is_bigdumper(dumper) && degraded_mode) {
- if(!big_degraded_diskp ||
- sched(diskp)->priority > big_degraded_diskp->priority) {
- big_degraded_diskp = diskp;
- big_degraded_holdp = holdp;
+ int accept = !diskp_accept;
+ if(!accept) {
+ switch(type_dumpers[dumper-dmptable]) {
+ case D_SMALL_SIZE: accept = (sched(diskp)->est_size <
+sched(diskp_accept)->est_size);
+ break;
+ case D_BIG_SIZE : accept = (sched(diskp)->est_size >
+sched(diskp_accept)->est_size);
+ break;
+ case D_SMALL_TIME: accept = (sched(diskp)->est_time <
+sched(diskp_accept)->est_time);
+ break;
+ case D_BIG_TIME : accept = (sched(diskp)->est_time >
+sched(diskp_accept)->est_time);
+ break;
+ case D_SMALL_KPS : accept = (sched(diskp)->est_kps <
+sched(diskp_accept)->est_kps);
+ break;
+ case D_BIG_KPS : accept = (sched(diskp)->est_kps >
+sched(diskp_accept)->est_kps);
+ break;
}
}
- else {
- cur_idle = NOT_IDLE;
- break;
+ if(accept) {
+ if( !diskp_accept || !degraded_mode || diskp->priority >=
+diskp_accept->priority) {
+ if(holdp_accept) free_assignedhd(holdp_accept);
+ diskp_accept = diskp;
+ holdp_accept = holdp;
+ }
}
}
- if(is_bigdumper(dumper)) diskp = diskp->prev;
- else diskp = diskp->next;
+ diskp = diskp->next;
}
- if(is_bigdumper(dumper) && degraded_mode) {
- diskp = big_degraded_diskp;
- holdp = big_degraded_holdp;
- if(big_degraded_diskp) cur_idle = NOT_IDLE;
- }
- if(diskp && cur_idle == NOT_IDLE) {
+ diskp = diskp_accept;
+ holdp = holdp_accept;
+ if(diskp) {
+ cur_idle = NOT_IDLE;
sched(diskp)->act_size = 0;
allocate_bandwidth(diskp->host->netif, sched(diskp)->est_kps);
sched(diskp)->activehd = assign_holdingdisk(holdp, diskp);