Commit bba0b4ec authored by Linus Torvalds's avatar Linus Torvalds

Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6

* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/penberg/slab-2.6:
  mm: SLOB fix reclaim_state
  mm: SLUB fix reclaim_state
  slub: add Documentation/ABI/testing/sysfs-kernel-slab
  slub: enforce MAX_ORDER
parents 0f6f49a8 42ddc4cb
This diff is collapsed.
...@@ -60,6 +60,7 @@ ...@@ -60,6 +60,7 @@
#include <linux/kernel.h> #include <linux/kernel.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/swap.h> /* struct reclaim_state */
#include <linux/cache.h> #include <linux/cache.h>
#include <linux/init.h> #include <linux/init.h>
#include <linux/module.h> #include <linux/module.h>
...@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, int order, int node) ...@@ -255,6 +256,8 @@ static void *slob_new_pages(gfp_t gfp, int order, int node)
static void slob_free_pages(void *b, int order) static void slob_free_pages(void *b, int order)
{ {
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += 1 << order;
free_pages((unsigned long)b, order); free_pages((unsigned long)b, order);
} }
...@@ -407,7 +410,7 @@ static void slob_free(void *block, int size) ...@@ -407,7 +410,7 @@ static void slob_free(void *block, int size)
spin_unlock_irqrestore(&slob_lock, flags); spin_unlock_irqrestore(&slob_lock, flags);
clear_slob_page(sp); clear_slob_page(sp);
free_slob_page(sp); free_slob_page(sp);
free_page((unsigned long)b); slob_free_pages(b, 0);
return; return;
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
*/ */
#include <linux/mm.h> #include <linux/mm.h>
#include <linux/swap.h> /* struct reclaim_state */
#include <linux/module.h> #include <linux/module.h>
#include <linux/bit_spinlock.h> #include <linux/bit_spinlock.h>
#include <linux/interrupt.h> #include <linux/interrupt.h>
...@@ -1170,6 +1171,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page) ...@@ -1170,6 +1171,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page)
__ClearPageSlab(page); __ClearPageSlab(page);
reset_page_mapcount(page); reset_page_mapcount(page);
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += pages;
__free_pages(page, order); __free_pages(page, order);
} }
...@@ -1909,7 +1912,7 @@ static inline int calculate_order(int size) ...@@ -1909,7 +1912,7 @@ static inline int calculate_order(int size)
* Doh this slab cannot be placed using slub_max_order. * Doh this slab cannot be placed using slub_max_order.
*/ */
order = slab_order(size, 1, MAX_ORDER, 1); order = slab_order(size, 1, MAX_ORDER, 1);
if (order <= MAX_ORDER) if (order < MAX_ORDER)
return order; return order;
return -ENOSYS; return -ENOSYS;
} }
...@@ -2522,6 +2525,7 @@ __setup("slub_min_order=", setup_slub_min_order); ...@@ -2522,6 +2525,7 @@ __setup("slub_min_order=", setup_slub_min_order);
static int __init setup_slub_max_order(char *str) static int __init setup_slub_max_order(char *str)
{ {
get_option(&str, &slub_max_order); get_option(&str, &slub_max_order);
slub_max_order = min(slub_max_order, MAX_ORDER - 1);
return 1; return 1;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment