public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: William Lee Irwin III <wli@holomorphy.com>
To: Manfred Spraul <manfred@colorfullife.com>
Cc: Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@osdl.org>
Subject: Re: [PATCH, RFC] remove task_cache entirely
Date: Sun, 13 Jul 2003 05:40:46 -0700	[thread overview]
Message-ID: <20030713124046.GE15452@holomorphy.com> (raw)
In-Reply-To: <3F114935.2000409@colorfullife.com>

On Sun, Jul 13, 2003 at 01:57:41PM +0200, Manfred Spraul wrote:
> kernel/fork.c contains a disabled cache for task stuctures. task 
> structures are placed into the task cache only if "tsk==current", and 
> "tsk==current" is impossible. There is even a WARN_ON against that in 
> __put_task_struct().
> What should we do with it? I would remove it entirely - it's dead code. 
> Any objections?
> One problem is that order-1 allocations are not cached per-cpu - what 
> about using kmem_cache_alloc for the stack?

I've been slab allocating the stack on i386 for some time, and it has
gone without incident in pgcl, -wli, -mjb (?), and so on. kmalloc() is
fine; there isn't any particularly compelling reason for a dedicated
slab as there's no preconstruction to do, though it can be arranged.

Basically, it works, there's no obvious reason not to, and (even better)
it's not totally invisible to the VM and even makes overhead reportable.

akpm, this is a two line change with almost no effect apart from
theoretically improved SMP efficiency and more accurate reporting.
Shall we?

-- wli


diff -prauN mm1-2.5.75-1/include/asm-i386/thread_info.h mm1-2.5.75-stack-1/include/asm-i386/thread_info.h
--- mm1-2.5.75-1/include/asm-i386/thread_info.h	2003-07-10 13:05:26.000000000 -0700
+++ mm1-2.5.75-stack-1/include/asm-i386/thread_info.h	2003-07-13 05:35:08.000000000 -0700
@@ -87,8 +87,8 @@ static inline struct thread_info *curren
 
 /* thread information allocation */
 #define THREAD_SIZE (2*PAGE_SIZE)
-#define alloc_thread_info(tsk) ((struct thread_info *) __get_free_pages(GFP_KERNEL,1))
-#define free_thread_info(ti) free_pages((unsigned long) (ti), 1)
+#define alloc_thread_info(task) ((struct thread_info *)kmalloc(THREAD_SIZE, GFP_KERNEL))
+#define free_thread_info(info)	kfree(info)
 #define get_thread_info(ti) get_task_struct((ti)->task)
 #define put_thread_info(ti) put_task_struct((ti)->task)
 

      reply	other threads:[~2003-07-13 12:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-07-13 11:57 [PATCH, RFC] remove task_cache entirely Manfred Spraul
2003-07-13 12:40 ` William Lee Irwin III [this message]

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=20030713124046.GE15452@holomorphy.com \
    --to=wli@holomorphy.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=manfred@colorfullife.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