├── LICENSE ├── README.md ├── debian ├── changelog ├── compat ├── control ├── copyright ├── rtirq.docs ├── rtirq.install └── rules ├── rtirq-resume.service ├── rtirq.conf ├── rtirq.service ├── rtirq.sh └── rtirq.spec /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 19yy 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) 19yy name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # rtirq 2 | rtirq - Startup script for realtime-preempt enabled kernels 3 | 4 | Your package manager may make this package available as `rtirq-init`. 5 | 6 | This script allows to make use of the threaded IRQs as used by real-time kernels or kernels >= 2.6.39 with the threadirqs kernel option enabled. 7 | 8 | `/usr/sbin/rtirq status` gives you an overview about the current IRQ status. 9 | 10 | To load the kernel with the threadirqs option, edit `/etc/default/grub` and change the line 11 | ``` 12 | GRUB_CMDLINE_LINUX="" 13 | ``` 14 | to 15 | ``` 16 | GRUB_CMDLINE_LINUX="threadirqs" 17 | ``` 18 | Then run `update-grub` with super-user privileges. 19 | 20 | You can adapt the priorities given to specific interrupts to the needs of your setup depending if you are using a soundcard on the USB or FireWire bus for instance. To do sp you can edit the rtirq config file, which typically will be installed in either of the directories: 21 | 22 | ``` 23 | /etc/rtirq.conf 24 | /etc/default/rtirq 25 | ``` 26 | 27 | The `RTIRQ_NAME_LIST` variable contains a list of space separated service names of which the first entry gets the highest priority. The term service seems to refer to module names and sound device designations (so the output of lsmod and aplay -l respectively) and doesn't have to correspond to the full output, part of the output may suffice as the rtirq script does the matching itself. 28 | 29 | The `RTIRQ_PRIO_HIGH` variable sets the highest priority a service can get assigned. 30 | 31 | The `RTIRQ_PRIO_DECR` lets you set the number with which the priorities for each consequent service mentioned in the `RTIRQ_NAME_LIST` variable should be decreased. 32 | 33 | The `RTIRQ_RESET_ALL` is a legacy variable and can best be left to default. 34 | 35 | The `RTIRQ_NON_THREADED` variable is another legacy option, your kernel configuration has to support it and in almost all cases it doesn't because the specific option, which was part of the `CONFIG_PREEMPT_VOLUNTARY` kernel config option and that allowed for setting non-threaded IRQs, simply doesn't exist anymore. So basically this variable doesn't do anything. 36 | 37 | The `RTIRQ_HIGH_LIST` variable contains a list of space separated service names that get priorities in the 99-91 range, so above the value as set in the `RTIRQ_PRIO_HIGH` variable. Use this variable only for services of which you want to be 100% sure they don't get interrupted by anything else. You will mostly want to put timers in there like rtc or the ALSA high resolution timer (snd-hrtimer). 38 | -------------------------------------------------------------------------------- /debian/changelog: -------------------------------------------------------------------------------- 1 | rtirq (20240905-48.1) unstable; urgency=low 2 | 3 | * Dropped duplicated PID printing from stop messages. 4 | * Vastly simplified `rtirq status` output. 5 | 6 | -- Rui Nuno Capela Thu, 5 Sep 2024 18:00:00 +0100 7 | 8 | rtirq (20240220-47.1) unstable; urgency=low 9 | 10 | * Added "snd-usb" keyword. (EXPERIMENTAL) 11 | 12 | -- Rui Nuno Capela Tue, 20 Feb 2024 12:00:00 +0000 13 | 14 | rtirq (20240120-46.1) unstable; urgency=low 15 | 16 | * Small typo fixed (by pallaswept) 17 | 18 | -- Rui Nuno Capela Sat, 20 Jan 2024 22:00:00 +0000 19 | 20 | rtirq (20240119-45.1) unstable; urgency=low 21 | 22 | * Small robustness increase (by capocasa) 23 | 24 | -- Rui Nuno Capela Fri, 19 Jan 2024 15:00:00 +0000 25 | 26 | rtirq (20220923-44.2) unstable; urgency=low 27 | 28 | * Fixed grep warning stray \ before /. 29 | * Replace obsolescent egrep for grep -E. 30 | 31 | -- Rui Nuno Capela Fri, 23 Sep 2022 12:00:00 +0100 32 | 33 | rtirq (20210329-43.1) unstable; urgency=low 34 | 35 | * Support dh_systemd included in debhelper (>= 11.1). 36 | 37 | -- Rui Nuno Capela Sat, 10 Apr 2021 12:00:00 +0100 38 | 39 | rtirq (20210329-43) unstable; urgency=low 40 | 41 | * First attempt to deploy as a pure systemd unit service on debian/ubuntu/etc. 42 | 43 | -- Rui Nuno Capela Mon, 29 Mar 2021 12:00:00 +0000 44 | 45 | rtirq (20210319-42) unstable; urgency=low 46 | 47 | * Force LC_ALL=C and fix local variables on main script. 48 | 49 | -- Rui Nuno Capela Fri, 19 Mar 2021 12:00:00 +0000 50 | 51 | rtirq (20210309-41) unstable; urgency=low 52 | 53 | * Rewrite attempt to save/restore state on start/stop resp. 54 | 55 | -- Rui Nuno Capela Tue, 9 Mar 2021 12:00:00 +0000 56 | 57 | rtirq (20210113-40) unstable; urgency=low 58 | 59 | * Getting rid of all the deprecated sysvinit stuff. 60 | 61 | -- Rui Nuno Capela Wed, 13 Jan 2021 12:00:00 +0000 62 | 63 | rtirq (20191121-38) unstable; urgency=low 64 | 65 | * Created debian packaging files. 66 | 67 | -- Rui Nuno Capela Thu, 21 Nov 2019 12:00:00 +0000 68 | 69 | -------------------------------------------------------------------------------- /debian/compat: -------------------------------------------------------------------------------- 1 | 10 2 | -------------------------------------------------------------------------------- /debian/control: -------------------------------------------------------------------------------- 1 | Source: rtirq 2 | Section: misc 3 | Priority: optional 4 | Maintainer: Rui Nuno Capela 5 | Build-Depends: debhelper (>= 10), dh-systemd (>= 1.5) | debhelper (>= 11.1) 6 | Standards-Version: 3.9.7 7 | Homepage: https://www.rncbc.org/archive/#rtirq 8 | 9 | Package: rtirq 10 | Architecture: all 11 | Depends: ${misc:Depends} 12 | Replaces: rtirq-init (<= ${source:Version}) 13 | Description: Realtime IRQ thread system tunning 14 | Startup scripts for tunning the realtime scheduling policy and priority 15 | of relevant IRQ service threads, featured for a PREEMPT_RT / threadirqs 16 | enabled kernel configuration. 17 | -------------------------------------------------------------------------------- /debian/copyright: -------------------------------------------------------------------------------- 1 | Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ 2 | Upstream-Name: rtirq 3 | Upstream-Contact: Rui Nuno Capela 4 | Source: http://www.rncbc.org/archive/#rtirq 5 | 6 | Files: * 7 | Copyright: 2004-2024 Rui Nuno Capela 8 | License: GPL-2+ 9 | This package is free software; you can redistribute it and/or modify 10 | it under the terms of the GNU General Public License as published by 11 | the Free Software Foundation; either version 2 of the License, or (at 12 | your option) any later version. 13 | . 14 | This package is distributed in the hope that it will be useful, but 15 | WITHOUT ANY WARRANTY; without even the implied warranty of 16 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 17 | General Public License for more details. 18 | . 19 | On Debian systems, the complete text of the GNU General Public 20 | License can be found in /usr/share/common-licenses/GPL-2. 21 | -------------------------------------------------------------------------------- /debian/rtirq.docs: -------------------------------------------------------------------------------- 1 | README.md 2 | LICENSE 3 | -------------------------------------------------------------------------------- /debian/rtirq.install: -------------------------------------------------------------------------------- 1 | rtirq usr/sbin/ 2 | rtirq.conf etc/ 3 | -------------------------------------------------------------------------------- /debian/rules: -------------------------------------------------------------------------------- 1 | #!/usr/bin/make -f 2 | %: 3 | dh $@ --with=systemd 4 | 5 | #override_dh_auto_clean: 6 | # rm -f debian/rtirq.rtirq.service 7 | # rm -f debian/rtirq.rtirq-resume.service 8 | # dh_auto_clean 9 | 10 | override_dh_auto_configure: 11 | override_dh_auto_build: 12 | override_dh_auto_install: 13 | install -vDm 755 rtirq.sh debian/tmp/rtirq 14 | install -vDm 644 rtirq.conf -t debian/tmp/ 15 | 16 | override_dh_installinit: 17 | cp -v rtirq.service debian/ 18 | cp -v rtirq-resume.service debian/ 19 | dh_systemd_enable --name=rtirq rtirq.service 20 | dh_systemd_enable --name=rtirq-resume rtirq-resume.service 21 | dh_installinit --no-start 22 | dh_installinit --name=rtirq --no-start --noscripts 23 | dh_installinit --name=rtirq-resume --no-start --noscripts 24 | dh_systemd_start rtirq.service --no-restart-on-upgrade 25 | 26 | #override_dh_installsystemd: 27 | # cp rtirq.service debian/rtirq.rtirq.service 28 | # cp rtirq-resume.service debian/rtirq.rtirq-resume.service 29 | # dh_installsystemd --name=rtirq 30 | # dh_installsystemd --name=rtirq-resume 31 | -------------------------------------------------------------------------------- /rtirq-resume.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Realtime IRQ thread system tuning (restart after suspend) 3 | After=multi-user.target suspend.target 4 | 5 | [Service] 6 | Type=simple 7 | ExecStart=/usr/sbin/rtirq start 8 | 9 | [Install] 10 | WantedBy=multi-user.target suspend.target 11 | -------------------------------------------------------------------------------- /rtirq.conf: -------------------------------------------------------------------------------- 1 | # 2 | # Copyright (C) 2004-2024, rncbc aka Rui Nuno Capela. 3 | # 4 | # This program is free software; you can redistribute it and/or 5 | # modify it under the terms of the GNU General Public License 6 | # as published by the Free Software Foundation; either version 2 7 | # of the License, or (at your option) any later version. 8 | # 9 | # This program is distributed in the hope that it will be useful, 10 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 11 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 | # GNU General Public License for more details. 13 | # 14 | # You should have received a copy of the GNU General Public License along 15 | # with this program; if not, write to the Free Software Foundation, Inc., 16 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 17 | # 18 | # /etc/rtirq.conf 19 | # 20 | # Configuration for IRQ thread tunning, 21 | # for preempt_rt/threadirqs enabled kernels. 22 | # 23 | # This program is free software; you can redistribute it and/or modify it 24 | # under the terms of the GNU General Public License version 2 or later. 25 | # 26 | 27 | # IRQ thread service names 28 | # (space separated list, from higher to lower priority). 29 | #RTIRQ_NAME_LIST="snd usb i8042" 30 | RTIRQ_NAME_LIST="snd snd-usb i8042" 31 | 32 | # Highest priority. 33 | RTIRQ_PRIO_HIGH=90 34 | 35 | # Priority decrease step. 36 | RTIRQ_PRIO_DECR=5 37 | 38 | # Lowest priority. 39 | RTIRQ_PRIO_LOW=51 40 | 41 | # Whether to reset all IRQ threads to SCHED_OTHER. 42 | RTIRQ_RESET_ALL=0 43 | 44 | # On kernel configurations that support it, 45 | # which services should be NOT threaded 46 | # (space separated list). 47 | RTIRQ_NON_THREADED="rtc snd" 48 | 49 | # Process names which will be forced to the 50 | # highest realtime priority range (99-91) 51 | # (space separated list, from highest to lower priority). 52 | #RTIRQ_HIGH_LIST="timer" 53 | 54 | # Save/restore state file path. 55 | #RTIRQ_STATE=/var/run/rtirq.state 56 | -------------------------------------------------------------------------------- /rtirq.service: -------------------------------------------------------------------------------- 1 | [Unit] 2 | Description=Realtime IRQ thread system tuning 3 | After=multi-user.target sound.target 4 | 5 | [Service] 6 | Type=oneshot 7 | ExecStart=/usr/sbin/rtirq start 8 | ExecStop=/usr/sbin/rtirq stop 9 | RemainAfterExit=true 10 | 11 | [Install] 12 | WantedBy=multi-user.target 13 | -------------------------------------------------------------------------------- /rtirq.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Copyright (C) 2004-2024, rncbc aka Rui Nuno Capela. 4 | # 5 | # This program is free software; you can redistribute it and/or 6 | # modify it under the terms of the GNU General Public License 7 | # as published by the Free Software Foundation; either version 2 8 | # of the License, or (at your option) any later version. 9 | # 10 | # This program is distributed in the hope that it will be useful, 11 | # but WITHOUT ANY WARRANTY; without even the implied warranty of 12 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 | # GNU General Public License for more details. 14 | # 15 | # You should have received a copy of the GNU General Public License along 16 | # with this program; if not, write to the Free Software Foundation, Inc., 17 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 18 | # 19 | # /usr/sbin/rtirq 20 | # 21 | # Startup script for PREEMPT_RT / threadirqs enabled kernels. 22 | # 23 | # This program is free software; you can redistribute it and/or modify it 24 | # under the terms of the GNU General Public License version 2 or later. 25 | # 26 | ### BEGIN INIT INFO 27 | # Provides: rtirq 28 | # Required-Start: $syslog $local_fs $remote_fs 29 | # Should-Start: $time alsa alsasound hotplug 30 | # Required-Stop: $syslog $local_fs $remote_fs 31 | # Should-Stop: $time alsa alsasound hotplug 32 | # Default-Start: 2 3 4 5 33 | # Default-Stop: 0 1 6 34 | # Short-Description: Realtime IRQ thread tunning. 35 | # Description: Change the realtime scheduling policy 36 | # and priority of relevant system driver IRQ handlers. 37 | ### END INIT INFO 38 | # 39 | export LC_ALL=C 40 | 41 | # Won't work without those binaries. 42 | for DIR in /sbin /usr/sbin /bin /usr/bin /usr/local/bin; do 43 | [ -z "${RTIRQ_CHRT}" -a -x ${DIR}/chrt ] && RTIRQ_CHRT=${DIR}/chrt 44 | done 45 | 46 | # Check for missing binaries (stale symlinks should not happen) 47 | [ -n "${RTIRQ_CHRT}" -a -x ${RTIRQ_CHRT} ] || { 48 | echo "$(basename $0): chrt: not installed." 49 | [ "$1" = "stop" ] && exit 0 || exit 5 50 | } 51 | 52 | # Check for existence of needed config file and read it. 53 | RTIRQ_CONFIG=/etc/rtirq.conf 54 | [ -r ${RTIRQ_CONFIG} ] || RTIRQ_CONFIG=/etc/default/rtirq 55 | [ -r ${RTIRQ_CONFIG} ] || { 56 | echo "$(basename $0): ${RTIRQ_CONFIG}: not found." 57 | [ "${RTIRQ_ACTION}" = "stop" ] && exit 0 || exit 6 58 | } 59 | 60 | # Read configuration. 61 | source ${RTIRQ_CONFIG} 62 | 63 | 64 | # Save/restore state file path (default). 65 | RTIRQ_STATE=${RTIRQ_STATE:-/var/run/rtirq.state} 66 | 67 | # Colon delimited trail list of already assigned IRQ numbers, 68 | # preventind lower priority override due to shared IRQs. 69 | RTIRQ_TRAIL=":" 70 | 71 | 72 | # 73 | # Get process-ids by thread handler names and IRQ number. 74 | # 75 | function rtirq_get_pids () 76 | { 77 | local NAME1=$1 78 | local NAME2=$2 79 | local IRQ=$3 80 | 81 | # Special for kernel-rt >= 2.6.31, where one can 82 | # prioritize shared IRQs by device driver (NAME2)... 83 | local PIDS="" 84 | # First try for IRQs re. PCI sound devices ("snd")... 85 | if [ "${NAME1}" == "snd" ] 86 | then 87 | PIDS=$(ps -eo pid,comm | grep -Ei "irq[^0-9]${IRQ}[^0-9]snd.*" | awk '{print $1}') 88 | fi 89 | if [ -z "${PIDS}" ] 90 | then 91 | PIDS=$(ps -eo pid,comm | grep -Ei "irq[^0-9]${IRQ}[^0-9]${NAME2:0:8}" | awk '{print $1}') 92 | fi 93 | # Backward compability for older kernel-rt < 2.6.31... 94 | if [ -z "${PIDS}" ] 95 | then 96 | PIDS=$(ps -eo pid,comm | grep -Ei "irq[^0-9]${IRQ}[^0-9]" | awk '{print $1}') 97 | fi 98 | echo ${PIDS} 99 | } 100 | 101 | 102 | # 103 | # Check for services that are to be (un)threaded. 104 | # 105 | function rtirq_threaded () 106 | { 107 | local ACTION=$1 108 | local NAME1=$2 109 | local NAME2=$3 110 | local IRQ=$4 111 | 112 | if [ -n "$(echo ':${RTIRQ_NON_THREADED}:' | sed 's/ /:/g' | grep ':${NAME1}:')" ] 113 | then 114 | for THREADED in /proc/irq/${IRQ}/*/threaded 115 | do 116 | local PREPEND="Setting IRQ non-threaded: ${ACTION} [${NAME2//_/ }] irq=${IRQ}" 117 | if [ -f "${THREADED}" ] 118 | then 119 | case ${ACTION} in 120 | *start) 121 | echo "${PREPEND}: ${THREADED}: OFF." 122 | echo -n 0 > "${THREADED}" 123 | ;; 124 | stop) 125 | echo "${PREPEND}: ${THREADED}: ON." 126 | echo -n 1 > "${THREADED}" 127 | ;; 128 | esac 129 | fi 130 | done 131 | fi 132 | } 133 | 134 | 135 | # 136 | # IRQ thread handler policy prioritizer, by IRQ number. 137 | # 138 | function rtirq_start_irq () 139 | { 140 | local NAME1=$1 141 | local NAME2=$2 142 | local PRI2=$3 143 | local IRQ=$4 144 | 145 | # Check for services that are to be non-threaded. 146 | rtirq_threaded start "${NAME1}" "${NAME2}" ${IRQ} 147 | # And now do the proper threading prioritization... 148 | if [ -z "$(echo ${RTIRQ_TRAIL} | grep ':${NAME2}.${IRQ}:')" ] 149 | then 150 | # Find the IRQ tasklets... 151 | PIDS=$(rtirq_get_pids "${NAME1}" "${NAME2}" ${IRQ}) 152 | # Whether a IRQ tasklet has been found. 153 | if [ -n "${PIDS}" ] 154 | then 155 | RTIRQ_TRAIL=":${NAME2}.${IRQ}${RTIRQ_TRAIL}" 156 | fi 157 | for PID in ${PIDS} 158 | do 159 | PREPEND="Setting IRQ priorities: start [${NAME2//_/ }] irq=${IRQ} pid=${PID}" 160 | # Save current state... 161 | local POL0=$(${RTIRQ_CHRT} -p ${PID} | awk '/policy/ {print $NF}') 162 | local PRI0=$(${RTIRQ_CHRT} -p ${PID} | awk '/priority/ {print $NF}') 163 | echo ${NAME1} ${NAME2} ${IRQ} ${PRI0} ${POL0} >> ${RTIRQ_STATE} 164 | # Start setting... 165 | local PREPEND="${PREPEND} prio=${PRI2}" 166 | if ${RTIRQ_CHRT} -p -f ${PRI2} ${PID} 167 | then 168 | echo "${PREPEND}: OK." 169 | else 170 | echo "${PREPEND}: FAILED." 171 | fi 172 | PRI2=$((${PRI2} - 1)) 173 | [ ${PRI2} -le ${PRI0_LOW} ] && PRI2=${PRI0_LOW} 174 | done 175 | fi 176 | } 177 | 178 | 179 | # 180 | # IRQ thread handler policy prioritizer, by service name. 181 | # 182 | function rtirq_start_name () 183 | { 184 | local NAME1=$1 185 | local NAME2=$2 186 | local PRI1=$3 187 | 188 | local IRQS=$(grep "${NAME2}" /proc/interrupts | awk -F: '{print $1}') 189 | for IRQ in ${IRQS} 190 | do 191 | rtirq_start_irq "${NAME1}" "${NAME2}" ${PRI1} ${IRQ} 192 | PRI1=$((${PRI1} - 1)) 193 | [ ${PRI1} -le ${PRI0_LOW} ] && PRI1=${PRI0_LOW} 194 | done 195 | } 196 | 197 | 198 | # 199 | # Generic process top prioritizer 200 | # 201 | function rtirq_high () 202 | { 203 | local ACTION=$1 204 | 205 | local PRI1=0 206 | case ${ACTION} in 207 | *start) 208 | PRI1=99 209 | ;; 210 | *) 211 | PRI1=50 212 | ;; 213 | esac 214 | 215 | # Process all configured process names... 216 | for NAME in ${RTIRQ_HIGH_LIST} 217 | do 218 | local PREPEND="Setting IRQ high-priorities: ${ACTION} [${NAME}]" 219 | local PIDS=$(ps -eo pid,comm | grep "${NAME}" | awk '{print $1}') 220 | for PID in ${PIDS} 221 | do 222 | if ${RTIRQ_CHRT} -p -f ${PRI1} ${PID} 223 | then 224 | echo "${PREPEND} pid=${PID} prio=${PRI1}: OK." 225 | else 226 | echo "${PREPEND} pid=${PID} prio=${PRI1}: FAILED." 227 | fi 228 | done 229 | [ ${PRI1} -gt ${RTIRQ_PRIO_HIGH} ] && PRI1=$((${PRI1} - 1)) 230 | done 231 | } 232 | 233 | 234 | # 235 | # Start/save state. 236 | # 237 | function rtirq_start () 238 | { 239 | # Check configured base priority. 240 | local PRI0=${RTIRQ_PRIO_HIGH:-90} 241 | [ $((${PRI0})) -gt 95 ] && PRI0=95 242 | [ $((${PRI0})) -lt 55 ] && PRI0=55 243 | # Check configured priority decrease step. 244 | local DECR=${RTIRQ_PRIO_DECR:-5} 245 | [ $((${DECR})) -gt 10 ] && DECR=10 246 | [ $((${DECR})) -lt 1 ] && DECR=1 247 | # Check configured lower limit of priority. 248 | PRI0_LOW=${RTIRQ_PRIO_LOW:-51} 249 | [ $((${PRI0_LOW})) -gt $((${PRI0})) ] && PRI0_LOW=${PRI0} 250 | [ $((${PRI0_LOW})) -lt 51 ] && PRI0_LOW=51 251 | # (Re)set all softirq-timer/s to highest priority. 252 | rtirq_high start 253 | # Clear save/restore state. 254 | rm -f ${RTIRQ_STATE} 255 | # Process all configured service names... 256 | for NAME in ${RTIRQ_NAME_LIST} 257 | do 258 | local PRI1=${PRI0} 259 | case ${NAME} in 260 | snd-usb) 261 | grep usb /proc/asound/cards | \ 262 | sed 's/[ ]*\(.*\) at usb-\(.*\)\-.*/\1|\2/' | \ 263 | while read SND_USB_LINE 264 | do 265 | NAME2=$(echo $SND_USB_LINE | cut -d\| -f1) 266 | DEV=$(echo $SND_USB_LINE | cut -d\| -f2) 267 | IRQ=$(cat /sys/devices/pci0000:00/${DEV}/irq 2>/dev/null) 268 | if [ -n "$IRQ" ]; then 269 | rtirq_start_irq "${NAME}" "${NAME2// /_}" ${PRI1} ${IRQ} 270 | PRI1=$((${PRI1} - 1)) 271 | [ ${PRI1} -le ${PRI0_LOW} ] && PRI1=${PRI0_LOW} 272 | fi 273 | done 274 | ;; 275 | snd) 276 | grep irq /proc/asound/cards | \ 277 | sed 's/\(.*\) at.* irq \(.*\)/\2 \1/;s/with .*//' | \ 278 | while read IRQ NAME1 279 | do 280 | grep "${NAME1}" /proc/asound/cards | \ 281 | grep ]: | sed 's/.*]: \(.*\) - .*/\1/' | \ 282 | while read NAME2 283 | do 284 | rtirq_start_irq "${NAME}" "${NAME2}" ${PRI1} ${IRQ} 285 | PRI1=$((${PRI1} - 1)) 286 | [ ${PRI1} -le ${PRI0_LOW} ] && PRI1=${PRI0_LOW} 287 | done 288 | done 289 | ;; 290 | usb) 291 | rtirq_start_name "${NAME}" "ohci.hcd" ${PRI0} 292 | rtirq_start_name "${NAME}" "uhci.hcd" ${PRI0} 293 | rtirq_start_name "${NAME}" "ehci.hcd" ${PRI0} 294 | rtirq_start_name "${NAME}" "xhci.hcd" ${PRI0} 295 | ;; 296 | *) 297 | rtirq_start_name "${NAME}" "${NAME}" ${PRI0} 298 | ;; 299 | esac 300 | [ ${PRI0} -gt ${DECR} ] && PRI0=$((${PRI0} - ${DECR})) 301 | [ ${PRI0} -le ${PRI0_LOW} ] && PRI0=${PRI0_LOW} 302 | done 303 | } 304 | 305 | 306 | # 307 | # Stop/restore state. 308 | # 309 | function rtirq_stop () 310 | { 311 | [ -f ${RTIRQ_STATE} ] && \ 312 | while read NAME1 NAME2 IRQ PRI0 POLICY 313 | do 314 | local PIDS=$(rtirq_get_pids "${NAME1}" "${NAME2}" ${IRQ}) 315 | for PID in ${PIDS} 316 | do 317 | local PREPEND="Setting IRQ priorities: stop [${NAME2//_/ }] irq=${IRQ} pid=${PID}" 318 | local OPTS="" 319 | case ${POLICY} in 320 | *SCHED_FIFO*) 321 | OPTS="${OPTS} -f" 322 | ;; 323 | *SCHED_RR*) 324 | OPTS="${OPTS} -r" 325 | ;; 326 | *SCHED_OTHER*) 327 | OPTS="${OPTS} -o" 328 | ;; 329 | *SCHED_BATCH*) 330 | OPTS="${OPTS} -b" 331 | ;; 332 | *SCHED_IDLE*) 333 | OPTS="${OPTS} -i" 334 | ;; 335 | *SCHED_RESET_ON_FORK*) 336 | OPTS="${OPTS} -R" 337 | ;; 338 | esac 339 | if ${RTIRQ_CHRT} ${OPTS} -p ${PRI0} ${PID} 340 | then 341 | echo "${PREPEND} prio=${PRI0}: OK." 342 | else 343 | echo "${PREPEND} prio=${PRI0}: FAILED." 344 | fi 345 | 346 | done 347 | rtirq_threaded stop "${NAME1}" "${NAME2}" ${IRQ} 348 | done < ${RTIRQ_STATE} 349 | # Clear save/restore state. 350 | rm -f ${RTIRQ_STATE} 351 | # Stop all softirq-timer/s from highest priority. 352 | rtirq_high stop 353 | } 354 | 355 | 356 | # 357 | # Reset policy of all IRQ threads out there. 358 | # 359 | function rtirq_reset () 360 | { 361 | PIDS=$(ps -eo pid,comm | grep -Ei "irq.[0-9]+" | awk '{print $1}') 362 | for PID in ${PIDS} 363 | do 364 | ${RTIRQ_CHRT} -p -f 50 ${PID} 365 | done 366 | # Reset all softirq-timer/s from highest priority. 367 | rtirq_high reset 368 | } 369 | 370 | # 371 | # Warn about prerequisites to script usefulness 372 | # 373 | function rtirq_check_sanity () 374 | { 375 | if [[ "$(uname -v)" == *"PREEMPT_RT"* ]]; then 376 | return 377 | fi 378 | if [[ "$(cat /proc/cmdline)" == *"threadirqs"* ]]; then 379 | return 380 | fi 381 | >&2 echo "WARNING: A realtime kernel or the threadirqs kernel parameter are required." 382 | } 383 | 384 | # 385 | # Main procedure line. 386 | # 387 | rtirq_check_sanity 388 | 389 | case $1 in 390 | start) 391 | if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ] 392 | then 393 | rtirq_reset 394 | fi 395 | rtirq_start 396 | ;; 397 | stop) 398 | rtirq_stop 399 | if [ "${RTIRQ_RESET_ALL}" = "yes" -o "${RTIRQ_RESET_ALL}" = "1" ] 400 | then 401 | rtirq_reset 402 | fi 403 | ;; 404 | reset) 405 | rtirq_reset 406 | ;; 407 | restart|force-reload) 408 | $0 stop || true 409 | $0 start 410 | ;; 411 | status) 412 | echo 413 | #rtirq_exec status 414 | ps -eo pid,class,rtprio,ni,pri,pcpu,stat,comm --sort -rtprio \ 415 | | grep -E '(^[ |\t]*PID|irq/)' 416 | # | grep -E '(^[ |\t]*PID|IRQ|softirq|sirq|irq/)' \ 417 | # | awk 'BEGIN { 418 | # while (getline IRQLine < "/proc/interrupts") { 419 | # split(IRQLine, IRQSplit, ":[ |\t|0-9]+"); 420 | # if (match(IRQSplit[1], "^[ |\t]*[0-9]+$")) { 421 | # gsub("[^ |\t]+(PIC|MSI)[^ |\t]*[ |\t]+" \ 422 | # "|\\[[^\\]]+\\][^ |\t]*[ |\t]+", 423 | # "", IRQSplit[2]); 424 | # IRQTable[IRQSplit[1] + 0] = IRQSplit[2]; 425 | # } 426 | # } 427 | # } { if ($9 == "") 428 | # { print $0"\tA("$8"):"IRQTable[substr($8,5)]; } 429 | # else 430 | # { print $0"\tB("$9"):"IRQTable[$9]; } }' 431 | echo 432 | ;; 433 | *) 434 | echo 435 | echo " Usage: $0 {[re]start|stop|reset|status|force-reload}" 436 | echo 437 | exit 1 438 | ;; 439 | esac 440 | 441 | exit 0 442 | -------------------------------------------------------------------------------- /rtirq.spec: -------------------------------------------------------------------------------- 1 | # 2 | # spec file for package rtirq 3 | # 4 | # Copyright (C) 2004-2024, rncbc aka Rui Nuno Capela. All rights reserved. 5 | # 6 | # All modifications and additions to the file contributed by third parties 7 | # remain the property of their copyright owners, unless otherwise agreed 8 | # upon. The license for this file, and modifications and additions to the 9 | # file, is the same license as for the pristine package itself (unless the 10 | # license for the pristine package is not an Open Source License, in which 11 | # case the license is the MIT License). An "Open Source License" is a 12 | # license that conforms to the Open Source Definition (Version 1.9) 13 | # published by the Open Source Initiative. 14 | # 15 | # Please submit bugfixes or comments via http://bugs.opensuse.org/ 16 | # 17 | 18 | %define name rtirq 19 | %define version 20240905 20 | %define release 48.1 21 | 22 | %if %{defined fedora} 23 | %define debug_package %{nil} 24 | %endif 25 | 26 | Summary: Realtime IRQ thread system tunning 27 | Name: %{name} 28 | Version: %{version} 29 | Release: %{release} 30 | License: GPL-2.0+ 31 | Packager: rncbc.org 32 | Group: System Environment/Base 33 | Source0: %{name}-%{version}.tar.gz 34 | BuildRoot: /var/tmp/%{name}-%{version}-buildroot 35 | BuildArch: noarch 36 | 37 | BuildRequires: coreutils 38 | BuildRequires: util-linux 39 | BuildRequires: systemd 40 | 41 | %description 42 | Startup scripts for tunning the realtime scheduling policy and priority 43 | of relevant IRQ service threads, featured for a PREEMPT_RT / threadirqs 44 | enabled kernel configuration. 45 | 46 | %prep 47 | 48 | %setup 49 | 50 | %build 51 | 52 | %install 53 | %__rm -rf %{buildroot} 54 | install -d %{buildroot}%{_sbindir} 55 | install -vD rtirq.sh -m 0755 %{buildroot}%{_sbindir}/rtirq 56 | install -vD rtirq.conf -m 0644 %{buildroot}%{_sysconfdir}/rtirq.conf 57 | install -vD rtirq.service -m 0644 %{buildroot}%{_prefix}/lib/systemd/system/rtirq.service 58 | install -vD rtirq-resume.service -m 0644 %{buildroot}%{_prefix}/lib/systemd/system/rtirq-resume.service 59 | 60 | %post 61 | # Only run on install, not upgrade. 62 | if [ "$1" = "1" ]; then 63 | systemctl enable rtirq.service 64 | systemctl enable rtirq-resume.service 65 | fi 66 | 67 | %preun 68 | # Only run if this is the last instance to be removed. 69 | if [ "$1" = "0" ]; then 70 | systemctl disable rtirq-resume.service 71 | systemctl disable rtirq.service 72 | fi 73 | 74 | %clean 75 | %__rm -rf %{buildroot} 76 | 77 | %files 78 | %defattr(-,root,root) 79 | %doc README.md LICENSE 80 | %{_sbindir}/rtirq 81 | %config(noreplace) %{_sysconfdir}/rtirq.conf 82 | %dir %{_prefix}/lib/systemd 83 | %dir %{_prefix}/lib/systemd/system 84 | %{_prefix}/lib/systemd/system/rtirq.service 85 | %{_prefix}/lib/systemd/system/rtirq-resume.service 86 | 87 | %changelog 88 | * Thu Sep 5 2024 Rui Nuno Capela 89 | - Dropped duplicated PID printing from stop messages. 90 | - Vastly simplified `rtirq status` output. 91 | - Version 20240905-48.1 92 | * Tue Feb 20 2024 Rui Nuno Capela 93 | - Added "snd-usb" keyword. (EXPERIMENTAL) 94 | - Version 20240220-47.1 95 | * Sat Jan 20 2024 Rui Nuno Capela 96 | - Small typo fixed (by pallaswept) 97 | - Version 20240120-46.1 98 | * Sat Jan 20 2024 Rui Nuno Capela 99 | - Small robustness increase (by capocasa) 100 | - Version 20240119-45.1 101 | * Fri Sep 23 2022 Rui Nuno Capela 102 | - Fixed grep warning stray \ before /. 103 | - Replace obsolescent egrep for grep -E. 104 | - Version 20220923-44.2 105 | * Sat Apr 10 2021 Rui Nuno Capela 106 | - Version 20210329-43.1 107 | * Mon Mar 29 2021 Rui Nuno Capela 108 | - First attempt to deploy as a pure systemd unit service on debian/ubuntu/etc. 109 | - Version 20210329 110 | * Fri Mar 19 2021 Rui Nuno Capela 111 | - Force LC_ALL=C and fix local variables on main script. 112 | - Version 20210319 113 | * Tue Mar 9 2021 Rui Nuno Capela 114 | - Rewrite attempt to save/restore state on start/stop resp. 115 | - Version 20210309 116 | * Wed Jan 13 2021 Rui Nuno Capela 117 | - Getting rid of all the deprecated sysvinit stuff. 118 | - Version 20210113 119 | * Thu Nov 21 2019 Rui Nuno Capela 120 | - Created debian packaging files. 121 | * Tue Jan 29 2019 Rui Nuno Capela 122 | - Restart rtirq service after resume from suspend (by Térence Clastres). 123 | - Fix for some Intel internal and USB stuff (by Samuel Pelegrinello). 124 | - Version 20190129. 125 | * Fri Feb 9 2018 Rui Nuno Capela 126 | - Always reset/stop to scheduling policy=SCHED_FIFO and priority=50. 127 | - Version 20180209. 128 | * Mon Feb 16 2015 Rui Nuno Capela 129 | - Added "xhci_hcd" (USB 3.x) to "usb" keyword roster. 130 | - Removed (old) "rtc" from default config list. 131 | - Version 20150216. 132 | * Sun Apr 13 2014 Rui Nuno Capela 133 | - Fixed shared IRQ issues on same service class (eg. snd). 134 | - Version 20140413. 135 | * Mon Sep 9 2013 Rui Nuno Capela 136 | - After targets added to systemd unit. 137 | - Version 20130909. 138 | * Tue Apr 2 2013 Rui Nuno Capela 139 | - Include systemd unit (by Simon Lewis). 140 | - Version 20130402. 141 | * Mon Nov 5 2012 Rui Nuno Capela 142 | - Version 20121105. 143 | * Sat May 5 2012 Rui Nuno Capela 144 | - Version 20120505. 145 | * Fri Oct 7 2011 Rui Nuno Capela 146 | - Version 20111007. 147 | * Mon Mar 14 2011 Rui Nuno Capela 148 | - Version 20110314. 149 | * Sun Sep 20 2009 Rui Nuno Capela 150 | - Version 20090920. 151 | * Fri Sep 11 2009 Rui Nuno Capela 152 | - Fixed for rtc being missed on newer kernel-rt >= 2.6.31. 153 | - Version 20090911. 154 | * Mon Aug 10 2009 Rui Nuno Capela 155 | - Fixed some specific gawk regex particles for portability sake. 156 | - Version 20090810. 157 | * Sat Aug 8 2009 Rui Nuno Capela 158 | - Starting from kernel-rt >= 2.6.31 the IRQ service threads are 159 | now being separate to its own and corresponding device-driver, 160 | giving chance for shared IRQ line tuning resolution. 161 | - Version up to 20090828. 162 | * Fri Jun 26 2009 Rui Nuno Capela 163 | - Fix status on newer kernels naming soft-irq threads with this 164 | shorter prefix "sirq-..." instead of older "softirq-...". 165 | - Version bump to 20090626. 166 | * Sat Jan 31 2009 Rui Nuno Capela 167 | - Ubuntustudio contributed patches. 168 | - LICENSE file added to distribution tarball. 169 | * Fri Oct 12 2007 Rui Nuno Capela 170 | * Mon Jan 1 2007 Rui Nuno Capela 171 | - Force bash as specific shell interpreter. 172 | - Add default support for alternate configuration file locations. 173 | - Stamped with 20071012 version. 174 | * Sat Dec 16 2006 Rui Nuno Capela 175 | - Make headers clear that this is GPLed software. 176 | - Got rid of those softirq-timer highest priority by default. 177 | - Going up for 20061216 encarnation. 178 | * Sat Aug 19 2006 Rui Nuno Capela 179 | - Apparently the echo to /proc/...threaded does not like a final CR, 180 | as noted by Fernando Lopez-Lezcano on a PREEMPT_DESKTOP kernel. 181 | - Bumped to 20060819 version. 182 | * Thu Aug 17 2006 Rui Nuno Capela 183 | - Bumped to 20060817 version. 184 | * Sat Feb 18 2006 Rui Nuno Capela 185 | - Set all softirq-timers to highest priority; 20060218 version. 186 | * Wed Sep 14 2005 Rui Nuno Capela 187 | - Touched to 20050914 version. 188 | * Tue Aug 16 2005 Rui Nuno Capela 189 | - Fixed to 20050816 version. 190 | * Mon Jun 20 2005 Rui Nuno Capela 191 | - Up to 20050620 tinyfix version. 192 | * Wed Jun 8 2005 Rui Nuno Capela 193 | - Fixes on non threading IRQ service (thanks to Luis Garrido). 194 | - Bumped to 20050608 version. 195 | * Wed Jun 1 2005 Rui Nuno Capela 196 | - Missing info on status list was fixed for IRQs>99. 197 | - Moved to 20050601 version. 198 | * Fri Apr 15 2005 Rui Nuno Capela 199 | - Non threading IRQ service list configuration option. 200 | - Moved to 20050415 version. 201 | * Fri Apr 8 2005 Rui Nuno Capela 202 | - IRQ handler refrence name included on status listing. 203 | - Prevent lower priority overriding due to shared IRQs. 204 | - Fixed to 20050408 version. 205 | * Fri Nov 12 2004 Rui Nuno Capela 206 | - Bumped to 20041112 version. 207 | * Mon Nov 8 2004 Rui Nuno Capela 208 | - Update for the new 20041108 version. 209 | * Thu Nov 4 2004 Rui Nuno Capela 210 | - Created initial rtirq.spec 211 | --------------------------------------------------------------------------------