linux.kernel - 26 new messages in 14 topics - digest
linux.kernel
http://groups.google.com/group/linux.kernel?hl=en
Today's topics:
* Linux kernel 2.6.33-rc5 bug report - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/572383a2abe784b9?hl=en
* softlockup: add sched_clock_tick() to avoid kernel warning on kgdb resume -
4 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/9346e7852bd8475c?hl=en
* dma: Add barrierless dma mapping/unmapping api - 2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/3756402bfba9b5ed?hl=en
* UBIFS assert failed in ubifs_dirty_inode - 2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/838d13a27418fece?hl=en
* sysfs_ops show vector: size of buffer not required? - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/8aafe8a10e8404cc?hl=en
* OOM-Killer kills too much with 2.6.32.2 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/3f7afc452c078f22?hl=en
* scripts/kallsyms build warning fix - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/9bf6bdfb46195075?hl=en
* starting emacs makes lockdep warning - 7 messages, 4 authors
http://groups.google.com/group/linux.kernel/t/b92a5fcdc20fcbff?hl=en
* High cpu temperature with 2.6.32 - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/79452d5903d061a3?hl=en
* Add type of locks to lock trace events - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/b401f2c4371a72bd?hl=en
* RFC: make struct platform_driver.id_table const - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/213e1f267bc227c8?hl=en
* sched: cpuacct: Use bigger percpu counter batch values for stats counters -
2 messages, 2 authors
http://groups.google.com/group/linux.kernel/t/bfd515678506951b?hl=en
* IO error semantics - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/4ac1e62d14e677fe?hl=en
* : Networking - 1 messages, 1 author
http://groups.google.com/group/linux.kernel/t/4455bf72dfef25ac?hl=en
==============================================================================
TOPIC: Linux kernel 2.6.33-rc5 bug report
http://groups.google.com/group/linux.kernel/t/572383a2abe784b9?hl=en
==============================================================================
== 1 of 1 ==
Date: Mon, Jan 25 2010 8:30 pm
From: Greg KH
On Mon, Jan 25, 2010 at 10:16:55AM +0000, d binderman wrote:
>
>
> Hello there,
>
> Greg wrote:
> > Care to make up a patch to fix this issue?
>
> Here is an untested trivial patch to fix a memory leak in Linux kernel
> 2.6.33-rc5 directory drivers/staging/otus
>
> From: David Binderman <dcb314@hotmail.com>
>
> Fix memory leak in drivers/staging/otus
>
> Signed-off-by: David Binderman <dcb314@hotmail.com>
>
> ---
>
>
> --- drivers/staging/otus/ioctl.c.sav??? 2010-01-25 09:45:30.000000000 +0000
> +++ drivers/staging/otus/ioctl.c??????? 2010-01-25 09:55:56.000000000 +0000
> @@ -866,15 +866,15 @@ int usbdrvwext_giwscan(struct net_device
> ??????? char *current_ev = extra;
> ??????? char *end_buf;
> ??????? int i;
> -?????? /* struct zsBssList BssList; */
> -?????? struct zsBssListV1 *pBssList = kmalloc(sizeof(struct zsBssListV1),
> -?????????????????????????????????????????????????????????????? GFP_KERNEL);
> ??????? /* BssList = wd->sta.pBssList; */
Very wierd characters here, can you attach the patch instead?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
==============================================================================
TOPIC: softlockup: add sched_clock_tick() to avoid kernel warning on kgdb
resume
http://groups.google.com/group/linux.kernel/t/9346e7852bd8475c?hl=en
==============================================================================
== 1 of 4 ==
Date: Mon, Jan 25 2010 8:30 pm
From: Jason Wessel
When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, sched_clock() gets the
time from hardware such as the TSC on x86. In this configuration kgdb
will report a softlock warning message on resuming or detaching from a
debug session.
Sequence of events in the problem case:
1) "cpu sched clock" and "hardware time" are at 100 sec prior
to a call to kgdb_handle_exception()
2) Debugger waits in kgdb_handle_exception() for 80 sec and on exit
the following is called ... touch_softlockup_watchdog() -->
__raw_get_cpu_var(touch_timestamp) = 0;
3) "cpu sched clock" = 100s (it was not updated, because the interrupt
was disabled in kgdb) but the "hardware time" = 180 sec
4) The first timer interrupt after resuming from kgdb_handle_exception
updates the watchdog from the "cpu sched clock"
update_process_times() { ... run_local_timers() --> softlockup_tick()
--> check (touch_timestamp == 0) (it is "YES" here, we have set
"touch_timestamp = 0" at kgdb) --> __touch_softlockup_watchdog()
***(A)--> reset "touch_timestamp" to "get_timestamp()" (Here, the
"touch_timestamp" will still be set to 100s.) ...
scheduler_tick() ***(B)--> sched_clock_tick() (update "cpu sched
clock" to "hardware time" = 180s) ... }
5) The Second timer interrupt handler appears to have a large jump and
trips the softlockup warning.
update_process_times() { ... run_local_timers() --> softlockup_tick()
--> "cpu sched clock" - "touch_timestamp" = 180s-100s > 60s --> printk
"soft lockup error messages" ... }
note: ***(A) reset "touch_timestamp" to "get_timestamp(this_cpu)"
Why is "touch_timestamp" 100 sec, instead of 180 sec?
When CONFIG_HAVE_UNSTABLE_SCHED_CLOCK is set, the call trace of
get_timestamp() is:
get_timestamp(this_cpu) -->cpu_clock(this_cpu)
-->sched_clock_cpu(this_cpu) -->__update_sched_clock(sched_clock_data,
now)
The __update_sched_clock() function uses the GTOD tick value to create
a window to normalize the "now" values. So if "now" value is too big
for sched_clock_data, it will be ignored.
The fix is to invoke sched_clock_tick() to update "cpu sched clock" in
order to recover from this state. This is done by introducing the
function touch_softlockup_watchdog_sync(). This allows kgdb to request
that the sched clock is updated when the watchdog thread runs the
first time after a resume from kgdb.
[yong.zhang0@gmail.com: Use per cpu instead of an array]
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
Signed-off-by: Dongdong Deng <Dongdong.Deng@windriver.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: peterz@infradead.org
---
include/linux/sched.h | 4 ++++
kernel/kgdb.c | 6 +++---
kernel/softlockup.c | 15 +++++++++++++++
3 files changed, 22 insertions(+), 3 deletions(-)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6f7bba9..8923215 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -310,6 +310,7 @@ extern void sched_show_task(struct task_struct *p);
#ifdef CONFIG_DETECT_SOFTLOCKUP
extern void softlockup_tick(void);
extern void touch_softlockup_watchdog(void);
+extern void touch_softlockup_watchdog_sync(void);
extern void touch_all_softlockup_watchdogs(void);
extern int proc_dosoftlockup_thresh(struct ctl_table *table, int write,
void __user *buffer,
@@ -323,6 +324,9 @@ static inline void softlockup_tick(void)
static inline void touch_softlockup_watchdog(void)
{
}
+static inline void touch_softlockup_watchdog_sync(void)
+{
+}
static inline void touch_all_softlockup_watchdogs(void)
{
}
diff --git a/kernel/kgdb.c b/kernel/kgdb.c
index c7ade62..761fdd2 100644
--- a/kernel/kgdb.c
+++ b/kernel/kgdb.c
@@ -599,7 +599,7 @@ static void kgdb_wait(struct pt_regs *regs)
/* Signal the primary CPU that we are done: */
atomic_set(&cpu_in_kgdb[cpu], 0);
- touch_softlockup_watchdog();
+ touch_softlockup_watchdog_sync();
clocksource_touch_watchdog();
local_irq_restore(flags);
}
@@ -1453,7 +1453,7 @@ acquirelock:
(kgdb_info[cpu].task &&
kgdb_info[cpu].task->pid != kgdb_sstep_pid) && --sstep_tries) {
atomic_set(&kgdb_active, -1);
- touch_softlockup_watchdog();
+ touch_softlockup_watchdog_sync();
clocksource_touch_watchdog();
local_irq_restore(flags);
@@ -1553,7 +1553,7 @@ kgdb_restore:
}
/* Free kgdb_active */
atomic_set(&kgdb_active, -1);
- touch_softlockup_watchdog();
+ touch_softlockup_watchdog_sync();
clocksource_touch_watchdog();
local_irq_restore(flags);
diff --git a/kernel/softlockup.c b/kernel/softlockup.c
index d225790..0d4c789 100644
--- a/kernel/softlockup.c
+++ b/kernel/softlockup.c
@@ -25,6 +25,7 @@ static DEFINE_SPINLOCK(print_lock);
static DEFINE_PER_CPU(unsigned long, softlockup_touch_ts); /* touch timestamp */
static DEFINE_PER_CPU(unsigned long, softlockup_print_ts); /* print timestamp */
static DEFINE_PER_CPU(struct task_struct *, softlockup_watchdog);
+static DEFINE_PER_CPU(bool, softlock_touch_sync);
static int __read_mostly did_panic;
int __read_mostly softlockup_thresh = 60;
@@ -79,6 +80,12 @@ void touch_softlockup_watchdog(void)
}
EXPORT_SYMBOL(touch_softlockup_watchdog);
+void touch_softlockup_watchdog_sync(void)
+{
+ __raw_get_cpu_var(softlock_touch_sync) = true;
+ __raw_get_cpu_var(softlockup_touch_ts) = 0;
+}
+
void touch_all_softlockup_watchdogs(void)
{
int cpu;
@@ -118,6 +125,14 @@ void softlockup_tick(void)
}
if (touch_ts == 0) {
+ if (unlikely(per_cpu(softlock_touch_sync, this_cpu))) {
+ /*
+ * If the time stamp was touched atomically
+ * make sure the scheduler tick is up to date.
+ */
+ per_cpu(softlock_touch_sync, this_cpu) = false;
+ sched_clock_tick();
+ }
__touch_softlockup_watchdog();
return;
}
--
1.6.3.3
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
== 2 of 4 ==
Date: Mon, Jan 25 2010 8:30 pm
From: Jason Wessel
The kernel debugger cannot take any locks at the risk of deadlocking
the system. This patch implements a simple reservation system using
an atomic variable initialized to the maximum number of system wide
breakpoints. Any time the variable is negative, there are no
remaining unreserved hw breakpoint slots.
The perf hw breakpoint API needs to keep the account correct for the
number of system wide breakpoints available at any given time. The
kernel debugger will use the same reservation semantics, but use the
low level API calls to install and remove breakpoints while general
kernel execution is paused.
CC: Frederic Weisbecker <fweisbec@gmail.com>
CC: Ingo Molnar <mingo@elte.hu>
CC: K.Prasad <prasad@linux.vnet.ibm.com>
CC: Peter Zijlstra <peterz@infradead.org>
CC: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Jason Wessel <jason.wessel@windriver.com>
---
arch/x86/kernel/kgdb.c | 12 +++++++++---
include/linux/perf_event.h | 1 +
kernel/hw_breakpoint.c | 16 ++++++++++++++++
3 files changed, 26 insertions(+), 3 deletions(-)
diff --git a/arch/x86/kernel/kgdb.c b/arch/x86/kernel/kgdb.c
index 3cb2828..2a31f35 100644
--- a/arch/x86/kernel/kgdb.c
+++ b/arch/x86/kernel/kgdb.c
@@ -251,6 +251,7 @@ kgdb_remove_hw_break(unsigned long addr, int len, enum kgdb_bptype bptype)
return -1;
breakinfo[i].enabled = 0;
+ atomic_inc(&dbg_slots_pinned);
return 0;
}
@@ -277,11 +278,13 @@ kgdb_set_hw_break(unsigned long addr, int len, enum kgdb_bptype bptype)
{
int i;
+ if (atomic_add_negative(-1, &dbg_slots_pinned))
+ goto err_out;
for (i = 0; i < 4; i++)
if (!breakinfo[i].enabled)
break;
if (i == 4)
- return -1;
+ goto err_out;
switch (bptype) {
case BP_HARDWARE_BREAKPOINT:
@@ -295,7 +298,7 @@ kgdb_set_hw_break(unsigned long addr, int len, enum kgdb_bptype bptype)
breakinfo[i].type = X86_BREAKPOINT_RW;
break;
default:
- return -1;
+ goto err_out;
}
switch (len) {
case 1:
@@ -313,12 +316,15 @@ kgdb_set_hw_break(unsigned long addr, int len, enum kgdb_bptype bptype)
break;
0 Comments:
Post a Comment
Subscribe to Post Comments [Atom]
<< Home