Bug 466929 - udev rule for hotplug rtctl
Summary: udev rule for hotplug rtctl
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise MRG
Classification: Red Hat
Component: realtime-kernel
Version: 1.1
Hardware: All
OS: Linux
medium
medium
Target Milestone: ---
: ---
Assignee: Clark Williams
QA Contact:
URL:
Whiteboard:
: 458276 (view as bug list)
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2008-10-14 15:25 UTC by Jon Masters
Modified: 2010-10-11 15:10 UTC (History)
5 users (show)

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.
Clone Of:
Environment:
Last Closed: 2010-10-11 15:10:37 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2010:0762 0 normal SHIPPED_LIVE Red Hat Enterprise MRG Realtime bug fix and enhancement update 2010-10-11 15:10:12 UTC

Description Jon Masters 2008-10-14 15:25:28 UTC
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-07 02:37:32 UTC
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 21:29:23 UTC
*** Bug 458276 has been marked as a duplicate of this bug. ***

Comment 3 Jon Masters 2009-03-13 19:20:08 UTC
Clark, what do you think about this?

Comment 4 Clark Williams 2009-03-13 19:29:26 UTC
I think it should go in.

Comment 5 Jon Masters 2009-06-25 22:17:21 UTC
Let's revive this bug as part of the ongoing documentation effort...we taking which rule then?

Comment 6 Clark Williams 2009-06-26 14:05:50 UTC
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 19:18:50 UTC
addressed in rt-setup-1.3

Comment 8 Clark Williams 2009-07-16 17:14:13 UTC
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 06:19:33 UTC
Moving this one to Clark, since he owns the script :)

Comment 10 Clark Williams 2010-05-18 18:02:28 UTC
added in v1.8

Comment 11 Clark Williams 2010-10-04 19:14:32 UTC
    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 16:58:34 UTC
Cool

Comment 14 David Sommerseth 2010-10-07 09:24:51 UTC
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 14:17:30 UTC
    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 15:10:37 UTC
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.