Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 138628
b: refs/heads/master
c: 9bd9840
h: refs/heads/master
v: v3
  • Loading branch information
Andi Kleen authored and H. Peter Anvin committed Feb 17, 2009
1 parent c59a091 commit 0f4c510
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 8 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: 123aa76ec0cab5d4881cd8509faed43231e68801
refs/heads/master: 9bd984058088d6ef7af6946591a207e51a2f4890
25 changes: 18 additions & 7 deletions trunk/arch/x86/kernel/cpu/mcheck/mce_64.c
Original file line number Diff line number Diff line change
Expand Up @@ -380,11 +380,17 @@ static void mcheck_timer(struct work_struct *work)
schedule_delayed_work(&mcheck_work, next_interval);
}

static void mce_do_trigger(struct work_struct *work)
{
call_usermodehelper(trigger, trigger_argv, NULL, UMH_NO_WAIT);
}

static DECLARE_WORK(mce_trigger_work, mce_do_trigger);

/*
* This is only called from process context. This is where we do
* anything we need to alert userspace about new MCEs. This is called
* directly from the poller and also from entry.S and idle, thanks to
* TIF_MCE_NOTIFY.
* Notify the user(s) about new machine check events.
* Can be called from interrupt context, but not from machine check/NMI
* context.
*/
int mce_notify_user(void)
{
Expand All @@ -394,9 +400,14 @@ int mce_notify_user(void)
unsigned long now = jiffies;

wake_up_interruptible(&mce_wait);
if (trigger[0])
call_usermodehelper(trigger, trigger_argv, NULL,
UMH_NO_WAIT);

/*
* There is no risk of missing notifications because
* work_pending is always cleared before the function is
* executed.
*/
if (trigger[0] && !work_pending(&mce_trigger_work))
schedule_work(&mce_trigger_work);

if (time_after_eq(now, last_print + (check_interval*HZ))) {
last_print = now;
Expand Down

0 comments on commit 0f4c510

Please sign in to comment.