Skip to content

Commit

Permalink
sched,crypto: Convert to sched_set_fifo*()
Browse files Browse the repository at this point in the history
Because SCHED_FIFO is a broken scheduler model (see previous patches)
take away the priority field, the kernel can't possibly make an
informed decision.

Use sched_set_fifo() to request SCHED_FIFO and delegate
actual priority selection to userspace. Effectively no change in
behaviour.

Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Reviewed-by: Ingo Molnar <[email protected]>
Acked-by: Herbert Xu <[email protected]>
  • Loading branch information
Peter Zijlstra committed Jun 15, 2020
1 parent 0030c1d commit dbc6d0d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions crypto/crypto_engine.c
Original file line number Diff line number Diff line change
Expand Up @@ -482,7 +482,6 @@ struct crypto_engine *crypto_engine_alloc_init_and_set(struct device *dev,
int (*cbk_do_batch)(struct crypto_engine *engine),
bool rt, int qlen)
{
struct sched_param param = { .sched_priority = MAX_RT_PRIO / 2 };
struct crypto_engine *engine;

if (!dev)
Expand Down Expand Up @@ -520,7 +519,7 @@ struct crypto_engine *crypto_engine_alloc_init_and_set(struct device *dev,

if (engine->rt) {
dev_info(dev, "will run requests pump with realtime priority\n");
sched_setscheduler(engine->kworker->task, SCHED_FIFO, &param);
sched_set_fifo(engine->kworker->task);
}

return engine;
Expand Down

0 comments on commit dbc6d0d

Please sign in to comment.