Home | History | Annotate | Line # | Download | only in raidframe
rf_cvscan.h revision 1.1
      1  1.1  oster /*	$NetBSD: rf_cvscan.h,v 1.1 1998/11/13 04:20:27 oster Exp $	*/
      2  1.1  oster /*
      3  1.1  oster  * Copyright (c) 1995 Carnegie-Mellon University.
      4  1.1  oster  * All rights reserved.
      5  1.1  oster  *
      6  1.1  oster  * Author: Mark Holland
      7  1.1  oster  *
      8  1.1  oster  * Permission to use, copy, modify and distribute this software and
      9  1.1  oster  * its documentation is hereby granted, provided that both the copyright
     10  1.1  oster  * notice and this permission notice appear in all copies of the
     11  1.1  oster  * software, derivative works or modified versions, and any portions
     12  1.1  oster  * thereof, and that both notices appear in supporting documentation.
     13  1.1  oster  *
     14  1.1  oster  * CARNEGIE MELLON ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS"
     15  1.1  oster  * CONDITION.  CARNEGIE MELLON DISCLAIMS ANY LIABILITY OF ANY KIND
     16  1.1  oster  * FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.
     17  1.1  oster  *
     18  1.1  oster  * Carnegie Mellon requests users of this software to return to
     19  1.1  oster  *
     20  1.1  oster  *  Software Distribution Coordinator  or  Software.Distribution (at) CS.CMU.EDU
     21  1.1  oster  *  School of Computer Science
     22  1.1  oster  *  Carnegie Mellon University
     23  1.1  oster  *  Pittsburgh PA 15213-3890
     24  1.1  oster  *
     25  1.1  oster  * any improvements or extensions that they make and grant Carnegie the
     26  1.1  oster  * rights to redistribute these changes.
     27  1.1  oster  */
     28  1.1  oster 
     29  1.1  oster /*
     30  1.1  oster **	Disk scheduling by CVSCAN( N, r )
     31  1.1  oster **
     32  1.1  oster **	Given a set of requests, partition them into one set on each
     33  1.1  oster **	side of the current arm position.  The trick is to pick which
     34  1.1  oster **	side you are going to service next; once a side is picked you will
     35  1.1  oster **	service the closest request.
     36  1.1  oster **	Let there be n1 requests on one side and n2 requests on the other
     37  1.1  oster **	side.  If one of n1 or n2 is zero, select the other side.
     38  1.1  oster **	If both n1 and n2 are nonzero, select a "range" for examination
     39  1.1  oster **	that is N' = min( n1, n2, N ).  Average the distance from the
     40  1.1  oster **	current position to the nearest N' requests on each side giving
     41  1.1  oster **	d1 and d2.
     42  1.1  oster **	Suppose the last decision was to move toward set 2, then the
     43  1.1  oster **	current direction is toward set 2, and you will only switch to set
     44  1.1  oster **	1 if d1+R < d2 where R is r*(total number of cylinders), r in [0,1].
     45  1.1  oster **
     46  1.1  oster **	I extend this by applying only to the set of requests that all
     47  1.1  oster **	share the same, highest priority level.
     48  1.1  oster */
     49  1.1  oster 
     50  1.1  oster /* :
     51  1.1  oster  * Log: rf_cvscan.h,v
     52  1.1  oster  * Revision 1.3  1996/06/07 22:26:27  jimz
     53  1.1  oster  * type-ify which_ru (RF_ReconUnitNum_t)
     54  1.1  oster  *
     55  1.1  oster  * Revision 1.2  1996/06/07  21:33:04  jimz
     56  1.1  oster  * begin using consistent types for sector numbers,
     57  1.1  oster  * stripe numbers, row+col numbers, recon unit numbers
     58  1.1  oster  *
     59  1.1  oster  * Revision 1.1  1996/06/05  19:17:40  jimz
     60  1.1  oster  * Initial revision
     61  1.1  oster  *
     62  1.1  oster  */
     63  1.1  oster 
     64  1.1  oster #ifndef _RF__RF_CVSCAN_H_
     65  1.1  oster #define _RF__RF_CVSCAN_H_
     66  1.1  oster 
     67  1.1  oster #include "rf_diskqueue.h"
     68  1.1  oster 
     69  1.1  oster typedef enum RF_CvscanArmDir_e {
     70  1.1  oster   rf_cvscan_LEFT,
     71  1.1  oster   rf_cvscan_RIGHT
     72  1.1  oster } RF_CvscanArmDir_t;
     73  1.1  oster 
     74  1.1  oster typedef struct RF_CvscanHeader_s {
     75  1.1  oster 	long		range_for_avg;	/* CVSCAN param N */
     76  1.1  oster 	long		change_penalty;	/* CVSCAN param R */
     77  1.1  oster 	RF_CvscanArmDir_t	direction;
     78  1.1  oster 	RF_SectorNum_t		cur_block;
     79  1.1  oster 	int		nxt_priority;
     80  1.1  oster 	RF_DiskQueueData_t	*left;
     81  1.1  oster 	int		left_cnt;
     82  1.1  oster 	RF_DiskQueueData_t	*right;
     83  1.1  oster 	int		right_cnt;
     84  1.1  oster 	RF_DiskQueueData_t	*burner;
     85  1.1  oster } RF_CvscanHeader_t;
     86  1.1  oster 
     87  1.1  oster int rf_CvscanConfigure(void);
     88  1.1  oster void *rf_CvscanCreate(RF_SectorCount_t sect_per_disk,
     89  1.1  oster 	RF_AllocListElem_t *cl_list, RF_ShutdownList_t **listp);
     90  1.1  oster void rf_CvscanEnqueue(void *qptr, RF_DiskQueueData_t *req, int priority);
     91  1.1  oster RF_DiskQueueData_t *rf_CvscanDequeue(void *qptr);
     92  1.1  oster RF_DiskQueueData_t *rf_CvscanPeek(void *qptr);
     93  1.1  oster int rf_CvscanPromote(void *qptr, RF_StripeNum_t parityStripeID,
     94  1.1  oster 	RF_ReconUnitNum_t which_ru);
     95  1.1  oster 
     96  1.1  oster #endif /* !_RF__RF_CVSCAN_H_ */
     97