]> git.baikalelectronics.ru Git - kernel.git/commit
cachefiles: make on-demand request distribution fairer
authorXin Yin <yinxin.x@bytedance.com>
Thu, 25 Aug 2022 02:09:45 +0000 (10:09 +0800)
committerDavid Howells <dhowells@redhat.com>
Wed, 31 Aug 2022 15:41:10 +0000 (16:41 +0100)
commit3e9c183cf54284a9913759cf373809bc36b08c79
treeb16e334d8a58b34ef5fbac792f8420f788c731a3
parent9e86263feb045157d54569170955ee2fa7d9fe3d
cachefiles: make on-demand request distribution fairer

For now, enqueuing and dequeuing on-demand requests all start from
idx 0, this makes request distribution unfair. In the weighty
concurrent I/O scenario, the request stored in higher idx will starve.

Searching requests cyclically in cachefiles_ondemand_daemon_read,
makes distribution fairer.

Fixes: d270bd9fd71b ("cachefiles: notify the user daemon when looking up cookie")
Reported-by: Yongqing Li <liyongqing@bytedance.com>
Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Signed-off-by: David Howells <dhowells@redhat.com>
Reviewed-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Gao Xiang <hsiangkao@linux.alibaba.com>
Link: https://lore.kernel.org/r/20220817065200.11543-1-yinxin.x@bytedance.com/
Link: https://lore.kernel.org/r/20220825020945.2293-1-yinxin.x@bytedance.com/
fs/cachefiles/internal.h
fs/cachefiles/ondemand.c