Bug 466929 - udev rule for hotplug rtctl
udev rule for hotplug rtctl
Status: CLOSED ERRATA
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-kernel (Show other bugs)
1.1
All Linux
medium Severity medium
: ---
: ---
Assigned To: Clark Williams
: FutureFeature
: 458276 (view as bug list)
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2008-10-14 11:25 EDT by Jon Masters
Modified: 2010-10-11 11:10 EDT (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
When drivers that register IRQ handlers were reloaded, IRQ priority changes made by the rtctl scripts were lost. To prevent this, an appropriate udev rule has been added to run rtctl whenever the IRQ threads are started, and the priority settings are now maintained as expected.
Story Points: ---
Clone Of:
Environment:
Last Closed: 2010-10-11 11:10:37 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description Jon Masters 2008-10-14 11:25:28 EDT
Description of problem:

We need a udev rule to handle hotplugging of devices (which includes CPUs) and restarting rtctl scripts.
Comment 1 Clark Williams 2008-11-06 21:37:32 EST
This udev rule seems to work on my laptop to cause 'rtctl' to be run when a device with an IRQ attribute is detected:

# rule to run rtctl when IRQ threads are started
ATTRS{irq}=="*",RUN+="/sbin/service rtctl restart"

I put this in /etc/udev/rules.d/99-threaded-irqs.rules and it was run following a resume and properly set the irq values.
Comment 2 Clark Williams 2008-11-20 16:29:23 EST
*** Bug 458276 has been marked as a duplicate of this bug. ***
Comment 3 Jon Masters 2009-03-13 15:20:08 EDT
Clark, what do you think about this?
Comment 4 Clark Williams 2009-03-13 15:29:26 EDT
I think it should go in.
Comment 5 Jon Masters 2009-06-25 18:17:21 EDT
Let's revive this bug as part of the ongoing documentation effort...we taking which rule then?
Comment 6 Clark Williams 2009-06-26 10:05:50 EDT
well, should we do this, or should we update rtctl and have the udev rule send a dbus message to an rtctl runin in --daemon mode?
Comment 7 Clark Williams 2009-07-07 15:18:50 EDT
addressed in rt-setup-1.3
Comment 8 Clark Williams 2009-07-16 13:14:13 EDT
Removed in rt-setup-1.4 due to problems with older udev not liking the ATTR{irq} attribute.
Comment 9 Jon Masters 2009-12-01 01:19:33 EST
Moving this one to Clark, since he owns the script :)
Comment 10 Clark Williams 2010-05-18 14:02:28 EDT
added in v1.8
Comment 11 Clark Williams 2010-10-04 15:14:32 EDT
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
* Cause: kthreads default to SCHED_FIFO:50 priority
* Consequence: when drivers that register IRQ handlers are reloaded, IRQ priority changes by rtctl are lost
* Fix: cause rtctl to be re-run via a udev rule when IRQ threads are noticed by udev
* Result: rtctl priority settings are maintained
Comment 13 Jon Masters 2010-10-05 12:58:34 EDT
Cool
Comment 14 David Sommerseth 2010-10-07 05:24:51 EDT
Verified by code review against rt-setup-1.7-2.

Found mechanisms triggering '/usr/sbin/rtctl reset' to be called on udev SYSFS{irq} events.  'rtctl reset' will make sure that all configured processes and threads do have the right priorities and CPU affinities.

Verified by tweaking rtctl and reloading USB modules.  The following patch was applied:

--- /usr/sbin/rtctl.orig	2010-10-07 05:14:31.000000000 -0400
+++ /usr/sbin/rtctl	2010-10-07 05:16:43.000000000 -0400
@@ -8,6 +8,8 @@
     exit 1
 }
 
+logger -t rtctl-review "rtctl called: $*"
+
 RTGROUPFILE=/etc/rtgroups
 case "$1" in 
     --file) 


The the following commands where issued:
# modprobe -r uhci_hcd ohci_hcd ehci_hcd
# modprobe ehci_hcd
# modprobe uhci_hcd
# modprobe ohci_hcd

/var/log/messages was then inspected with grep:
[root@hp-dl360g6-01 ~]# grep rtctl-review /var/log/messages
Oct  7 05:22:36 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:51 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:52 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:57 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:57 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:58 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:59 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:22:59 hp-dl360g6-01 rtctl-review: rtctl called: reset
Oct  7 05:23:00 hp-dl360g6-01 rtctl-review: rtctl called: reset
Comment 15 Jaromir Hradilek 2010-10-11 10:17:30 EDT
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,4 +1 @@
-* Cause: kthreads default to SCHED_FIFO:50 priority
+When drivers that register IRQ handlers were reloaded, IRQ priority changes made by the rtctl scripts were lost. To prevent this, an appropriate udev rule has been added to run rtctl whenever the IRQ threads are started, and the priority settings are now maintained as expected.-* Consequence: when drivers that register IRQ handlers are reloaded, IRQ priority changes by rtctl are lost
-* Fix: cause rtctl to be re-run via a udev rule when IRQ threads are noticed by udev
-* Result: rtctl priority settings are maintained
Comment 17 errata-xmlrpc 2010-10-11 11:10:37 EDT
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHBA-2010-0762.html

Note You need to log in before you can comment on or make changes to this bug.