mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Manfred Spraul <manfred@colorfullife.com>
To: Mike Galbraith <efault@gmx.de>
Cc: Zwane Mwaikambo <zwane@arm.linux.org.uk>, linux-kernel@vger.kernel.org
Subject: Re: 2.6.0-test7 DEBUG_PAGEALLOC oops
Date: Sun, 12 Oct 2003 08:58:24 +0200	[thread overview]
Message-ID: <3F88FB90.7080801@colorfullife.com> (raw)
In-Reply-To: <5.2.1.1.2.20031012060658.01e3b840@pop.gmx.net>

[-- Attachment #1: Type: text/plain, Size: 116 bytes --]

Could you try the attached patch?
It updates the end of stack detection to handle unaligned stacks.

--
    Manfred

[-- Attachment #2: patch-end-of-stack --]
[-- Type: text/plain, Size: 1625 bytes --]

// $Header$
// Kernel Version:
//  VERSION = 2
//  PATCHLEVEL = 6
//  SUBLEVEL = 0
//  EXTRAVERSION = -test7
--- 2.6/include/asm-i386/thread_info.h	2003-10-09 21:20:00.000000000 +0200
+++ build-2.6/include/asm-i386/thread_info.h	2003-10-12 08:50:12.000000000 +0200
@@ -101,6 +101,16 @@
 
 #endif
 
+static inline int kstack_end(void *addr)
+{
+	unsigned long offset = (unsigned long)addr & (THREAD_SIZE-1);
+
+	/* Some APM bios versions misalign the stack */
+	if (offset == 0 || offset > (THREAD_SIZE-sizeof(void*)))
+			return 1;
+	return 0;
+}
+
 /*
  * thread information flags
  * - these are process state flags that various assembly files may need to access
--- 2.6/mm/slab.c	2003-10-09 21:23:19.000000000 +0200
+++ build-2.6/mm/slab.c	2003-10-12 08:51:13.000000000 +0200
@@ -862,7 +862,7 @@
 		unsigned long *sptr = &caller;
 		unsigned long svalue;
 
-		while (((long) sptr & (THREAD_SIZE-1)) != 0) {
+		while (!kstack_end(sptr)) {
 			svalue = *sptr++;
 			if (kernel_text_address(svalue)) {
 				*addr++=svalue;
--- 2.6/arch/i386/kernel/traps.c	2003-10-09 21:23:03.000000000 +0200
+++ build-2.6/arch/i386/kernel/traps.c	2003-10-12 08:50:41.000000000 +0200
@@ -104,7 +104,7 @@
 #ifdef CONFIG_KALLSYMS
 	printk("\n");
 #endif
-	while (((long) stack & (THREAD_SIZE-1)) != 0) {
+	while (!kstack_end(stack)) {
 		addr = *stack++;
 		if (kernel_text_address(addr)) {
 			printk(" [<%08lx>] ", addr);
@@ -138,7 +138,7 @@
 
 	stack = esp;
 	for(i = 0; i < kstack_depth_to_print; i++) {
-		if (((long) stack & (THREAD_SIZE-1)) == 0)
+		if (kstack_end(stack))
 			break;
 		if (i && ((i % 8) == 0))
 			printk("\n       ");

  reply	other threads:[~2003-10-12  6:58 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-10-11  9:37 Manfred Spraul
2003-10-11 11:15 ` Mike Galbraith
2003-10-11 12:06   ` Manfred Spraul
2003-10-11 15:52     ` Mike Galbraith
2003-10-11 17:34       ` Manfred Spraul
2003-10-12  5:11         ` Mike Galbraith
2003-10-12  6:58           ` Manfred Spraul [this message]
2003-10-12  8:52             ` Mike Galbraith
2003-10-12 12:08               ` Thomas Molina
2003-10-12 14:13                 ` Thomas Molina
2003-10-12 22:36             ` Thomas Molina
  -- strict thread matches above, loose matches on Subject: below --
2003-10-09 13:04 2.6.0-test7 oops in proc_pid_stat Olaf Hering
2003-10-09 22:04 ` Linus Torvalds
2003-10-10  6:50   ` 2.6.0-test7 DEBUG_PAGEALLOC oops Mike Galbraith
2003-10-10 16:52     ` Zwane Mwaikambo
2003-10-11  7:01       ` Mike Galbraith
2003-10-11  7:03         ` Zwane Mwaikambo

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=3F88FB90.7080801@colorfullife.com \
    --to=manfred@colorfullife.com \
    --cc=efault@gmx.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zwane@arm.linux.org.uk \
    /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®