lkml.org 
[lkml]   [2012]   [May]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v2 14/16] mmc: block: Implement HPI invocation and handling logic.
From

> +static bool mmc_can_do_foreground_hpi(struct mmc_queue *mq,
> + struct request *req, unsigned int thpi)
> +{
> +
> + /*
> + * If some time has elapsed since the issuing of previous write
> + * command, or if the size of the request was too small, there's
> + * no point in preempting it. Check if it's worthwhile to preempt
> + */
> + int time_elapsed = jiffies_to_msecs(jiffies -
> + mq->mqrq_cur->mmc_active.mrq->cmd->started_time);
> +
> + if (time_elapsed <= thpi)
> + return true;
Some host controllers (or DMA) has possibility to get the byte count of
current transaction. It may be implemented as host api (similar to abort
ops). Then you have more accurate estimation of worthiness.

> +
> + return false;
> +}

Thanks, Kostya



\
 
 \ /
  Last update: 2012-05-09 11:02    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog