[patch] alpha 2.3.x fixes and crashes

Jeff Garzik (jgarzik@pobox.com)
Sat, 22 May 1999 10:46:42 -0400 (EDT)


This message is in MIME format. The first part should be readable text,
while the remaining parts are likely unreadable without MIME-aware tools.
Send mail to mime@docserver.cac.washington.edu for more info.

---559023410-1903590565-927384402=:9977
Content-Type: TEXT/PLAIN; charset=US-ASCII

2.3.3 does not compile at all on Alpha because of the new wait queue
and semaphore changes, the patch below fixes that.

arch/alpha/kernel/process.c - corrects for updated sched.h initializer macros

include/asm-alpha/semaphore.h - adds semaphore primitves used in
kernel/fork.c and elsewhere, mainly stolen from include/asm-i386/semaphore.h.

The process.c change looks correct, but Alpha semaphores definitely
need some more attention.

My kernel gets all the way through the boot process, all the way to
multi-user with daemons running, before things start crashing. The
kernel itself doesn't panic, but oops reports pour across the console as
fast as my poor old laptop (serial port console) can record them.

I have attached ksymoops output for the first few oops reports. I
haven't looked at all at up(), down() and down_failed() yet (where the
oops are), to see if there might be a problem in there.

Jeff

Index: arch/alpha/kernel/process.c
===================================================================
RCS file: /usr/local/cvsroot/linux_2_3/arch/alpha/kernel/process.c,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 process.c
--- arch/alpha/kernel/process.c 1999/05/16 06:27:48 1.1.1.1
+++ arch/alpha/kernel/process.c 1999/05/22 14:28:36
@@ -58,10 +58,11 @@
static struct file * init_fd_array[NR_OPEN] = { NULL, };
static struct files_struct init_files = INIT_FILES;
static struct signal_struct init_signals = INIT_SIGNALS;
-struct mm_struct init_mm = INIT_MM;
+struct mm_struct init_mm = INIT_MM(init_mm);

-union task_union init_task_union __attribute__((section("init_task")))
- = { task: INIT_TASK };
+union task_union init_task_union
+ __attribute__((__section__(".data.init_task"))) =
+ { INIT_TASK(init_task_union.task) };

/*
* No need to acquire the kernel lock, we're entirely local..
Index: include/asm-alpha/semaphore.h
===================================================================
RCS file: /usr/local/cvsroot/linux_2_3/include/asm-alpha/semaphore.h,v
retrieving revision 1.1.1.2
diff -u -r1.1.1.2 semaphore.h
--- include/asm-alpha/semaphore.h 1999/05/21 22:43:31 1.1.1.2
+++ include/asm-alpha/semaphore.h 1999/05/22 14:29:08
@@ -8,23 +8,54 @@
* (C) Copyright 1996 Richard Henderson
*/

+#include <linux/wait.h>
#include <asm/current.h>
#include <asm/system.h>
#include <asm/atomic.h>

+#if WAITQUEUE_DEBUG
+#error wait queue debugging is not supported
+#endif
+
struct semaphore {
/* Careful, inline assembly knows about the position of these two. */
atomic_t count;
atomic_t waking; /* biased by -1 */
wait_queue_head_t wait;
};
+
+
+#define __SEM_DEBUG_INIT(name)
+#define __SEM_DEBUG_INIT_LATER(name)
+
+#define __SEMAPHORE_INITIALIZER(name,count) \
+{ ATOMIC_INIT(count), ATOMIC_INIT(-1), \
+ __WAIT_QUEUE_HEAD_INITIALIZER((name).wait) \
+ __SEM_DEBUG_INIT(name) }
+
+#define __MUTEX_INITIALIZER(name) \
+ __SEMAPHORE_INITIALIZER(name,1)
+
+#define __DECLARE_SEMAPHORE_GENERIC(name,count) \
+ struct semaphore name = __SEMAPHORE_INITIALIZER(name,count)

-#define MUTEX ((struct semaphore) \
- { ATOMIC_INIT(1), ATOMIC_INIT(-1), NULL })
-#define MUTEX_LOCKED ((struct semaphore) \
- { ATOMIC_INIT(0), ATOMIC_INIT(-1), NULL })
+#define DECLARE_MUTEX(name) __DECLARE_SEMAPHORE_GENERIC(name,1)
+#define DECLARE_MUTEX_LOCKED(name) __DECLARE_SEMAPHORE_GENERIC(name,0)

+
#define sema_init(sem, val) atomic_set(&((sem)->count), val)
+
+static inline void init_MUTEX (struct semaphore *sem)
+{
+ sema_init(sem, 1);
+}
+
+static inline void init_MUTEX_LOCKED (struct semaphore *sem)
+{
+ sema_init(sem, 0);
+}
+
+

extern void __down(struct semaphore * sem);
extern int __down_interruptible(struct semaphore * sem);
Index: include/linux/wait.h
===================================================================
RCS file: /usr/local/cvsroot/linux_2_3/include/linux/wait.h,v
retrieving revision 1.1.1.1
diff -u -r1.1.1.1 wait.h
--- include/linux/wait.h 1999/05/16 06:21:10 1.1.1.1
+++ include/linux/wait.h 1999/05/22 14:29:33
@@ -17,7 +17,7 @@
* Temporary debugging help until all code is converted to the new
* waitqueue usage.
*/
-#define WAITQUEUE_DEBUG 1
+#define WAITQUEUE_DEBUG 0

#if WAITQUEUE_DEBUG
extern int printk(const char *fmt, ...);

---559023410-1903590565-927384402=:9977
Content-Type: APPLICATION/octet-stream; name="ksymoops.4.gz"
Content-Transfer-Encoding: BASE64
Content-ID: <Pine.GSO.3.96.990522104642.9977C@ext1>
Content-Description: ksymoops output

H4sICGu+RjcCA2tzeW1vb3BzLjQA7ZtNb9s6FobX9q/gMoF7Y34cUZTheDO4
i8EM0AHuzOriwqAosjXqr7HlJP33cyg5sSVRqR2nRjuV0EVAHb0kX0mHj47Z
j+t8tlpuyW5rsxH57YE8LOaz5e6J3GzX1szczGa3fVI5fvv42sl/vHbyn6+d
XJA/vm5zu7hb6PVrcYYwcpNZp3fz/Lbf/89Sp3NL8hX5rJcZ/vXFbpZ2Ttb6
02z5iWzsf3d2mxOdk4fZJt/pOdFZtrHbLaHVQ/Vny1l+I6i6HZGPq/WWsP7a
kHvy59j5w/ggwayK1eQvQja6dgqYUxL8Kbz03qvH/Q0t/6oceC3D5pcrRZqI
VCps5oHo/kYcByuXikR7DahoWMopldgcHTRk6hTjQiT9jawpq3IccaND4bBZ
1YZXjiNpjCPxg2a0GeybWT3aazBem7hRhYaoBGvLbaEBDT8YakR187jCVhl2
Og53qILKSS3YseK20Gawbz6e4cvd4jw4Di7CGtD0FDWicPDxXIpHkRfDU8fN
wFnMTf/TmlRaVZwaHMd2TQLm/W2V2RHRAP7moSRA8TxjPGAnDLD3cQqc+7MT
kgI4PI1nU5CsvALP7q/dP0YRXhtbGgFNSb8/mfz+93+NSP09IuPpNFs9LgcR
HTo62Y+jFibNSxiADyP1o2H3eIrdTUZv1fOSo54GAglqE5xV726+wmRCn/C9
gURDWDmmB2XVpgyjHkAhCwQdflFm3lIKbd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sy6LbHWcBbaArl2veDz+nQJl4xPA4a7onWIiuXhoua4ZRTCy3iFbvj
oN2eazNBIkdcRnBd6KWbXi4/HCFMFLt4/xYN6FP9xCQIvi/cVaPhJFMBGoYG
zhbLeRN8IVFvR+Qg44a5mWYpvDNMByPfCabfsY63wAtsnn+9QfFr1/KsSDN1
Ri0vE81aXpYi6UTVWp4/YiE0lMh9DGBO6HAtrygaqdrwVLiWl/FmLa8MDiG3
SRq1PJy41cFaHuOn1vK8eXBqLe/QYWstL4TLV6zlZfyatby9ed+9lhdAJK/r
szQmaAHDIIeWebMMKrL5fu00LVQOcETlDlqpvPxmGm8epxi6QT6TOoySPu9i
nNXzaYnknplxxtdG9zN4+RzK99mejMvUOU1Xeb5aTD/ruRswGPIf/cPgTfo/
08dBV+vuat1drfuXrXUn0GgUJnbwAwAyv/qP3ZG7GJBjZloBWV4GyGlkTgfk
MvhEQMaJXwzI3ryTAfnQYQfIR+ZdH5B/5po0pi4/8JJqoY3FimxWkpX57NMy
fgYkHVh1YNWBVQdWvyZYsatXHtnllUfL28EqurDyyM6pPLJzKo/sHSqP7JzK
I+sqjwHzOrDqwKoDqw6sOrDqwKoAq2ca+kn3SGaijk00TiNLL94jSVv+8wVL
eAObTKrCeyQlP2ePZDGXd98jiaOrYhPThr1hjyRQcQ420cAeSb+n8cQ9kiaS
OnXfxqbvvEfy2bxuj+T/ETZ1uwC7XYDdLsBuF+DbNvz9wOWs6NrlLPkO5awk
ay9nscvKWfKccpY8p5wl36GcJc8pZ8munEUC5v1iG+m+8wa5rtzVlbu6cldX
7up+RzwTvOSVwUvZLL4YvIRRreDFLwIvHB6cDF774NPAy0/8UvAqzDsVvI46
7MDryLzud8QOrDqw6sCqA6vvBVZ/3t3dkcVqY8nKk0Xu3+7Mg8tR+iNuNZ+v
HrcEY//q/w9p8icmKE4AAA==
---559023410-1903590565-927384402=:9977--

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/