Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 311195
b: refs/heads/master
c: 8ed9eac
h: refs/heads/master
i:
  311193: 2b1e7ec
  311191: d1086cd
v: v3
  • Loading branch information
Ingo Molnar committed Jun 15, 2012
1 parent 75cfba1 commit 0544de4
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 3 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: cb9dd49e11f83d548c822d7022ac180b0518b25c
refs/heads/master: 8ed9eac4769407a8f0b93e381a3bc3ae81fa014b
2 changes: 1 addition & 1 deletion trunk/arch/x86/lib/usercopy.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ copy_from_user_nmi(void *to, const void __user *from, unsigned long n)
void *map;
int ret;

if (__range_not_ok(from, n, TASK_SIZE) == 0)
if (__range_not_ok(from, n, TASK_SIZE))
return len;

do {
Expand Down
19 changes: 18 additions & 1 deletion trunk/kernel/watchdog.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,13 @@ static int watchdog(void *unused)


#ifdef CONFIG_HARDLOCKUP_DETECTOR
/*
* People like the simple clean cpu node info on boot.
* Reduce the watchdog noise by only printing messages
* that are different from what cpu0 displayed.
*/
static unsigned long cpu0_err;

static int watchdog_nmi_enable(int cpu)
{
struct perf_event_attr *wd_attr;
Expand All @@ -390,11 +397,21 @@ static int watchdog_nmi_enable(int cpu)

/* Try to register using hardware perf events */
event = perf_event_create_kernel_counter(wd_attr, cpu, NULL, watchdog_overflow_callback, NULL);

/* save cpu0 error for future comparision */
if (cpu == 0 && IS_ERR(event))
cpu0_err = PTR_ERR(event);

if (!IS_ERR(event)) {
pr_info("enabled, takes one hw-pmu counter.\n");
/* only print for cpu0 or different than cpu0 */
if (cpu == 0 || cpu0_err)
pr_info("enabled on all CPUs, permanently consumes one hw-PMU counter.\n");
goto out_save;
}

/* skip displaying the same error again */
if (cpu > 0 && (PTR_ERR(event) == cpu0_err))
return PTR_ERR(event);

/* vary the KERN level based on the returned errno */
if (PTR_ERR(event) == -EOPNOTSUPP)
Expand Down

0 comments on commit 0544de4

Please sign in to comment.