From: William Lee Irwin III <wli@holomorphy.com>
To: Andrew Morton <akpm@osdl.org>
Cc: Nick Sanders <sandersn@btinternet.com>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.9-rc3-mm3
Date: Thu, 7 Oct 2004 04:40:40 -0700 [thread overview]
Message-ID: <20041007114040.GV9106@holomorphy.com> (raw)
In-Reply-To: <20041007025007.77ec1a44.akpm@osdl.org>
Nick Sanders <sandersn@btinternet.com> wrote:
>> I get the following oops when booting and it also stops kde
>> (artswrapper) from starting with the same call trace. USB seems to
>> be working which is good.
On Thu, Oct 07, 2004 at 02:50:07AM -0700, Andrew Morton wrote:
> Could you please do
> cd /usr/src/linux
> wget ftp://ftp.kernel.org/pub/linux/kernel/people/akpm/patches/2.6/2.6.9-rc3/2.6.9-rc3-mm3/broken-out/optimize-profile-path-slightly.patch
> patch -R -p1 < optimize-profile-path-slightly.patch
> and retest?
Here is a more likely correct patch for what that was trying to do,
however misguided that may be. Untested, uncompiled, vs. 2.6.9-rc3-mm3
without the bad patch:
Expose some variables from kernel/profile.c to the world to short-
circuit some checks in some inline wrappers for the purportedly
``heavier'' profiling functions. I took the liberty of declaring
some variables extern in the bodies of the inlines, which is rare
in the kernel, but protects against the use of the now-exposed
variables by things that shouldn't touch them.
Signed-off-by: William Irwin <wli@holomorphy.com>
Index: mm3-2.6.9-rc3/kernel/profile.c
===================================================================
--- mm3-2.6.9-rc3.orig/kernel/profile.c 2004-10-07 04:07:13.019223245 -0700
+++ mm3-2.6.9-rc3/kernel/profile.c 2004-10-07 04:38:08.299177821 -0700
@@ -34,10 +34,10 @@
#define NR_PROFILE_HIT (PAGE_SIZE/sizeof(struct profile_hit))
#define NR_PROFILE_GRP (NR_PROFILE_HIT/PROFILE_GRPSZ)
-static atomic_t *prof_buffer;
+atomic_t *prof_buffer;
static unsigned long prof_len, prof_shift;
-static int prof_on;
-static cpumask_t prof_cpu_mask = CPU_MASK_ALL;
+int prof_on;
+cpumask_t prof_cpu_mask = CPU_MASK_ALL;
#ifdef CONFIG_SMP
static DEFINE_PER_CPU(struct profile_hit *[2], cpu_profile_hits);
static DEFINE_PER_CPU(int, cpu_profile_flip);
@@ -284,14 +284,12 @@
up(&profile_flip_mutex);
}
-void profile_hit(int type, void *__pc)
+void fastcall __profile_hit(void *__pc)
{
unsigned long primary, secondary, flags, pc = (unsigned long)__pc;
int i, j, cpu;
struct profile_hit *hits;
- if (prof_on != type || !prof_buffer)
- return;
pc = min((pc - (unsigned long)_stext) >> prof_shift, prof_len - 1);
i = primary = (pc & (NR_PROFILE_GRP - 1)) << PROFILE_GRPSHIFT;
secondary = (~(pc << 1) & (NR_PROFILE_GRP - 1)) << PROFILE_GRPSHIFT;
@@ -392,14 +390,6 @@
}
#endif /* !CONFIG_SMP */
-void profile_tick(int type, struct pt_regs *regs)
-{
- if (type == CPU_PROFILING)
- profile_hook(regs);
- if (!user_mode(regs) && cpu_isset(smp_processor_id(), prof_cpu_mask))
- profile_hit(type, (void *)profile_pc(regs));
-}
-
#ifdef CONFIG_PROC_FS
#include <linux/proc_fs.h>
#include <asm/uaccess.h>
Index: mm3-2.6.9-rc3/include/linux/profile.h
===================================================================
--- mm3-2.6.9-rc3.orig/include/linux/profile.h 2004-10-07 04:03:39.960613077 -0700
+++ mm3-2.6.9-rc3/include/linux/profile.h 2004-10-07 04:28:46.333609573 -0700
@@ -8,6 +8,7 @@
#include <linux/init.h>
#include <linux/cpumask.h>
#include <asm/errno.h>
+#include <asm/atomic.h>
#define CPU_PROFILING 1
#define SCHED_PROFILING 2
@@ -17,8 +18,8 @@
/* init basic kernel profiler */
void __init profile_init(void);
-void profile_tick(int, struct pt_regs *);
-void profile_hit(int, void *);
+void FASTCALL(__profile_hit(void *));
+
#ifdef CONFIG_PROC_FS
void create_prof_cpu_mask(struct proc_dir_entry *);
#else
@@ -101,6 +102,26 @@
#endif /* CONFIG_PROFILING */
+static inline void profile_hit(int type, void *pc)
+{
+ extern int prof_on;
+ extern atomic_t *prof_buffer;
+
+ if (prof_on == type && prof_buffer)
+ __profile_hit(pc);
+}
+
+static inline void profile_tick(int type, struct pt_regs *regs)
+{
+ extern cpumask_t prof_cpu_mask;
+
+ if (type != CPU_PROFILING)
+ return;
+ profile_hook(regs);
+ if (!user_mode(regs) && cpu_isset(smp_processor_id(), prof_cpu_mask))
+ profile_hit(type, (void *)profile_pc(regs));
+}
+
#endif /* __KERNEL__ */
#endif /* _LINUX_PROFILE_H */
next prev parent reply other threads:[~2004-10-07 11:41 UTC|newest]
Thread overview: 42+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-10-07 8:51 2.6.9-rc3-mm3 Andrew Morton
2004-10-07 9:30 ` 2.6.9-rc3-mm3 Martin Zwickel
2004-10-07 9:41 ` 2.6.9-rc3-mm3 Nick Sanders
2004-10-07 9:50 ` 2.6.9-rc3-mm3 Andrew Morton
2004-10-07 10:10 ` 2.6.9-rc3-mm3 Martin Zwickel
2004-10-07 10:44 ` 2.6.9-rc3-mm3 Hanno Meyer-Thurow
[not found] ` <20041007125610.0019eb3d@mango.fruits.de>
2004-10-07 10:58 ` 2.6.9-rc3-mm3 Hanno Meyer-Thurow
2004-10-07 10:16 ` 2.6.9-rc3-mm3 Nick Sanders
2004-10-07 11:40 ` William Lee Irwin III [this message]
2004-10-07 21:25 ` 2.6.9-rc3-mm3 J.A. Magallon
2004-10-07 21:46 ` 2.6.9-rc3-mm3 J.A. Magallon
2004-10-07 22:07 ` 2.6.9-rc3-mm3 Andrew Morton
2004-10-07 22:41 ` 2.6.9-rc3-mm3 J.A. Magallon
2004-10-07 22:54 ` 2.6.9-rc3-mm3 Andrew Morton
2004-10-07 23:06 ` 2.6.9-rc3-mm3 J.A. Magallon
2004-10-07 23:40 ` 2.6.9-rc3-mm3 Greg KH
2004-10-08 1:05 ` 2.6.9-rc3-mm3 Paul Fulghum
2004-10-08 11:23 ` 2.6.9-rc3-mm3 William Lee Irwin III
2004-10-08 11:34 ` 2.6.9-rc3-mm3 Ryan Cumming
2004-10-08 7:00 ` 2.6.9-rc3-mm3 Ingo Molnar
2004-10-07 22:03 ` 2.6.9-rc3-mm3 William Lee Irwin III
2004-10-07 9:59 ` 2.6.9-rc3-mm3 Martin Zwickel
2004-10-07 10:04 ` 2.6.9-rc3-mm3 Jesper Juhl
2004-10-07 10:15 ` 2.6.9-rc3-mm3 Russell King
2004-10-07 16:58 ` 2.6.9-rc3-mm3: `risc_code_addr01' multiple definition Adrian Bunk
2004-10-07 17:29 ` Andrew Vasquez
2004-10-07 17:50 ` James Bottomley
2004-10-07 18:13 ` Andrew Vasquez
2004-10-07 18:15 ` Andrew Vasquez
2004-10-07 18:30 ` Andrew Vasquez
2004-10-21 13:02 ` Jes Sorensen
2004-10-07 17:08 ` 2.6.9-rc3-mm3 (compile stats) John Cherry
2004-10-07 20:56 ` 2.6.9-rc3-mm3 Joel Schopp
2004-10-07 21:33 ` 2.6.9-rc3-mm3 Andrew Morton
2004-10-07 21:01 ` 2.6.9-rc3-mm3: build problem on dual-Opteron w/ NUMA Rafael J. Wysocki
2004-10-07 21:40 ` Andrew Morton
2004-10-07 21:46 ` Andi Kleen
2004-10-08 10:33 ` 2.6.9-rc3-mm3: vm-thrashing-control-tuning Hideo AOKI
2004-10-08 20:49 ` Andrew Morton
2004-10-07 11:10 2.6.9-rc3-mm3 Oleg Nesterov
2004-10-07 18:18 ` 2.6.9-rc3-mm3 Andrew Morton
[not found] <20041007015139.6f5b833b.akpm@osdl.org.suse.lists.linux.kernel>
[not found] ` <200410071041.20723.sandersn@btinternet.com.suse.lists.linux.kernel>
[not found] ` <20041007025007.77ec1a44.akpm@osdl.org.suse.lists.linux.kernel>
2004-10-07 11:23 ` 2.6.9-rc3-mm3 Andi Kleen
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=20041007114040.GV9106@holomorphy.com \
--to=wli@holomorphy.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=sandersn@btinternet.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
Powered by JetHome