We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 7bd47be commit a3d8f0aCopy full SHA for a3d8f0a
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
/*
@@ -2424,7 +2426,12 @@ static void __scan(struct dm_bufio_client *c)
2424
2426
2425
2427
atomic_long_dec(&c->need_shrink);
2428
freed++;
- cond_resched();
2429
2430
+ if (unlikely(freed % SCAN_RESCHED_CYCLE == 0)) {
2431
+ dm_bufio_unlock(c);
2432
+ cond_resched();
2433
+ dm_bufio_lock(c);
2434
+ }
2435
}
2436
2437
0 commit comments