@@ -173,10 +173,10 @@ struct list_head *pcpu_chunk_lists __ro_after_init; /* chunk list slots */
173
173
static LIST_HEAD (pcpu_map_extend_chunks );
174
174
175
175
/*
176
- * The number of empty populated pages, protected by pcpu_lock. The
177
- * reserved chunk doesn't contribute to the count.
176
+ * The number of empty populated pages by chunk type , protected by pcpu_lock.
177
+ * The reserved chunk doesn't contribute to the count.
178
178
*/
179
- int pcpu_nr_empty_pop_pages ;
179
+ int pcpu_nr_empty_pop_pages [ PCPU_NR_CHUNK_TYPES ] ;
180
180
181
181
/*
182
182
* The number of populated pages in use by the allocator, protected by
@@ -556,7 +556,7 @@ static inline void pcpu_update_empty_pages(struct pcpu_chunk *chunk, int nr)
556
556
{
557
557
chunk -> nr_empty_pop_pages += nr ;
558
558
if (chunk != pcpu_reserved_chunk )
559
- pcpu_nr_empty_pop_pages += nr ;
559
+ pcpu_nr_empty_pop_pages [ pcpu_chunk_type ( chunk )] += nr ;
560
560
}
561
561
562
562
/*
@@ -1832,7 +1832,7 @@ static void __percpu *pcpu_alloc(size_t size, size_t align, bool reserved,
1832
1832
mutex_unlock (& pcpu_alloc_mutex );
1833
1833
}
1834
1834
1835
- if (pcpu_nr_empty_pop_pages < PCPU_EMPTY_POP_PAGES_LOW )
1835
+ if (pcpu_nr_empty_pop_pages [ type ] < PCPU_EMPTY_POP_PAGES_LOW )
1836
1836
pcpu_schedule_balance_work ();
1837
1837
1838
1838
/* clear the areas and return address relative to base address */
@@ -2000,7 +2000,7 @@ static void __pcpu_balance_workfn(enum pcpu_chunk_type type)
2000
2000
pcpu_atomic_alloc_failed = false;
2001
2001
} else {
2002
2002
nr_to_pop = clamp (PCPU_EMPTY_POP_PAGES_HIGH -
2003
- pcpu_nr_empty_pop_pages ,
2003
+ pcpu_nr_empty_pop_pages [ type ] ,
2004
2004
0 , PCPU_EMPTY_POP_PAGES_HIGH );
2005
2005
}
2006
2006
@@ -2580,7 +2580,7 @@ void __init pcpu_setup_first_chunk(const struct pcpu_alloc_info *ai,
2580
2580
2581
2581
/* link the first chunk in */
2582
2582
pcpu_first_chunk = chunk ;
2583
- pcpu_nr_empty_pop_pages = pcpu_first_chunk -> nr_empty_pop_pages ;
2583
+ pcpu_nr_empty_pop_pages [ PCPU_CHUNK_ROOT ] = pcpu_first_chunk -> nr_empty_pop_pages ;
2584
2584
pcpu_chunk_relocate (pcpu_first_chunk , -1 );
2585
2585
2586
2586
/* include all regions of the first chunk */
0 commit comments