Skip to content

Commit

Permalink
mm/slub.c: replace cpu_slab->partial with wrapped APIs
Browse files Browse the repository at this point in the history
There are slub_percpu_partial() and slub_set_percpu_partial() APIs to wrap
kmem_cache->cpu_partial.  This patch will use the two to replace
cpu_slab->partial in slub code.

Signed-off-by: chenqiwu <chenqiwu@xiaomi.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Reviewed-by: Andrew Morton <akpm@linux-foundation.org>
Cc: Christoph Lameter <cl@linux.com>
Cc: Pekka Enberg <penberg@kernel.org>
Cc: David Rientjes <rientjes@google.com>
Cc: Joonsoo Kim <iamjoonsoo.kim@lge.com>
Link: http://lkml.kernel.org/r/1581951895-3038-1-git-send-email-qiwuchen55@gmail.com
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
  • Loading branch information
qiwuchen authored and torvalds committed Apr 2, 2020
1 parent c537338 commit 4c7ba22
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -2205,11 +2205,11 @@ static void unfreeze_partials(struct kmem_cache *s,
struct kmem_cache_node *n = NULL, *n2 = NULL;
struct page *page, *discard_page = NULL;

while ((page = c->partial)) {
while ((page = slub_percpu_partial(c))) {
struct page new;
struct page old;

c->partial = page->next;
slub_set_percpu_partial(c, page);

n2 = get_node(s, page_to_nid(page));
if (n != n2) {
Expand Down

0 comments on commit 4c7ba22

Please sign in to comment.