Skip to content

Commit

Permalink
Merge branches 'topic/documentation', 'topic/slub/fixes' and 'topic/u…
Browse files Browse the repository at this point in the history
…rgent' into for-linus
  • Loading branch information
Pekka Enberg committed May 6, 2009
3 parents 51e95be + 818cf59 + 1f0532e commit 42ddc4c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
5 changes: 4 additions & 1 deletion mm/slob.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@
#include <linux/kernel.h>
#include <linux/slab.h>
#include <linux/mm.h>
#include <linux/swap.h> /* struct reclaim_state */
#include <linux/cache.h>
#include <linux/init.h>
#include <linux/module.h>
Expand Down Expand Up @@ -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)
{
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += 1 << order;
free_pages((unsigned long)b, order);
}

Expand Down Expand Up @@ -407,7 +410,7 @@ static void slob_free(void *block, int size)
spin_unlock_irqrestore(&slob_lock, flags);
clear_slob_page(sp);
free_slob_page(sp);
free_page((unsigned long)b);
slob_free_pages(b, 0);
return;
}

Expand Down
6 changes: 5 additions & 1 deletion mm/slub.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
*/

#include <linux/mm.h>
#include <linux/swap.h> /* struct reclaim_state */
#include <linux/module.h>
#include <linux/bit_spinlock.h>
#include <linux/interrupt.h>
Expand Down Expand Up @@ -1170,6 +1171,8 @@ static void __free_slab(struct kmem_cache *s, struct page *page)

__ClearPageSlab(page);
reset_page_mapcount(page);
if (current->reclaim_state)
current->reclaim_state->reclaimed_slab += pages;
__free_pages(page, order);
}

Expand Down Expand Up @@ -1909,7 +1912,7 @@ static inline int calculate_order(int size)
* Doh this slab cannot be placed using slub_max_order.
*/
order = slab_order(size, 1, MAX_ORDER, 1);
if (order <= MAX_ORDER)
if (order < MAX_ORDER)
return order;
return -ENOSYS;
}
Expand Down Expand Up @@ -2522,6 +2525,7 @@ __setup("slub_min_order=", setup_slub_min_order);
static int __init setup_slub_max_order(char *str)
{
get_option(&str, &slub_max_order);
slub_max_order = min(slub_max_order, MAX_ORDER - 1);

return 1;
}
Expand Down

0 comments on commit 42ddc4c

Please sign in to comment.