Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1218230

[PATCHv5 2/7] slub: use page->rcu_head instead of page->lru plus cast

From "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
Newsgroups linux.kernel
Subject [PATCHv5 2/7] slub: use page->rcu_head instead of page->lru plus cast
Date 2015-09-03 14:40 +0200
Message-ID <q4BY6-3Er-31@gated-at.bofh.it> (permalink)
References <q4BY5-3Er-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


We have properly typed page->rcu_head, no need to cast page->lru.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Cc: Christoph Lameter <cl@linux.com>
---
 mm/slub.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/mm/slub.c b/mm/slub.c
index 816df0016555..869642d03b22 100644
--- a/mm/slub.c
+++ b/mm/slub.c
@@ -1510,10 +1510,7 @@ static void free_slab(struct kmem_cache *s, struct page *page)
 			VM_BUG_ON(s->reserved != sizeof(*head));
 			head = page_address(page) + offset;
 		} else {
-			/*
-			 * RCU free overloads the RCU head over the LRU
-			 */
-			head = (void *)&page->lru;
+			head = &page->rcu_head;
 		}
 
 		call_rcu(head, rcu_free_slab);
-- 
2.5.0

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCHv5 0/7] Fix compound_head() race "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-03 14:40 +0200
  [PATCHv5 6/7] mm: use 'unsigned int' for page order "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-03 14:40 +0200
  [PATCHv5 1/7] mm: drop page->slab_page "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-03 14:40 +0200
    Re: [PATCHv5 1/7] mm: drop page->slab_page Alexander Duyck <alexander.duyck@gmail.com> - 2015-09-07 07:10 +0200
  [PATCHv5 2/7] slub: use page->rcu_head instead of page->lru plus cast "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> - 2015-09-03 14:40 +0200
  Re: [PATCHv5 0/7] Fix compound_head() race Andrea Arcangeli <aarcange@redhat.com> - 2015-09-04 15:50 +0200

csiph-web