mirror of
https://gitee.com/bianbu-linux/linux-6.6
synced 2025-04-26 14:17:26 -04:00
block: change the request allocation/congestion logic to be sync/async based
This makes sure that we never wait on async IO for sync requests, instead of doing the split on writes vs reads. Signed-off-by: Jens Axboe <jens.axboe@oracle.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
This commit is contained in:
parent
0221c81b1b
commit
1faa16d228
6 changed files with 100 additions and 82 deletions
|
@ -24,8 +24,8 @@ struct dentry;
|
|||
*/
|
||||
enum bdi_state {
|
||||
BDI_pdflush, /* A pdflush thread is working this device */
|
||||
BDI_write_congested, /* The write queue is getting full */
|
||||
BDI_read_congested, /* The read queue is getting full */
|
||||
BDI_async_congested, /* The async (write) queue is getting full */
|
||||
BDI_sync_congested, /* The sync queue is getting full */
|
||||
BDI_unused, /* Available bits start here */
|
||||
};
|
||||
|
||||
|
@ -215,18 +215,18 @@ static inline int bdi_congested(struct backing_dev_info *bdi, int bdi_bits)
|
|||
|
||||
static inline int bdi_read_congested(struct backing_dev_info *bdi)
|
||||
{
|
||||
return bdi_congested(bdi, 1 << BDI_read_congested);
|
||||
return bdi_congested(bdi, 1 << BDI_sync_congested);
|
||||
}
|
||||
|
||||
static inline int bdi_write_congested(struct backing_dev_info *bdi)
|
||||
{
|
||||
return bdi_congested(bdi, 1 << BDI_write_congested);
|
||||
return bdi_congested(bdi, 1 << BDI_async_congested);
|
||||
}
|
||||
|
||||
static inline int bdi_rw_congested(struct backing_dev_info *bdi)
|
||||
{
|
||||
return bdi_congested(bdi, (1 << BDI_read_congested)|
|
||||
(1 << BDI_write_congested));
|
||||
return bdi_congested(bdi, (1 << BDI_sync_congested) |
|
||||
(1 << BDI_async_congested));
|
||||
}
|
||||
|
||||
void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue