← Back
Editing: plugin_irqbalance.cpython-312.opt-1.pyc
� �]�i( � � � d dl mZ d dlmZ ddlmZ ddlZddlZddlZej j � Z G d� dej � Z y)� )�base)�command_custom� )�constsNc � � � e Zd ZdZ� fd�Zd� Zd� Zed� � Zd� Z d� Z d� Zd � Zd � Z d� Zd� Z ed d�� d� � Z� xZS )�IrqbalancePlugina� Plug-in for irqbalance settings management. The plug-in configures CPUs which should be skipped when rebalancing IRQs in `/etc/sysconfig/irqbalance`. It then restarts irqbalance if and only if it was previously running. The banned/skipped CPUs are specified as a CPU list via the [option]`banned_cpus` option. .Skip CPUs 2,4 and 9-13 when rebalancing IRQs ==== ---- [irqbalance] banned_cpus=2,4,9-13 ---- ==== c �j �� t t | � |i |�� | j j � | _ y �N)�superr �__init__�_cmd�get_cpus�_cpus)�self�args�kwargs� __class__s ��D/usr/lib/python3.12/site-packages/tuned/plugins/plugin_irqbalance.pyr zIrqbalancePlugin.__init__ s, �� ���$�(�$�9�&�9��y�y�!�!�#�$�*� c � � d|_ d|_ y )NFT)�_has_dynamic_tuning�_has_static_tuning�r �instances r �_instance_initzIrqbalancePlugin._instance_init! s � �!&�(�� $�(�r c � � y r � r s r �_instance_cleanupz"IrqbalancePlugin._instance_cleanup% s � �r c � � dd iS )N�banned_cpusr )�clss r �_get_config_optionsz$IrqbalancePlugin._get_config_options( s � � �$� � r c �F � t t j d� 5 }|j � cd d d � S # 1 sw Y y xY w# t $ rU}|j t j k( rt j d� nt j d|z � Y d }~y d }~ww xY w)N�rz>irqbalance sysconfig file is missing. Is irqbalance installed?z,Failed to read irqbalance sysconfig file: %s) �openr �IRQBALANCE_SYSCONFIG_FILE�read�IOError�errno�ENOENT�log�warning�error)r �f�es r �_read_irqbalance_sysconfigz+IrqbalancePlugin._read_irqbalance_sysconfig. so � ���V� -� -�s�3�q��6�6�8� 4�3�3�� � ��g�g������K�K�P�Q��I�I�<�q�@�A� ���s/ �A �6� A �?�A �A � B �AB�B c �� � t t j d� 5 }|j |� d d d � y# 1 sw Y yxY w# t $ r"}t j d|z � Y d }~yd }~ww xY w)N�wTz-Failed to write irqbalance sysconfig file: %sF)r% r r&