Skip to content

Commit

Permalink
Revert "mm: micro-optimise slab to avoid a function call"
Browse files Browse the repository at this point in the history
This reverts commit 381760eadc393bcb1bb328510ad75cf13431806d.
  • Loading branch information
faux123 committed Oct 21, 2013
1 parent 2dfac21 commit d36f50b
Showing 1 changed file with 2 additions and 26 deletions.
28 changes: 2 additions & 26 deletions mm/slab.c
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,6 @@
#include <linux/memory.h>
#include <linux/prefetch.h>

#include <net/sock.h>

#include <asm/cacheflush.h>
#include <asm/tlbflush.h>
#include <asm/page.h>
Expand Down Expand Up @@ -963,7 +961,7 @@ static void recheck_pfmemalloc_active(struct kmem_cache *cachep,
spin_unlock_irqrestore(&l3->list_lock, flags);
}

static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
static void *ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
gfp_t flags, bool force_refill)
{
int i;
Expand Down Expand Up @@ -1010,20 +1008,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
return objp;
}

static inline void *ac_get_obj(struct kmem_cache *cachep,
struct array_cache *ac, gfp_t flags, bool force_refill)
{
void *objp;

if (unlikely(sk_memalloc_socks()))
objp = __ac_get_obj(cachep, ac, flags, force_refill);
else
objp = ac->entry[--ac->avail];

return objp;
}

static void *__ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
static void ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
void *objp)
{
if (unlikely(pfmemalloc_active)) {
Expand All @@ -1033,15 +1018,6 @@ static void *__ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
set_obj_pfmemalloc(&objp);
}

return objp;
}

static inline void ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
void *objp)
{
if (unlikely(sk_memalloc_socks()))
objp = __ac_put_obj(cachep, ac, objp);

ac->entry[ac->avail++] = objp;
}

Expand Down

0 comments on commit d36f50b

Please sign in to comment.