We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 58bf21b commit ae18a7eCopy full SHA for ae18a7e
drivers/md/dm-bufio.c
@@ -68,6 +68,8 @@
68
#define LIST_DIRTY 1
69
#define LIST_SIZE 2
70
71
+#define SCAN_RESCHED_CYCLE 16
72
+
73
/*--------------------------------------------------------------*/
74
75
/*
@@ -2426,7 +2428,12 @@ static void __scan(struct dm_bufio_client *c)
2426
2428
2427
2429
atomic_long_dec(&c->need_shrink);
2430
freed++;
- cond_resched();
2431
2432
+ if (unlikely(freed % SCAN_RESCHED_CYCLE == 0)) {
2433
+ dm_bufio_unlock(c);
2434
+ cond_resched();
2435
+ dm_bufio_lock(c);
2436
+ }
2437
}
2438
2439
0 commit comments