From kaos@sgi.com Fri Aug 3 01:16:11 2007 Received: with ECARTIS (v1.0.0; list kdb); Fri, 03 Aug 2007 01:16:17 -0700 (PDT) Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l738G6bm032477 for ; Fri, 3 Aug 2007 01:16:08 -0700 Received: from kao2.melbourne.sgi.com (kao2.melbourne.sgi.com [134.14.55.180]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id SAA11428 for ; Fri, 3 Aug 2007 18:05:05 +1000 Received: by kao2.melbourne.sgi.com (Postfix, from userid 16331) id CBE6A104FC5; Fri, 3 Aug 2007 18:05:05 +1000 (EST) Received: from kao2.melbourne.sgi.com (localhost [127.0.0.1]) by kao2.melbourne.sgi.com (Postfix) with ESMTP id C37D61401AD; Fri, 3 Aug 2007 18:05:05 +1000 (EST) X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.1 From: Keith Owens To: Konstantin Baydarov cc: kdb@oss.sgi.com Subject: Re: [PATCH] fix of unnecessary clocksource change after exiting from KDB console In-reply-to: Your message of "Mon, 09 Jul 2007 19:39:16 +0400." <20070709193916.32bcfdcd@windmill.dev.rtsoft.ru> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Fri, 03 Aug 2007 18:05:05 +1000 Message-ID: <4092.1186128305@kao2.melbourne.sgi.com> Content-Transfer-Encoding: 8bit X-archive-position: 1227 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb Konstantin Baydarov (on Mon, 9 Jul 2007 19:39:16 +0400) wrote: >When I spend more that 10 seconds in KDB console and then exit from KDB, Kernel think that current clocksource is unstable and change it. I'm using 2.6.22-rc7 kdb on SMP i386 system. Here is log: >Before doing sync, I've set breakpoint to do_sync(). >root@192.168.40.10:~# >root@192.168.40.10:~# cat /sys/devices/system/clocksource/clocksource0/current_clocksource >tsc >root@192.168.40.10:~# sync >Instruction(i) breakpoint #0 at 0xc017b64a (adjusted) >0xc017b64a do_sync: int3 > >Entering kdb (current=0xc16f3a50, pid 2983) on processor 0 due to Breakpoint @ 0xc017b64a >[0]kdb> go >Clocksource tsc unstable (delta = 14060902198 ns) >root@192.168.40.10:~# Time: acpi_pm clocksource has been installed. > >root@192.168.40.10:~# >root@192.168.40.10:~# cat /sys/devices/system/clocksource/clocksource0/current_clocksource >acpi_pm >root@192.168.40.10:~# >root@192.168.40.10:~# > >Issue: tsc clocksource was replaced by acpi_pm. > >The reason of issue: >Current clocksource(tsc) in kernel have a watchdog - another clocksource(acpi_pm). clocksource_watchdog() that updates >watchdog_last timestamp runs with help of kernel timer that is disabled when kernel enters kdb. So watchdog clocksource(acpi_pm) can overflow and when kernel exits kdb, watchdog clocksource can report wrong time delta - that's why kernel can think that current clocksource is unstable and change it. > >How solved: >I suspend/resume timekeeping when we enter/exit kdb. Suspend/resume of timekeeping suspends/resumes current clocksource and watchdog clocksource. >Also patch prevents potential softlockup warnings that appear in earlier kernels. > >Thanks. > >Signed-off-by: Konstantin Baydarov > > kdb/kdbmain.c | 17 +++++++++++++++++ > kernel/time/timekeeping.c | 27 +++++++++++++++++++++++++++ > 2 files changed, 44 insertions(+) > >Index: linux-2.6.22-rc7/kdb/kdbmain.c >=================================================================== >--- linux-2.6.22-rc7.orig/kdb/kdbmain.c >+++ linux-2.6.22-rc7/kdb/kdbmain.c >@@ -47,6 +47,9 @@ > #include > #include > >+int kdb_timekeeping_suspend(void); >+int kdb_timekeeping_resume(void); >+ > /* > * Kernel debugger state flags > */ >@@ -60,6 +63,7 @@ atomic_t kdb_8250; > */ > static DEFINE_SPINLOCK(kdb_lock); > volatile int kdb_initial_cpu = -1; /* cpu number that owns kdb */ >+volatile int kdb_initial_cpu_save = -1; /* cpu number that owns kdb */ > int kdb_seqno = 2; /* how many times kdb has been entered */ > > volatile int kdb_nextline = 1; >@@ -1998,6 +2002,11 @@ kdb(kdb_reason_t reason, int error, stru > smp_kdb_stop(); > KDB_DEBUG_STATE("kdb 8", reason); > } >+ /* Suspend clocksource, when entering kdb, to prevent >+ * false soft lockup warnings and switching to another >+ * clocksource. >+ */ >+ kdb_timekeeping_suspend(); > } > > if (KDB_STATE(GO1)) { >@@ -2020,6 +2029,7 @@ kdb(kdb_reason_t reason, int error, stru > if (result == KDB_CMD_GO && KDB_STATE(SSBPT)) > KDB_STATE_SET(GO1); > >+ kdb_initial_cpu_save = kdb_initial_cpu; > if (smp_processor_id() == kdb_initial_cpu && > !KDB_STATE(DOING_SS) && > !KDB_STATE(RECURSE)) { >@@ -2055,6 +2065,13 @@ kdb(kdb_reason_t reason, int error, stru > } > } > >+ /* Only do this work if we are really leaving kdb */ >+ if (!(KDB_STATE(DOING_SS) || KDB_STATE(SSBPT) || KDB_STATE(RECURSE))) { >+ if(smp_processor_id() == kdb_initial_cpu_save) >+ /* Resume clocksource when initial cpu leaves kdb */ >+ kdb_timekeeping_resume(); >+ } >+ > KDB_DEBUG_STATE("kdb 14", result); > kdba_restoreint(&int_state); > #ifdef CONFIG_CPU_XSCALE >Index: linux-2.6.22-rc7/kernel/time/timekeeping.c >=================================================================== >--- linux-2.6.22-rc7.orig/kernel/time/timekeeping.c >+++ linux-2.6.22-rc7/kernel/time/timekeeping.c >@@ -299,6 +299,19 @@ static int timekeeping_resume(struct sys > return 0; > } > >+#if defined(CONFIG_KDB) || defined(CONFIG_KDB_MODULE) >+int kdb_timekeeping_resume(void) >+{ >+ int ret; >+ struct sys_device dev; >+ >+ ret = timekeeping_resume(&dev); >+ >+ return ret; >+} >+EXPORT_SYMBOL(kdb_timekeeping_resume); >+#endif >+ > static int timekeeping_suspend(struct sys_device *dev, pm_message_t state) > { > unsigned long flags; >@@ -313,6 +326,20 @@ static int timekeeping_suspend(struct sy > return 0; > } > >+#if defined(CONFIG_KDB) || defined(CONFIG_KDB_MODULE) >+int kdb_timekeeping_suspend(void) >+{ >+ int ret; >+ struct sys_device dev; >+ pm_message_t state; >+ >+ ret = timekeeping_suspend(&dev, state); >+ >+ return ret; >+} >+EXPORT_SYMBOL(kdb_timekeeping_suspend); >+#endif >+ > /* sysfs resume/suspend bits for timekeeping */ > static struct sysdev_class timekeeping_sysclass = { > .resume = timekeeping_resume, Thanks for the patch and sorry for the delay in replying. I am trying to catch up on a backlog of kdb patches. When kdb was written, it was the only kernel debugger and we made the mistake of adding kdb_*() helper functions in the rest of the kernel. Now we have choices for debuggers, and all of the debuggers have the same problems when they stop the system. So make the change work for all debuggers. Does this work for you? Against kdb-v4.4-2.6.23-rc1-common-1. Index: linux/kdb/kdbmain.c =================================================================== --- linux.orig/kdb/kdbmain.c 2007-08-03 18:00:10.558422200 +1000 +++ linux/kdb/kdbmain.c 2007-08-03 17:59:53.840581765 +1000 @@ -41,6 +41,7 @@ #endif #include #include +#include #include @@ -1737,6 +1738,8 @@ kdb(kdb_reason_t reason, int error, stru int ss_event, old_regs_saved = 0; struct pt_regs *old_regs = NULL; kdb_dbtrap_t db_result=KDB_DB_NOBPT; + pm_message_t pm_message_state; + preempt_disable(); atomic_inc(&kdb_event); @@ -1998,6 +2001,11 @@ kdb(kdb_reason_t reason, int error, stru smp_kdb_stop(); KDB_DEBUG_STATE("kdb 8", reason); } + /* Suspend clocksource, when entering kdb, to prevent + * false soft lockup warnings and switching to another + * clocksource. + */ + timekeeping_suspend(NULL, pm_message_state); } if (KDB_STATE(GO1)) { @@ -2050,6 +2058,7 @@ kdb(kdb_reason_t reason, int error, stru ; if (!kdb_quiet(reason)) notify_die(DIE_KDEBUG_LEAVE, "KDEBUG LEAVE", regs, error, 0, 0); + timekeeping_resume(NULL); kdb_initial_cpu = -1; /* release kdb control */ KDB_DEBUG_STATE("kdb 13", reason); } Index: linux/include/linux/time_func.h =================================================================== --- /dev/null 1970-01-01 00:00:00.000000000 +0000 +++ linux/include/linux/time_func.h 2007-08-03 17:11:48.643556233 +1000 @@ -0,0 +1,19 @@ +#ifndef _LINUX_TIME_FUNC_H +#define _LINUX_TIME_FUNC_H + +/* Define kernel functions used by time sources. These cannot be included in + * time.h because their parameter definitions will pull in a long chain of + * other defines which make it much more complicated to build asm-offsets.c. + */ + +#include +#include + +/* These functions take sys_device and pm_message_t parameters but they are not + * used. You can safely pass NULL parameters to these functions. + */ + +extern int timekeeping_resume(struct sys_device *dev); +extern int timekeeping_suspend(struct sys_device *dev, pm_message_t state); + +#endif Index: linux/kernel/time/timekeeping.c =================================================================== --- linux.orig/kernel/time/timekeeping.c 2007-08-03 16:41:45.007031263 +1000 +++ linux/kernel/time/timekeeping.c 2007-08-03 17:08:34.460707523 +1000 @@ -17,6 +17,7 @@ #include #include #include +#include #include @@ -277,7 +278,7 @@ static unsigned long timekeeping_suspend * xtime/wall_to_monotonic/jiffies/etc are * still managed by arch specific suspend/resume code. */ -static int timekeeping_resume(struct sys_device *dev) +int timekeeping_resume(struct sys_device *dev) { unsigned long flags; unsigned long now = read_persistent_clock(); @@ -308,8 +309,9 @@ static int timekeeping_resume(struct sys return 0; } +EXPORT_SYMBOL(timekeeping_resume); -static int timekeeping_suspend(struct sys_device *dev, pm_message_t state) +int timekeeping_suspend(struct sys_device *dev, pm_message_t state) { unsigned long flags; @@ -322,6 +324,7 @@ static int timekeeping_suspend(struct sy return 0; } +EXPORT_SYMBOL(timekeeping_suspend); /* sysfs resume/suspend bits for timekeeping */ static struct sysdev_class timekeeping_sysclass = { --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kbaidarov@ru.mvista.com Fri Aug 3 10:19:21 2007 Received: with ECARTIS (v1.0.0; list kdb); Fri, 03 Aug 2007 10:19:27 -0700 (PDT) Received: from mail.dev.rtsoft.ru (rtsoft2.corbina.net [85.21.88.2] (may be forged)) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l73HJHbm025432 for ; Fri, 3 Aug 2007 10:19:20 -0700 Received: (qmail 19072 invoked from network); 3 Aug 2007 17:19:21 -0000 Received: from windmill.dev.rtsoft.ru (192.168.1.130) by mail.dev.rtsoft.ru with SMTP; 3 Aug 2007 17:19:21 -0000 Date: Fri, 3 Aug 2007 21:25:14 +0400 From: Konstantin Baydarov To: Keith Owens Cc: kdb@oss.sgi.com Subject: Re: [PATCH] fix of unnecessary clocksource change after exiting from KDB console Message-ID: <20070803212514.46016060@windmill.dev.rtsoft.ru> In-Reply-To: <4092.1186128305@kao2.melbourne.sgi.com> References: <20070709193916.32bcfdcd@windmill.dev.rtsoft.ru> <4092.1186128305@kao2.melbourne.sgi.com> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.19; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-archive-position: 1228 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kbaidarov@ru.mvista.com Precedence: bulk X-list: kdb On Fri, 03 Aug 2007 18:05:05 +1000 Keith Owens wrote: > > Thanks for the patch and sorry for the delay in replying. I am trying > to catch up on a backlog of kdb patches. > > When kdb was written, it was the only kernel debugger and we made the > mistake of adding kdb_*() helper functions in the rest of the kernel. > Now we have choices for debuggers, and all of the debuggers have the > same problems when they stop the system. So make the change work for > all debuggers. Does this work for you? Against > kdb-v4.4-2.6.23-rc1-common-1. > I'm afraid that previous patch won't work with SMP kernel with high resolution timer enabled, because of hres_timers_resume(): /* * During resume we might have to reprogram the high resolution timer * interrupt (on the local CPU): */ void hres_timers_resume(void) { WARN_ON_ONCE(num_online_cpus() > 1); /* Retrigger the CPU local events: */ retrigger_next_event(NULL); } When we call hres_timers_resume() from timekeeping_resume() other CPUs should be in offline. AFAIK, KDB doesn't put CPUs to offline. Here Is new version on fix. Patch against 2.6.23-rc1. I've tested it on UP pentium4. Soft Lockup fix was taken from KGDB mailing list. To prevent unnecessary clocksource change I call clocksource_resume_watchdog() instead of suspending whole timekeeping system. Signed-off-by: Konstantin Baydarov Signed-off-by: Milind Dumbare Signed-off-by: Jason Wessel Signed-off-by: Sergey Shtylyov include/linux/clocksource.h | 1 + include/linux/kdb.h | 1 + kdb/kdbmain.c | 8 ++++++++ kernel/softlockup.c | 6 ++++++ kernel/time/clocksource.c | 5 +++-- kernel/timer.c | 6 ++++++ 6 files changed, 25 insertions(+), 2 deletions(-) Index: linux-2.6.23-rc1/kdb/kdbmain.c =================================================================== --- linux-2.6.23-rc1.orig/kdb/kdbmain.c +++ linux-2.6.23-rc1/kdb/kdbmain.c @@ -41,12 +41,15 @@ #endif #include #include +#include #include #include #include +atomic_t kdb_sync_softlockup[NR_CPUS] = {ATOMIC_INIT(0)}; + /* * Kernel debugger state flags */ @@ -1904,6 +1907,8 @@ kdb(kdb_reason_t reason, int error, stru KDB_STATE_SET(KDB_CONTROL); } + atomic_set(&kdb_sync_softlockup[raw_smp_processor_id()], 1); + /* * If not entering the debugger due to CPU switch or single step * reentry, serialize access here. @@ -2056,6 +2061,9 @@ kdb(kdb_reason_t reason, int error, stru } KDB_DEBUG_STATE("kdb 14", result); +#ifdef CONFIG_CLOCKSOURCE_WATCHDOG + clocksource_resume_watchdog(); +#endif kdba_restoreint(&int_state); #ifdef CONFIG_CPU_XSCALE if ( smp_processor_id() == kdb_initial_cpu && Index: linux-2.6.23-rc1/kernel/softlockup.c =================================================================== --- linux-2.6.23-rc1.orig/kernel/softlockup.c +++ linux-2.6.23-rc1/kernel/softlockup.c @@ -14,6 +14,9 @@ #include #include #include +#ifdef CONFIG_KDB +#include +#endif static DEFINE_SPINLOCK(print_lock); @@ -48,6 +51,9 @@ static unsigned long get_timestamp(void) void touch_softlockup_watchdog(void) { __raw_get_cpu_var(touch_timestamp) = get_timestamp(); +#ifdef CONFIG_KDB + atomic_set(&kdb_sync_softlockup[raw_smp_processor_id()], 0); +#endif } EXPORT_SYMBOL(touch_softlockup_watchdog); Index: linux-2.6.23-rc1/kernel/timer.c =================================================================== --- linux-2.6.23-rc1.orig/kernel/timer.c +++ linux-2.6.23-rc1/kernel/timer.c @@ -36,6 +36,9 @@ #include #include #include +#ifdef CONFIG_KDB +#include +#endif #include #include @@ -897,6 +900,9 @@ static void run_timer_softirq(struct sof void run_local_timers(void) { raise_softirq(TIMER_SOFTIRQ); +#ifdef CONFIG_KDB + if(!atomic_read(&kdb_sync_softlockup[smp_processor_id()])) +#endif softlockup_tick(); } Index: linux-2.6.23-rc1/kernel/time/clocksource.c =================================================================== --- linux-2.6.23-rc1.orig/kernel/time/clocksource.c +++ linux-2.6.23-rc1/kernel/time/clocksource.c @@ -147,7 +147,8 @@ static void clocksource_watchdog(unsigne } spin_unlock(&watchdog_lock); } -static void clocksource_resume_watchdog(void) + +void clocksource_resume_watchdog(void) { set_bit(0, &watchdog_resumed); } @@ -199,7 +200,7 @@ static void clocksource_check_watchdog(s cs->flags |= CLOCK_SOURCE_VALID_FOR_HRES; } -static inline void clocksource_resume_watchdog(void) { } +void clocksource_resume_watchdog(void) { } #endif /** Index: linux-2.6.23-rc1/include/linux/clocksource.h =================================================================== --- linux-2.6.23-rc1.orig/include/linux/clocksource.h +++ linux-2.6.23-rc1/include/linux/clocksource.h @@ -218,6 +218,7 @@ extern int clocksource_register(struct c extern struct clocksource* clocksource_get_next(void); extern void clocksource_change_rating(struct clocksource *cs, int rating); extern void clocksource_resume(void); +extern void clocksource_resume_watchdog(void); #ifdef CONFIG_GENERIC_TIME_VSYSCALL extern void update_vsyscall(struct timespec *ts, struct clocksource *c); Index: linux-2.6.23-rc1/include/linux/kdb.h =================================================================== --- linux-2.6.23-rc1.orig/include/linux/kdb.h +++ linux-2.6.23-rc1/include/linux/kdb.h @@ -162,5 +162,6 @@ int kdb_process_cpu(const struct task_st } extern const char kdb_serial_str[]; +extern atomic_t kdb_sync_softlockup[NR_CPUS]; #endif /* !_KDB_H */ --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kbaidarov@ru.mvista.com Thu Aug 9 10:17:37 2007 Received: with ECARTIS (v1.0.0; list kdb); Thu, 09 Aug 2007 10:17:44 -0700 (PDT) Received: from mail.dev.rtsoft.ru (rtsoft2.corbina.net [85.21.88.2] (may be forged)) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l79HHXbm031716 for ; Thu, 9 Aug 2007 10:17:36 -0700 Received: (qmail 29290 invoked from network); 9 Aug 2007 17:17:33 -0000 Received: from windmill.dev.rtsoft.ru (192.168.1.130) by mail.dev.rtsoft.ru with SMTP; 9 Aug 2007 17:17:33 -0000 Date: Thu, 9 Aug 2007 21:23:29 +0400 From: Konstantin Baydarov To: Konstantin Baydarov Cc: Keith Owens , kdb@oss.sgi.com Subject: Re: [PATCH] fix of unnecessary clocksource change after exiting from KDB console Message-ID: <20070809212329.69c457fe@windmill.dev.rtsoft.ru> In-Reply-To: <20070803212514.46016060@windmill.dev.rtsoft.ru> References: <20070709193916.32bcfdcd@windmill.dev.rtsoft.ru> <4092.1186128305@kao2.melbourne.sgi.com> <20070803212514.46016060@windmill.dev.rtsoft.ru> X-Mailer: Sylpheed-Claws 2.6.0 (GTK+ 2.8.19; i386-redhat-linux-gnu) Mime-Version: 1.0 Content-type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 8bit X-archive-position: 1229 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kbaidarov@ru.mvista.com Precedence: bulk X-list: kdb On Fri, 3 Aug 2007 21:25:14 +0400 Konstantin Baydarov wrote: > I'm afraid that previous patch won't work with SMP kernel with high > resolution timer enabled, because of hres_timers_resume(): /* > * During resume we might have to reprogram the high resolution timer > * interrupt (on the local CPU): > */ > void hres_timers_resume(void) > { > WARN_ON_ONCE(num_online_cpus() > 1); > > /* Retrigger the CPU local events: */ > retrigger_next_event(NULL); > } > When we call hres_timers_resume() from timekeeping_resume() other > CPUs should be in offline. AFAIK, KDB doesn't put CPUs to offline. > > Here Is new version on fix. Patch against 2.6.23-rc1. I've tested it > on UP pentium4. > Soft Lockup fix was taken from KGDB mailing list. > To prevent unnecessary clocksource change I call > clocksource_resume_watchdog() instead of suspending whole timekeeping > system. KGDB has the same problem with unnecessary clocksource change. I've suggest patch that fixes the problem the same way. Patch was accepted with small changes: http://kgdb.cvs.sourceforge.net/kgdb/kgdb-2/clocksource_watchdog.patch?view=log&pathrev=linux2_6_23_uprev --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From n-dade@nsd.dyndns.org Sat Aug 18 08:38:01 2007 Received: with ECARTIS (v1.0.0; list kdb); Sat, 18 Aug 2007 08:38:05 -0700 (PDT) Received: from nsd.dyndns.org (adsl-63-197-69-248.dsl.snfc21.pacbell.net [63.197.69.248]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7IFbxbm011387 for ; Sat, 18 Aug 2007 08:38:00 -0700 Received: from n-dade by nsd.dyndns.org with local (Exim 3.35 #1) id 1IMQ4r-0006LY-00 for kdb@oss.sgi.com; Sat, 18 Aug 2007 08:19:01 -0700 Date: Sat, 18 Aug 2007 08:19:01 -0700 To: kdb@oss.sgi.com Subject: patch for kdb 4.4 to fix compiling without CONFIG_SWAP Message-ID: <20070818151901.GA23829@sparc20.esperanza> Mime-Version: 1.0 Content-type: text/plain Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Message-Flag: This message is an ad for Pepsi to all you outlook users out there. Drink our corn syrup water please, and make us richer than Cocacola. From: "Nicolas S. Dade" Content-Transfer-Encoding: 8bit X-archive-position: 1231 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: n-dade@nsd.dyndns.org Precedence: bulk X-list: kdb I've noticed kdb 4.4 does not compile if CONFIG_SWAP is not set. There seems to reason to require swap, so the attached patch removes the two calls to kdb_si_swapinfo() which break the compile. -Nicolas Dade -- Attached file included as plaintext by Ecartis -- --- linux-2.6.16.51/fs/proc/proc_misc.c 2007-08-15 19:00:52.000000000 -0700 +++ linux-2.6.16.51/fs/proc/proc_misc.c 2007-08-15 19:02:44.000000000 -0700 @@ -230,7 +230,9 @@ */ #define K(x) ((x) << (PAGE_SHIFT - 10)) si_meminfo(&i); +#ifdef CONFIG_SWAP kdb_si_swapinfo(&i); +#endif committed = atomic_read(&vm_committed_space); allowed = ((totalram_pages - hugetlb_total_pages()) * sysctl_overcommit_ratio / 100) + total_swap_pages; --- linux-2.6.16.51//kdb/kdbmain.c 2007-08-15 19:03:22.000000000 -0700 +++ linux-2.6.16.51//kdb/kdbmain.c 2007-08-15 19:09:55.000000000 -0700 @@ -3424,8 +3424,10 @@ val->loads[2] = avenrun[2]; val->procs = nr_threads-1; si_meminfo(val); +#ifdef CONFIG_SWAP kdb_si_swapinfo(val); +#endif return; } --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From n-dade@nsd.dyndns.org Sat Aug 18 08:37:59 2007 Received: with ECARTIS (v1.0.0; list kdb); Sat, 18 Aug 2007 08:38:04 -0700 (PDT) Received: from nsd.dyndns.org (adsl-63-197-69-248.dsl.snfc21.pacbell.net [63.197.69.248]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7IFbubm011366 for ; Sat, 18 Aug 2007 08:37:59 -0700 Received: from n-dade by nsd.dyndns.org with local (Exim 3.35 #1) id 1IMQ7s-0006MB-00 for kdb@oss.sgi.com; Sat, 18 Aug 2007 08:22:08 -0700 Date: Sat, 18 Aug 2007 08:22:08 -0700 To: kdb@oss.sgi.com Subject: solution for compiling kdb/modules/kdbm_x86.c as a module Message-ID: <20070818152208.GB23829@sparc20.esperanza> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.28i X-Message-Flag: This message is an ad for Pepsi to all you outlook users out there. Drink our corn syrup water please, and make us richer than From: "Nicolas S. Dade" Content-Transfer-Encoding: 8bit X-archive-position: 1230 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: n-dade@nsd.dyndns.org Precedence: bulk X-list: kdb kdb 4.4 module kdbm_x86.c references kdb_current_task, which is not exported from vmlinux. I think kdb needs an EXPORT_SYMBOL(kdb_current_task); in kdbmain.c. -Nicolas Dade --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From jlan@sgi.com Wed Aug 22 05:00:09 2007 Received: with ECARTIS (v1.0.0; list kdb); Wed, 22 Aug 2007 05:00:16 -0700 (PDT) Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7MC054p006079 for ; Wed, 22 Aug 2007 05:00:09 -0700 Received: from [134.15.0.74] (mtv-vpn-sw-corp-0-74.corp.sgi.com [134.15.0.74]) by cthulhu.engr.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7M12NQn008404; Tue, 21 Aug 2007 18:02:24 -0700 Message-ID: <46CB8C2C.7020001@sgi.com> Date: Tue, 21 Aug 2007 18:06:52 -0700 From: Jay Lan User-Agent: Thunderbird 1.5 (X11/20060317) MIME-Version: 1.0 To: "Nicolas S. Dade" CC: kdb@oss.sgi.com Subject: Re: solution for compiling kdb/modules/kdbm_x86.c as a module References: <20070818152208.GB23829@sparc20.esperanza> In-Reply-To: <20070818152208.GB23829@sparc20.esperanza> X-Enigmail-Version: 0.94.0.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1232 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jlan@sgi.com Precedence: bulk X-list: kdb Nicolas S. Dade wrote: > kdb 4.4 module kdbm_x86.c references kdb_current_task, which is not exported > from vmlinux. I think kdb needs an > > EXPORT_SYMBOL(kdb_current_task); > > in kdbmain.c. Hi Nicolas, It was done back in v4.4-2.6.17-common-2 :) If you are using SuSE source, it is in the SuSE patch kdb-missing-export.diff. Regards, - jay > > -Nicolas Dade > --------------------------- > Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From jlan@sgi.com Wed Aug 22 05:00:10 2007 Received: with ECARTIS (v1.0.0; list kdb); Wed, 22 Aug 2007 05:00:16 -0700 (PDT) Received: from cthulhu.engr.sgi.com (cthulhu.engr.sgi.com [192.26.80.2]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7MC054r006079 for ; Wed, 22 Aug 2007 05:00:09 -0700 Received: from [134.15.0.74] (mtv-vpn-sw-corp-0-74.corp.sgi.com [134.15.0.74]) by cthulhu.engr.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with ESMTP id l7LMWmQn026550; Tue, 21 Aug 2007 15:32:49 -0700 Message-ID: <46CB691D.3050600@sgi.com> Date: Tue, 21 Aug 2007 15:37:17 -0700 From: Jay Lan User-Agent: Thunderbird 1.5 (X11/20060317) MIME-Version: 1.0 To: "Nicolas S. Dade" CC: kdb@oss.sgi.com, Keith Owens Subject: Re: patch for kdb 4.4 to fix compiling without CONFIG_SWAP References: <20070818151901.GA23829@sparc20.esperanza> In-Reply-To: <20070818151901.GA23829@sparc20.esperanza> X-Enigmail-Version: 0.94.0.0 Content-type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 8bit X-archive-position: 1232 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: jlan@sgi.com Precedence: bulk X-list: kdb Nicolas S. Dade wrote: > I've noticed kdb 4.4 does not compile if CONFIG_SWAP is not set. There seems > to reason to require swap, so the attached patch removes the two calls to > kdb_si_swapinfo() which break the compile. Hi Nicolas, I turned off CONFIG_SWAP and tried. It built fine in my 2.6.23-rc3 tree and in the sles10sp1 (2.6.16.46) tree. Did you see the same problem on si_swapinfo()? If you had compilation problem in kdb_si_swapinfo(), you should have had the same problem with si_swapinfo(). Regards, - jay > -Nicolas Dade > > > -- Attached file included as plaintext by Ecartis -- > > --- linux-2.6.16.51/fs/proc/proc_misc.c 2007-08-15 19:00:52.000000000 -0700 > +++ linux-2.6.16.51/fs/proc/proc_misc.c 2007-08-15 19:02:44.000000000 -0700 > @@ -230,7 +230,9 @@ > */ > #define K(x) ((x) << (PAGE_SHIFT - 10)) > si_meminfo(&i); > +#ifdef CONFIG_SWAP > kdb_si_swapinfo(&i); > +#endif > committed = atomic_read(&vm_committed_space); > allowed = ((totalram_pages - hugetlb_total_pages()) > * sysctl_overcommit_ratio / 100) + total_swap_pages; > --- linux-2.6.16.51//kdb/kdbmain.c 2007-08-15 19:03:22.000000000 -0700 > +++ linux-2.6.16.51//kdb/kdbmain.c 2007-08-15 19:09:55.000000000 -0700 > @@ -3424,8 +3424,10 @@ > val->loads[2] = avenrun[2]; > val->procs = nr_threads-1; > si_meminfo(val); > +#ifdef CONFIG_SWAP > kdb_si_swapinfo(val); > +#endif > > return; > } > > > --------------------------- > Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Thu Aug 23 04:42:09 2007 Received: with ECARTIS (v1.0.0; list kdb); Thu, 23 Aug 2007 04:42:13 -0700 (PDT) Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7NBg64p017029 for ; Thu, 23 Aug 2007 04:42:08 -0700 Received: from mail.ocs.com.au (kao1.melbourne.sgi.com [134.14.55.179]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id VAA23815; Thu, 23 Aug 2007 21:42:04 +1000 Received: from ocs10w.ocs.com.au (ocs10w.ocs.com.au [192.168.254.10]) by mail.ocs.com.au (Postfix) with ESMTP id F304AE12CF0; Thu, 23 Aug 2007 21:42:02 +1000 (EST) Received: by ocs10w.ocs.com.au (Postfix, from userid 16331) id DCC71105DE2; Thu, 23 Aug 2007 21:42:02 +1000 (EST) Received: from ocs10w.ocs.com.au (localhost [127.0.0.1]) by ocs10w.ocs.com.au (Postfix) with ESMTP id D4C331401B0; Thu, 23 Aug 2007 21:42:02 +1000 (EST) X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.1 From: Keith Owens To: Jay Lan cc: "Nicolas S. Dade" , kdb@oss.sgi.com Subject: Re: patch for kdb 4.4 to fix compiling without CONFIG_SWAP In-reply-to: Your message of "Tue, 21 Aug 2007 15:37:17 MST." <46CB691D.3050600@sgi.com> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Thu, 23 Aug 2007 21:42:02 +1000 Message-ID: <5244.1187869322@ocs10w.ocs.com.au> Content-Transfer-Encoding: 8bit X-archive-position: 1233 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb Jay Lan (on Tue, 21 Aug 2007 15:37:17 -0700) wrote: >Nicolas S. Dade wrote: >> I've noticed kdb 4.4 does not compile if CONFIG_SWAP is not set. There seems >> to reason to require swap, so the attached patch removes the two calls to >> kdb_si_swapinfo() which break the compile. That was fixed in kdb v4.4-2.6.14-common-2. kdb_si_swapinfo() is #defined to si_swapinfo when CONFIG_SWAP=n. --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe. From kaos@sgi.com Thu Aug 23 19:06:33 2007 Received: with ECARTIS (v1.0.0; list kdb); Thu, 23 Aug 2007 19:06:38 -0700 (PDT) Received: from larry.melbourne.sgi.com (larry.melbourne.sgi.com [134.14.52.130]) by oss.sgi.com (8.12.10/8.12.10/SuSE Linux 0.7) with SMTP id l7O26T4p007807 for ; Thu, 23 Aug 2007 19:06:31 -0700 Received: from kao2.melbourne.sgi.com (kao2.melbourne.sgi.com [134.14.55.180]) by larry.melbourne.sgi.com (950413.SGI.8.6.12/950213.SGI.AUTOCF) via ESMTP id MAA16348 for ; Fri, 24 Aug 2007 12:06:28 +1000 Received: by kao2.melbourne.sgi.com (Postfix, from userid 16331) id 90EA0105DE0; Fri, 24 Aug 2007 12:06:28 +1000 (EST) Received: from kao2.melbourne.sgi.com (localhost [127.0.0.1]) by kao2.melbourne.sgi.com (Postfix) with ESMTP id 7FABB1401B0; Fri, 24 Aug 2007 12:06:28 +1000 (EST) X-Mailer: exmh version 2.7.2 01/07/2005 with nmh-1.1 From: Keith Owens To: Konstantin Baydarov cc: kdb@oss.sgi.com Subject: Re: [PATCH] SW Breakpoint doesn't work after it triggers on non boot CPU In-reply-to: Your message of "Mon, 09 Jul 2007 01:04:31 +0400." <20070709010431.5b79e245@localhost.localdomain> Mime-Version: 1.0 Content-type: text/plain; charset=us-ascii Date: Fri, 24 Aug 2007 12:06:28 +1000 Message-ID: <5459.1187921188@kao2.melbourne.sgi.com> Content-Transfer-Encoding: 8bit X-archive-position: 1234 X-ecartis-version: Ecartis v1.0.0 Sender: kdb-bounce@oss.sgi.com Errors-to: kdb-bounce@oss.sgi.com X-original-sender: kaos@sgi.com Precedence: bulk X-list: kdb Konstantin Baydarov (on Mon, 9 Jul 2007 01:04:31 +0400) wrote: >I'v set breakpoint to do_sync, then I'v triggered it, first on BOOT >CPU(CPU0), than on CPU1. Here is log: Fixed in kdb v4.4-2.6.23-rc2-common-2. The code was testing the wrong reason value. Index: linux/kdb/kdbmain.c =================================================================== --- linux.orig/kdb/kdbmain.c 2007-08-09 16:18:56.124872758 +1000 +++ linux/kdb/kdbmain.c 2007-08-09 14:56:27.169420747 +1000 @@ -2009,9 +2009,10 @@ kdb(kdb_reason_t reason, int error, stru /* Set up a consistent set of process stacks before talking to the user */ KDB_DEBUG_STATE("kdb 9", result); result = kdba_main_loop(reason, reason2, error, db_result, regs); + reason = reason2; /* back to original event type */ KDB_DEBUG_STATE("kdb 10", result); - kdba_adjust_ip(reason2, error, regs); + kdba_adjust_ip(reason, error, regs); KDB_STATE_CLEAR(LONGJMP); KDB_DEBUG_STATE("kdb 11", result); /* go which requires single-step over a breakpoint must only release --------------------------- Use http://oss.sgi.com/ecartis to modify your settings or to unsubscribe.