slab: remove useless statement for checking pfmemalloc
Linux-MTD Mailing List
linux-mtd at lists.infradead.org
Fri Nov 22 17:59:03 EST 2013
Gitweb: http://git.infradead.org/?p=mtd-2.6.git;a=commit;h=7ecccf9d1e416fe61bb1caa0a94605b522feeaf3
Commit: 7ecccf9d1e416fe61bb1caa0a94605b522feeaf3
Parent: 8456a648cf44f14365f1f44de90a3da2526a4776
Author: Joonsoo Kim <iamjoonsoo.kim at lge.com>
AuthorDate: Thu Oct 24 10:07:50 2013 +0900
Committer: Pekka Enberg <penberg at iki.fi>
CommitDate: Thu Oct 24 20:17:34 2013 +0300
slab: remove useless statement for checking pfmemalloc
Now, virt_to_page(page->s_mem) is same as the page,
because slab use this structure for management.
So remove useless statement.
Acked-by: Andi Kleen <ak at linux.intel.com>
Signed-off-by: Joonsoo Kim <iamjoonsoo.kim at lge.com>
Signed-off-by: Pekka Enberg <penberg at iki.fi>
---
mm/slab.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/mm/slab.c b/mm/slab.c
index 0e7f2e7..fbb594f 100644
--- a/mm/slab.c
+++ b/mm/slab.c
@@ -750,9 +750,7 @@ static struct array_cache *alloc_arraycache(int node, int entries,
static inline bool is_slab_pfmemalloc(struct page *page)
{
- struct page *mem_page = virt_to_page(page->s_mem);
-
- return PageSlabPfmemalloc(mem_page);
+ return PageSlabPfmemalloc(page);
}
/* Clears pfmemalloc_active if no slabs have pfmalloc set */
@@ -817,7 +815,7 @@ static void *__ac_get_obj(struct kmem_cache *cachep, struct array_cache *ac,
n = cachep->node[numa_mem_id()];
if (!list_empty(&n->slabs_free) && force_refill) {
struct page *page = virt_to_head_page(objp);
- ClearPageSlabPfmemalloc(virt_to_head_page(page->s_mem));
+ ClearPageSlabPfmemalloc(page);
clear_obj_pfmemalloc(&objp);
recheck_pfmemalloc_active(cachep, ac);
return objp;
@@ -850,8 +848,7 @@ static void *__ac_put_obj(struct kmem_cache *cachep, struct array_cache *ac,
if (unlikely(pfmemalloc_active)) {
/* Some pfmemalloc slabs exist, check if this is one */
struct page *page = virt_to_head_page(objp);
- struct page *mem_page = virt_to_head_page(page->s_mem);
- if (PageSlabPfmemalloc(mem_page))
+ if (PageSlabPfmemalloc(page))
set_obj_pfmemalloc(&objp);
}
More information about the linux-mtd-cvs
mailing list