From: jeremy@goop.org
To: akpm@osdl.org
Cc: linux-kernel@vger.kernel.org,
Chuck Ebbert <76306.1226@compuserve.com>,
Zachary Amsden <zach@vmware.com>,
Jan Beulich <jbeulich@novell.com>, Andi Kleen <ak@suse.de>
Subject: [PATCH 6/6] Implement "current" with the PDA.
Date: Mon, 25 Sep 2006 11:45:46 -0700 [thread overview]
Message-ID: <20060925184639.290985244@goop.org> (raw)
In-Reply-To: <20060925184540.601971833@goop.org>
[-- Attachment #1: pda/i386-pda-current.patch --]
[-- Type: text/plain, Size: 1040 bytes --]
Use the pcurrent field in the PDA to implement the "current" macro.
This ends up compiling down to a single instruction to get the current
task.
Signed-off-by: Jeremy Fitzhardinge <jeremy@xensource.com>
Cc: Chuck Ebbert <76306.1226@compuserve.com>
Cc: Zachary Amsden <zach@vmware.com>
Cc: Jan Beulich <jbeulich@novell.com>
Cc: Andi Kleen <ak@suse.de>
---
include/asm-i386/current.h | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff -r 3752f3a5974a include/asm-i386/current.h
--- a/include/asm-i386/current.h Mon Sep 25 01:48:09 2006 -0700
+++ b/include/asm-i386/current.h Mon Sep 25 01:48:09 2006 -0700
@@ -1,13 +1,14 @@
#ifndef _I386_CURRENT_H
#define _I386_CURRENT_H
-#include <linux/thread_info.h>
+#include <asm/pda.h>
+#include <linux/compiler.h>
struct task_struct;
-static __always_inline struct task_struct * get_current(void)
+static __always_inline struct task_struct *get_current(void)
{
- return current_thread_info()->task;
+ return read_pda(pcurrent);
}
#define current get_current()
--
next prev parent reply other threads:[~2006-09-25 20:14 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-09-25 18:45 [PATCH 0/6] Per-processor private data areas for i386 jeremy
2006-09-25 18:45 ` [PATCH 1/6] Initialize the per-CPU data area jeremy
2006-09-25 20:49 ` Andi Kleen
2006-09-25 20:59 ` Jeremy Fitzhardinge
2006-09-25 21:05 ` Andi Kleen
2006-09-25 21:33 ` Jeremy Fitzhardinge
2006-09-25 18:45 ` [PATCH 2/6] Use %gs as the PDA base-segment in the kernel jeremy
2006-09-25 18:45 ` [PATCH 3/6] Fix places where using %gs changes the usermode ABI jeremy
2006-09-25 18:45 ` [PATCH 4/6] Update sys_vm86 to cope with changed pt_regs and %gs usage jeremy
2006-09-25 18:45 ` [PATCH 5/6] Implement smp_processor_id() with the PDA jeremy
2006-09-25 18:45 ` jeremy [this message]
2006-09-27 19:46 ` [PATCH 0/6] Per-processor private data areas for i386 Pavel Machek
2006-09-27 20:28 ` Jeremy Fitzhardinge
2006-09-27 20:28 ` Jeremy Fitzhardinge
2006-09-29 0:22 ` Rusty Russell
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=20060925184639.290985244@goop.org \
--to=jeremy@goop.org \
--cc=76306.1226@compuserve.com \
--cc=ak@suse.de \
--cc=akpm@osdl.org \
--cc=jbeulich@novell.com \
--cc=linux-kernel@vger.kernel.org \
--cc=zach@vmware.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
all inboxes | Powered by JetHome®