diff options
Diffstat (limited to 'mm')
-rw-r--r-- | mm/slub.c | 16 |
1 files changed, 12 insertions, 4 deletions
@@ -1862,7 +1862,7 @@ static void unfreeze_partials(struct kmem_cache *s) | |||
1862 | { | 1862 | { |
1863 | struct kmem_cache_node *n = NULL; | 1863 | struct kmem_cache_node *n = NULL; |
1864 | struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab); | 1864 | struct kmem_cache_cpu *c = this_cpu_ptr(s->cpu_slab); |
1865 | struct page *page; | 1865 | struct page *page, *discard_page = NULL; |
1866 | 1866 | ||
1867 | while ((page = c->partial)) { | 1867 | while ((page = c->partial)) { |
1868 | enum slab_modes { M_PARTIAL, M_FREE }; | 1868 | enum slab_modes { M_PARTIAL, M_FREE }; |
@@ -1916,14 +1916,22 @@ static void unfreeze_partials(struct kmem_cache *s) | |||
1916 | "unfreezing slab")); | 1916 | "unfreezing slab")); |
1917 | 1917 | ||
1918 | if (m == M_FREE) { | 1918 | if (m == M_FREE) { |
1919 | stat(s, DEACTIVATE_EMPTY); | 1919 | page->next = discard_page; |
1920 | discard_slab(s, page); | 1920 | discard_page = page; |
1921 | stat(s, FREE_SLAB); | ||
1922 | } | 1921 | } |
1923 | } | 1922 | } |
1924 | 1923 | ||
1925 | if (n) | 1924 | if (n) |
1926 | spin_unlock(&n->list_lock); | 1925 | spin_unlock(&n->list_lock); |
1926 | |||
1927 | while (discard_page) { | ||
1928 | page = discard_page; | ||
1929 | discard_page = discard_page->next; | ||
1930 | |||
1931 | stat(s, DEACTIVATE_EMPTY); | ||
1932 | discard_slab(s, page); | ||
1933 | stat(s, FREE_SLAB); | ||
1934 | } | ||
1927 | } | 1935 | } |
1928 | 1936 | ||
1929 | /* | 1937 | /* |