From: Christoph Lameter <clameter@sgi.com>
To: linux-kernel@vger.kernel.org
Cc: Pekka Enberg <penberg@cs.helsinki.fi>,
Marcelo Tosatti <marcelo@kvack.org>,
"Paul E. McKenney" <paulmck@us.ibm.com>,
Nick Piggin <nickpiggin@yahoo.com.au>,
Christoph Lameter <clameter@sgi.com>,
Theodore Tso <tytso@mit.edu>, Dave Chinner <dgc@sgi.com>,
Andi Kleen <ak@suse.de>
Subject: [RFC 3/4] Add checks to current destructor uses
Date: Mon, 19 Jun 2006 11:47:07 -0700 (PDT) [thread overview]
Message-ID: <20060619184707.23130.81359.sendpatchset@schroedinger.engr.sgi.com> (raw)
In-Reply-To: <20060619184651.23130.62875.sendpatchset@schroedinger.engr.sgi.com>
slab: Add checks to current destructor uses
We will be adding new destructor options soon. So insure that all
existing destructors only react to SLAB_DTOR_DESTROY.
Signed-off-by: Christoph Lameter <clameter@sgi.com>
Index: linux-2.6.17-rc6-mm2/arch/i386/mm/pgtable.c
===================================================================
--- linux-2.6.17-rc6-mm2.orig/arch/i386/mm/pgtable.c 2006-06-16 11:48:44.229756909 -0700
+++ linux-2.6.17-rc6-mm2/arch/i386/mm/pgtable.c 2006-06-19 10:02:05.008801502 -0700
@@ -224,15 +224,19 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
}
/* never called when PTRS_PER_PMD > 1 */
-void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long unused)
+void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long slab_flags)
{
unsigned long flags; /* can be called from interrupt context */
+ if (!(slab_flags & SLAB_DTOR_DESTROY))
+ return;
+
spin_lock_irqsave(&pgd_lock, flags);
pgd_list_del(pgd);
spin_unlock_irqrestore(&pgd_lock, flags);
}
+
pgd_t *pgd_alloc(struct mm_struct *mm)
{
int i;
Index: linux-2.6.17-rc6-mm2/include/linux/slab.h
===================================================================
--- linux-2.6.17-rc6-mm2.orig/include/linux/slab.h 2006-06-16 11:48:52.272227349 -0700
+++ linux-2.6.17-rc6-mm2/include/linux/slab.h 2006-06-19 10:00:33.951924377 -0700
@@ -52,6 +52,9 @@ typedef struct kmem_cache kmem_cache_t;
#define SLAB_CTOR_ATOMIC 0x002UL /* tell constructor it can't sleep */
#define SLAB_CTOR_VERIFY 0x004UL /* tell constructor it's a verify call */
+/* flags passed to a constructor func */
+#define SLAB_DTOR_DESTROY 0x1000UL /* Called during slab destruction */
+
#ifndef CONFIG_SLOB
/* prototypes */
Index: linux-2.6.17-rc6-mm2/arch/frv/mm/pgalloc.c
===================================================================
--- linux-2.6.17-rc6-mm2.orig/arch/frv/mm/pgalloc.c 2006-06-05 17:57:02.000000000 -0700
+++ linux-2.6.17-rc6-mm2/arch/frv/mm/pgalloc.c 2006-06-19 10:03:11.301582635 -0700
@@ -120,10 +120,13 @@ void pgd_ctor(void *pgd, kmem_cache_t *c
}
/* never called when PTRS_PER_PMD > 1 */
-void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long unused)
+void pgd_dtor(void *pgd, kmem_cache_t *cache, unsigned long slab_flags)
{
unsigned long flags; /* can be called from interrupt context */
+ if (!(slab_flags & SLAB_DTOR_DESTROY))
+ return;
+
spin_lock_irqsave(&pgd_lock, flags);
pgd_list_del(pgd);
spin_unlock_irqrestore(&pgd_lock, flags);
next prev parent reply other threads:[~2006-06-19 18:47 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-19 18:46 [RFC 0/4] Object reclaim via the slab allocator V1 Christoph Lameter
2006-06-19 18:46 ` [RFC 1/4] slab freeing consolidation Christoph Lameter
2006-06-22 19:18 ` Pekka J Enberg
2006-06-22 19:38 ` Christoph Lameter
2006-06-19 18:47 ` [RFC 2/4] Remove empty destructor from drivers/usb/mon/mon_text.c Christoph Lameter
2006-06-22 19:22 ` Pekka J Enberg
2006-06-19 18:47 ` Christoph Lameter [this message]
2006-06-22 19:24 ` [RFC 3/4] Add checks to current destructor uses Pekka J Enberg
2006-06-22 19:40 ` Christoph Lameter
2006-06-19 18:47 ` [PATCH 4/4] Slab Reclaim logic Christoph Lameter
2006-06-19 18:53 ` Christoph Lameter
2006-06-22 19:34 ` Pekka J Enberg
2006-06-22 19:42 ` Christoph Lameter
2006-06-22 19:46 ` Pekka J Enberg
2006-06-22 19:49 ` Christoph Lameter
2006-06-22 19:41 ` Pekka J Enberg
2006-06-22 19:44 ` Christoph Lameter
2006-06-22 19:46 ` Pekka J Enberg
2006-06-22 19:49 ` Pekka J Enberg
2006-06-22 19:52 ` Christoph Lameter
2006-06-19 20:50 ` [RFC 0/4] Object reclaim via the slab allocator V1 Andi Kleen
2006-06-29 0:43 ` Andrew Morton
2006-06-29 0:47 ` Christoph Lameter
2006-06-29 3:09 ` Andrew Morton
2006-06-29 17:20 ` Christoph Lameter
2006-07-03 0:44 ` Marcelo Tosatti
2006-07-03 18:10 ` Christoph Lameter
2006-07-03 23:11 ` Marcelo Tosatti
2006-07-04 1:46 ` Christoph Lameter
2006-07-04 2:07 ` Marcelo Tosatti
2006-07-04 2:37 ` Christoph Lameter
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20060619184707.23130.81359.sendpatchset@schroedinger.engr.sgi.com \
--to=clameter@sgi.com \
--cc=ak@suse.de \
--cc=dgc@sgi.com \
--cc=linux-kernel@vger.kernel.org \
--cc=marcelo@kvack.org \
--cc=nickpiggin@yahoo.com.au \
--cc=paulmck@us.ibm.com \
--cc=penberg@cs.helsinki.fi \
--cc=tytso@mit.edu \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Powered by JetHome