Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 83357
b: refs/heads/master
c: 9721985
h: refs/heads/master
i:
  83355: 23e2624
v: v3
  • Loading branch information
Borislav Petkov authored and Bartlomiej Zolnierkiewicz committed Feb 6, 2008
1 parent 014bed9 commit c69db11
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 21 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 54bb2074ce52fc8fce0d898b3c9921f4a951eb80
refs/heads/master: 97219851b92fd083539003bca48c379d415566ac
35 changes: 15 additions & 20 deletions trunk/drivers/ide/ide-tape.c
Original file line number Diff line number Diff line change
Expand Up @@ -809,25 +809,6 @@ static void idetape_activate_next_stage(ide_drive_t *drive)
tape->next_stage = stage->next;
}

/*
* idetape_increase_max_pipeline_stages is a part of the feedback
* loop which tries to find the optimum number of stages. In the
* feedback loop, we are starting from a minimum maximum number of
* stages, and if we sense that the pipeline is empty, we try to
* increase it, until we reach the user compile time memory limit.
*/
static void idetape_increase_max_pipeline_stages (ide_drive_t *drive)
{
idetape_tape_t *tape = drive->driver_data;
int increase = (tape->max_pipeline - tape->min_pipeline) / 10;

debug_log(DBG_PROCS, "Enter %s\n", __func__);

tape->max_stages += max(increase, 1);
tape->max_stages = max(tape->max_stages, tape->min_pipeline);
tape->max_stages = min(tape->max_stages, tape->max_pipeline);
}

/*
* idetape_kfree_stage calls kfree to completely free a stage, along with
* its related buffers.
Expand Down Expand Up @@ -976,7 +957,21 @@ static int idetape_end_request(ide_drive_t *drive, int uptodate, int nr_sects)
(void)ide_do_drive_cmd(drive, tape->active_data_rq,
ide_end);
} else if (!error) {
idetape_increase_max_pipeline_stages(drive);
/*
* This is a part of the feedback loop which tries to
* find the optimum number of stages. We are starting
* from a minimum maximum number of stages, and if we
* sense that the pipeline is empty, we try to increase
* it, until we reach the user compile time memory
* limit.
*/
int i = (tape->max_pipeline - tape->min_pipeline) / 10;

tape->max_stages += max(i, 1);
tape->max_stages = max(tape->max_stages,
tape->min_pipeline);
tape->max_stages = min(tape->max_stages,
tape->max_pipeline);
}
}
ide_end_drive_cmd(drive, 0, 0);
Expand Down

0 comments on commit c69db11

Please sign in to comment.