Commit 3e4d05a1 authored by Justin T. Gibbs's avatar Justin T. Gibbs

Use down_interruptable() rather than down() to avoid having the DV threads

counted toward the load average. 
parent a4d95569
/* /*
* Adaptec AIC79xx device driver for Linux. * Adaptec AIC79xx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#101 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic79xx_osm.c#102 $
* *
* -------------------------------------------------------------------------- * --------------------------------------------------------------------------
* Copyright (c) 1994-2000 Justin T. Gibbs. * Copyright (c) 1994-2000 Justin T. Gibbs.
...@@ -2486,6 +2486,11 @@ ahd_linux_dv_thread(void *data) ...@@ -2486,6 +2486,11 @@ ahd_linux_dv_thread(void *data)
printf("In DV Thread\n"); printf("In DV Thread\n");
#endif #endif
/*
* Don't care about any signals.
*/
siginitsetinv(&current->blocked, 0);
/* /*
* Complete thread creation. * Complete thread creation.
*/ */
...@@ -2495,7 +2500,11 @@ ahd_linux_dv_thread(void *data) ...@@ -2495,7 +2500,11 @@ ahd_linux_dv_thread(void *data)
unlock_kernel(); unlock_kernel();
while (1) { while (1) {
down(&ahd->platform_data->dv_sem); /*
* Use down_interruptible() rather than down() to
* avoid inclusion in the load average.
*/
down_interruptible(&ahd->platform_data->dv_sem);
/* Check to see if we've been signaled to exit */ /* Check to see if we've been signaled to exit */
ahd_lock(ahd, &s); ahd_lock(ahd, &s);
...@@ -2518,7 +2527,7 @@ ahd_linux_dv_thread(void *data) ...@@ -2518,7 +2527,7 @@ ahd_linux_dv_thread(void *data)
while (LIST_FIRST(&ahd->pending_scbs) != NULL) { while (LIST_FIRST(&ahd->pending_scbs) != NULL) {
ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_EMPTY; ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_EMPTY;
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
down(&ahd->platform_data->dv_sem); down_interruptible(&ahd->platform_data->dv_sem);
ahd_lock(ahd, &s); ahd_lock(ahd, &s);
} }
...@@ -2529,7 +2538,7 @@ ahd_linux_dv_thread(void *data) ...@@ -2529,7 +2538,7 @@ ahd_linux_dv_thread(void *data)
while (AHD_DV_SIMQ_FROZEN(ahd) == 0) { while (AHD_DV_SIMQ_FROZEN(ahd) == 0) {
ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE; ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE;
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
down(&ahd->platform_data->dv_sem); down_interruptible(&ahd->platform_data->dv_sem);
ahd_lock(ahd, &s); ahd_lock(ahd, &s);
} }
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
...@@ -2694,7 +2703,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset) ...@@ -2694,7 +2703,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
#endif #endif
down(&ahd->platform_data->dv_cmd_sem); down_interruptible(&ahd->platform_data->dv_cmd_sem);
/* /*
* Wait for the SIMQ to be released so that DV is the * Wait for the SIMQ to be released so that DV is the
* only reason the queue is frozen. * only reason the queue is frozen.
...@@ -2703,7 +2712,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset) ...@@ -2703,7 +2712,7 @@ ahd_linux_dv_target(struct ahd_softc *ahd, u_int target_offset)
while (AHD_DV_SIMQ_FROZEN(ahd) == 0) { while (AHD_DV_SIMQ_FROZEN(ahd) == 0) {
ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE; ahd->platform_data->flags |= AHD_DV_WAIT_SIMQ_RELEASE;
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
down(&ahd->platform_data->dv_sem); down_interruptible(&ahd->platform_data->dv_sem);
ahd_lock(ahd, &s); ahd_lock(ahd, &s);
} }
ahd_unlock(ahd, &s); ahd_unlock(ahd, &s);
......
/* /*
* Adaptec AIC7xxx device driver for Linux. * Adaptec AIC7xxx device driver for Linux.
* *
* $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#164 $ * $Id: //depot/aic7xxx/linux/drivers/scsi/aic7xxx/aic7xxx_osm.c#165 $
* *
* Copyright (c) 1994 John Aycock * Copyright (c) 1994 John Aycock
* The University of Calgary Department of Computer Science. * The University of Calgary Department of Computer Science.
...@@ -2338,6 +2338,11 @@ ahc_linux_dv_thread(void *data) ...@@ -2338,6 +2338,11 @@ ahc_linux_dv_thread(void *data)
printf("Launching DV Thread\n"); printf("Launching DV Thread\n");
#endif #endif
/*
* Don't care about any signals.
*/
siginitsetinv(&current->blocked, 0);
/* /*
* Complete thread creation. * Complete thread creation.
*/ */
...@@ -2347,7 +2352,11 @@ ahc_linux_dv_thread(void *data) ...@@ -2347,7 +2352,11 @@ ahc_linux_dv_thread(void *data)
unlock_kernel(); unlock_kernel();
while (1) { while (1) {
down(&ahc->platform_data->dv_sem); /*
* Use down_interruptible() rather than down() to
* avoid inclusion in the load average.
*/
down_interruptible(&ahc->platform_data->dv_sem);
/* Check to see if we've been signaled to exit */ /* Check to see if we've been signaled to exit */
ahc_lock(ahc, &s); ahc_lock(ahc, &s);
...@@ -2370,7 +2379,7 @@ ahc_linux_dv_thread(void *data) ...@@ -2370,7 +2379,7 @@ ahc_linux_dv_thread(void *data)
while (LIST_FIRST(&ahc->pending_scbs) != NULL) { while (LIST_FIRST(&ahc->pending_scbs) != NULL) {
ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_EMPTY; ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_EMPTY;
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
down(&ahc->platform_data->dv_sem); down_interruptible(&ahc->platform_data->dv_sem);
ahc_lock(ahc, &s); ahc_lock(ahc, &s);
} }
...@@ -2381,7 +2390,7 @@ ahc_linux_dv_thread(void *data) ...@@ -2381,7 +2390,7 @@ ahc_linux_dv_thread(void *data)
while (AHC_DV_SIMQ_FROZEN(ahc) == 0) { while (AHC_DV_SIMQ_FROZEN(ahc) == 0) {
ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE; ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE;
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
down(&ahc->platform_data->dv_sem); down_interruptible(&ahc->platform_data->dv_sem);
ahc_lock(ahc, &s); ahc_lock(ahc, &s);
} }
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
...@@ -2546,7 +2555,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset) ...@@ -2546,7 +2555,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
#if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0) #if LINUX_VERSION_CODE >= KERNEL_VERSION(2,5,0)
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
#endif #endif
down(&ahc->platform_data->dv_cmd_sem); down_interruptible(&ahc->platform_data->dv_cmd_sem);
/* /*
* Wait for the SIMQ to be released so that DV is the * Wait for the SIMQ to be released so that DV is the
* only reason the queue is frozen. * only reason the queue is frozen.
...@@ -2555,7 +2564,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset) ...@@ -2555,7 +2564,7 @@ ahc_linux_dv_target(struct ahc_softc *ahc, u_int target_offset)
while (AHC_DV_SIMQ_FROZEN(ahc) == 0) { while (AHC_DV_SIMQ_FROZEN(ahc) == 0) {
ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE; ahc->platform_data->flags |= AHC_DV_WAIT_SIMQ_RELEASE;
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
down(&ahc->platform_data->dv_sem); down_interruptible(&ahc->platform_data->dv_sem);
ahc_lock(ahc, &s); ahc_lock(ahc, &s);
} }
ahc_unlock(ahc, &s); ahc_unlock(ahc, &s);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment