From 58d55d8296cf4f61f076f9133bce94e78ec2a99d Mon Sep 17 00:00:00 2001 From: haridhayal11 Date: Wed, 2 Mar 2022 05:40:52 +0000 Subject: [PATCH] block: disable I/O stats accounting by default While Android userspace (e.g. storaged) does use iostats via /proc/diskstats, init will explicitly enable iostats for the devices on which it is primarily used - sda and sdf. Avoid the 0.5-1% overhead for block devices that do not need it. Co-Authored-By: kdrag0n --- include/linux/blkdev.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0b16df9f9..fcbbe8f06 100755 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -642,9 +642,11 @@ struct request_queue { #define QUEUE_FLAG_HCTX_ACTIVE 28 /* at least one blk-mq hctx is active */ #define QUEUE_FLAG_NOWAIT 29 /* device supports NOWAIT */ -#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ - (1 << QUEUE_FLAG_SAME_COMP) | \ - (1 << QUEUE_FLAG_NOWAIT)) +#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_SAME_COMP) | \ + (1 << QUEUE_FLAG_ADD_RANDOM)) + +#define QUEUE_FLAG_MQ_DEFAULT ((1 << QUEUE_FLAG_SAME_COMP) | \ + (1 << QUEUE_FLAG_POLL)) void blk_queue_flag_set(unsigned int flag, struct request_queue *q); void blk_queue_flag_clear(unsigned int flag, struct request_queue *q);