From: Manfred Spraul <manfred@colorfullife.com>
To: akpm@digeo.com, linux-kernel@vger.kernel.org
Cc: mbligh@aracnet.com
Subject: [PATCH] patch-slab-split-04-drain
Date: Fri, 04 Oct 2002 20:07:24 +0200 [thread overview]
Message-ID: <3D9DD8DC.9040402@colorfullife.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 182 bytes --]
part 4:
- spin_lock(); within the smp_call_function callback is now permitted,
remove/cleanup the workaround.
Untested due to lack of SMP test systems, but trivial.
--
Manfred
[-- Attachment #2: patch-slab-split-04-drain --]
[-- Type: text/plain, Size: 1118 bytes --]
--- 2.5/mm/slab.c Fri Oct 4 19:05:15 2002
+++ build-2.5/mm/slab.c Fri Oct 4 19:36:13 2002
@@ -917,29 +917,19 @@
static void free_block (kmem_cache_t* cachep, void** objpp, int len);
-static void drain_cpu_caches(kmem_cache_t *cachep)
+static void do_drain(void *arg)
{
- ccupdate_struct_t new;
- int i;
-
- memset(&new.new,0,sizeof(new.new));
-
- new.cachep = cachep;
+ kmem_cache_t *cachep = (kmem_cache_t*)arg;
+ cpucache_t *cc;
- down(&cache_chain_sem);
- smp_call_function_all_cpus(do_ccupdate_local, (void *)&new);
+ cc = cc_data(cachep);
+ free_block(cachep, &cc_entry(cc)[0], cc->avail);
+ cc->avail = 0;
+}
- for (i = 0; i < NR_CPUS; i++) {
- cpucache_t* ccold = new.new[i];
- if (!ccold || (ccold->avail == 0))
- continue;
- local_irq_disable();
- free_block(cachep, cc_entry(ccold), ccold->avail);
- local_irq_enable();
- ccold->avail = 0;
- }
- smp_call_function_all_cpus(do_ccupdate_local, (void *)&new);
- up(&cache_chain_sem);
+static void drain_cpu_caches(kmem_cache_t *cachep)
+{
+ smp_call_function_all_cpus(do_drain, cachep);
}
static int __cache_shrink(kmem_cache_t *cachep)
reply other threads:[~2002-10-04 18:02 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=3D9DD8DC.9040402@colorfullife.com \
--to=manfred@colorfullife.com \
--cc=akpm@digeo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mbligh@aracnet.com \
/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