Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 191959
b: refs/heads/master
c: 7683a3f
h: refs/heads/master
i:
  191957: ccec802
  191955: d827303
  191951: 0385186
v: v3
  • Loading branch information
Akinobu Mita authored and Tony Luck committed May 18, 2010
1 parent e53ff78 commit 4cb58c2
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 26 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 552dce3a071f0de2a84023fbba7f3b4ac36602cd
refs/heads/master: 7683a3f9748f7adfbe47e33002a4f710ab557293
9 changes: 3 additions & 6 deletions trunk/arch/ia64/kernel/irq_ia64.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
#include <linux/threads.h>
#include <linux/bitops.h>
#include <linux/irq.h>
#include <linux/ratelimit.h>

#include <asm/delay.h>
#include <asm/intrinsics.h>
Expand Down Expand Up @@ -467,13 +468,9 @@ ia64_handle_irq (ia64_vector vector, struct pt_regs *regs)
sp = ia64_getreg(_IA64_REG_SP);

if ((sp - bsp) < 1024) {
static unsigned char count;
static long last_time;
static DEFINE_RATELIMIT_STATE(ratelimit, 5 * HZ, 5);

if (time_after(jiffies, last_time + 5 * HZ))
count = 0;
if (++count < 5) {
last_time = jiffies;
if (__ratelimit(&ratelimit)) {
printk("ia64_handle_irq: DANGER: less than "
"1KB of free stack space!!\n"
"(bsp=0x%lx, sp=%lx)\n", bsp, sp);
Expand Down
24 changes: 5 additions & 19 deletions trunk/arch/ia64/kernel/unaligned.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include <linux/kernel.h>
#include <linux/sched.h>
#include <linux/tty.h>
#include <linux/ratelimit.h>

#include <asm/intrinsics.h>
#include <asm/processor.h>
Expand Down Expand Up @@ -1283,24 +1284,9 @@ emulate_store_float (unsigned long ifa, load_store_t ld, struct pt_regs *regs)
/*
* Make sure we log the unaligned access, so that user/sysadmin can notice it and
* eventually fix the program. However, we don't want to do that for every access so we
* pace it with jiffies. This isn't really MP-safe, but it doesn't really have to be
* either...
* pace it with jiffies.
*/
static int
within_logging_rate_limit (void)
{
static unsigned long count, last_time;

if (time_after(jiffies, last_time + 5 * HZ))
count = 0;
if (count < 5) {
last_time = jiffies;
count++;
return 1;
}
return 0;

}
static DEFINE_RATELIMIT_STATE(logging_rate_limit, 5 * HZ, 5);

void
ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
Expand Down Expand Up @@ -1337,7 +1323,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)

if (!no_unaligned_warning &&
!(current->thread.flags & IA64_THREAD_UAC_NOPRINT) &&
within_logging_rate_limit())
__ratelimit(&logging_rate_limit))
{
char buf[200]; /* comm[] is at most 16 bytes... */
size_t len;
Expand Down Expand Up @@ -1370,7 +1356,7 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
}
}
} else {
if (within_logging_rate_limit()) {
if (__ratelimit(&logging_rate_limit)) {
printk(KERN_WARNING "kernel unaligned access to 0x%016lx, ip=0x%016lx\n",
ifa, regs->cr_iip + ipsr->ri);
if (unaligned_dump_stack)
Expand Down

0 comments on commit 4cb58c2

Please sign in to comment.