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 08424a0 commit c8c8305Copy full SHA for c8c8305
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
/*
@@ -2387,7 +2389,12 @@ static void __scan(struct dm_bufio_client *c)
2387
2389
2388
2390
atomic_long_dec(&c->need_shrink);
2391
freed++;
- cond_resched();
2392
2393
+ if (unlikely(freed % SCAN_RESCHED_CYCLE == 0)) {
2394
+ dm_bufio_unlock(c);
2395
+ cond_resched();
2396
+ dm_bufio_lock(c);
2397
+ }
2398
}
2399
2400
0 commit comments