403Webshell
Server IP : 23.254.227.96  /  Your IP : 216.73.216.7
Web Server : Apache/2.4.62 (Unix) OpenSSL/1.1.1k
System : Linux hwsrv-1277026.hostwindsdns.com 4.18.0-477.13.1.el8_8.x86_64 #1 SMP Tue May 30 14:53:41 EDT 2023 x86_64
User : viralblo ( 1001)
PHP Version : 8.1.31
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : ON  |  Perl : ON  |  Python : OFF  |  Sudo : ON  |  Pkexec : ON
Directory :  /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : /usr/lib/python3.6/site-packages/tuned/plugins/__pycache__/plugin_vm.cpython-36.opt-1.pyc
3

��cN
�@sfddlmZddlTddlZddlZddlZddlZddlm	Z	ej
j�Ze	�Z
Gdd�dej�ZdS)�)�base)�*�N)�commandsc@s�eZdZdZedd��Zdd�Zdd�Zedd	��Ze	d
�dd��Z
e	d
�dd��Zed
�dd��Z
ed
�dd��Ze	d�dd��Zed�dd��ZdS)�VMPlugina|
	`vm`::
	
	Enables or disables transparent huge pages depending on value of the
	[option]`transparent_hugepages` option. The option can have one of three
	possible values `always`, `madvise` and `never`.
	+
	.Disable transparent hugepages
	====
	----
	[vm]
	transparent_hugepages=never
	----
	====
	+
	The [option]`transparent_hugepage.defrag` option specifies the
	defragmentation policy. Possible values for this option are `always`,
	`defer`, `defer+madvise`, `madvise` and `never`. For a detailed
	explanation of these values refer to
	link:https://www.kernel.org/doc/Documentation/vm/transhuge.txt[Transparent Hugepage Support].
	cCsdddd�S)N)�transparent_hugepages�transparent_hugepageztransparent_hugepage.defrag�)�selfr	r	�/usr/lib/python3.6/plugin_vm.py�_get_config_options$szVMPlugin._get_config_optionscCsd|_d|_dS)NTF)Z_has_static_tuningZ_has_dynamic_tuning)r
�instancer	r	r�_instance_init,szVMPlugin._instance_initcCsdS)Nr	)r
r
r	r	r�_instance_cleanup0szVMPlugin._instance_cleanupcCsd}tjj|�sd}|S)Nz#/sys/kernel/mm/transparent_hugepagez*/sys/kernel/mm/redhat_transparent_hugepage)�os�path�exists)r
rr	r	r�	_thp_path3szVMPlugin._thp_pathrcCs�|d
kr"|stjdt|��dStjddd�}|jd�d	krP|sLtjd
�dStjj	|j
�d�}tjj|�r�|s~tj||�|S|s�tjd�dSdS)N�always�never�madvisez-Incorrect 'transparent_hugepages' value '%s'.z
/proc/cmdlineT)Zno_errorztransparent_hugepage=rzWtransparent_hugepage is already set in kernel boot cmdline, ignoring value from profile�enabledzDOption 'transparent_hugepages' is not supported on current hardware.)rrr)
�log�warn�str�cmd�	read_file�find�inforr�joinrr�
write_to_file)r
�value�simZcmdline�sys_filer	r	r�_set_transparent_hugepages;s"

z#VMPlugin._set_transparent_hugepagesrcCs|j||�dS)N)r$)r
r!r"r	r	r�_set_transparent_hugepageSsz"VMPlugin._set_transparent_hugepagecCs6tjj|j�d�}tjj|�r.tjtj|��SdSdS)Nr)rrrrrr�get_active_optionr)r
r#r	r	r�_get_transparent_hugepagesWsz#VMPlugin._get_transparent_hugepagescCs|j�S)N)r')r
r	r	r�_get_transparent_hugepage`sz"VMPlugin._get_transparent_hugepageztransparent_hugepage.defragcCsHtjj|j�d�}tjj|�r2|s.tj||�|S|s@tjd�dSdS)N�defragzJOption 'transparent_hugepage.defrag' is not supported on current hardware.)	rrrrrrr rr)r
r!r"r#r	r	r� _set_transparent_hugepage_defragds
z)VMPlugin._set_transparent_hugepage_defragcCs6tjj|j�d�}tjj|�r.tjtj|��SdSdS)Nr))rrrrrrr&r)r
r#r	r	r� _get_transparent_hugepage_defragpsz)VMPlugin._get_transparent_hugepage_defragN)�__name__�
__module__�__qualname__�__doc__�classmethodrrrrZcommand_setr$r%Zcommand_getr'r(r*r+r	r	r	rr
s	r)�rZ
decoratorsZ
tuned.logsZtunedr�structZglobZtuned.utils.commandsrZlogs�getrrZPluginrr	r	r	r�<module>s


Youez - 2016 - github.com/yon3zu
LinuXploit