File tree Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Expand file tree Collapse file tree 1 file changed +8
-7
lines changed Original file line number Diff line number Diff line change @@ -3465,12 +3465,7 @@ static unsigned long deferred_split_count(struct shrinker *shrink,
3465
3465
struct shrink_control * sc )
3466
3466
{
3467
3467
struct pglist_data * pgdata = NODE_DATA (sc -> nid );
3468
- /*
3469
- * Split a page from split_queue will free up at least one page,
3470
- * at most HPAGE_PMD_NR - 1. We don't track exact number.
3471
- * Let's use HPAGE_PMD_NR / 2 as ballpark.
3472
- */
3473
- return ACCESS_ONCE (pgdata -> split_queue_len ) * HPAGE_PMD_NR / 2 ;
3468
+ return ACCESS_ONCE (pgdata -> split_queue_len );
3474
3469
}
3475
3470
3476
3471
static unsigned long deferred_split_scan (struct shrinker * shrink ,
@@ -3511,7 +3506,13 @@ static unsigned long deferred_split_scan(struct shrinker *shrink,
3511
3506
list_splice_tail (& list , & pgdata -> split_queue );
3512
3507
spin_unlock_irqrestore (& pgdata -> split_queue_lock , flags );
3513
3508
3514
- return split * HPAGE_PMD_NR / 2 ;
3509
+ /*
3510
+ * Stop shrinker if we didn't split any page, but the queue is empty.
3511
+ * This can happen if pages were freed under us.
3512
+ */
3513
+ if (!split && list_empty (& pgdata -> split_queue ))
3514
+ return SHRINK_STOP ;
3515
+ return split ;
3515
3516
}
3516
3517
3517
3518
static struct shrinker deferred_split_shrinker = {
You can’t perform that action at this time.
0 commit comments