mmc: move to a SCHED_FIFO thread

Running mmcqd as a prio 120 thread forces it to compete with standard
user processes for IO performance, especially when the system is under
severe CPU load. Move it to a SCHED_FIFO thread to reduce the impact of
load on IO performance.

bug 25392275

Change-Id: I1edfe73baa25e181367c30c1f40fee886e92b60d
This commit is contained in:
Tim Murray 2016-01-19 16:36:40 -08:00 committed by Artem Borisov
parent 0b1a428a1e
commit 0e685881bd
1 changed files with 6 additions and 0 deletions

View File

@ -18,6 +18,7 @@
#include <linux/mmc/card.h>
#include <linux/mmc/host.h>
#include <linux/sched.h>
#include "queue.h"
#define MMC_QUEUE_BOUNCESZ 65536
@ -60,6 +61,11 @@ static int mmc_queue_thread(void *d)
struct request_queue *q = mq->queue;
struct mmc_card *card = mq->card;
struct sched_param scheduler_params = {0};
scheduler_params.sched_priority = 1;
sched_setscheduler(current, SCHED_FIFO, &scheduler_params);
current->flags |= PF_MEMALLOC;
down(&mq->thread_sem);