Sh3ll
OdayForums


Server : Apache
System : Linux server1.cgrithy.com 3.10.0-1160.95.1.el7.x86_64 #1 SMP Mon Jul 24 13:59:37 UTC 2023 x86_64
User : nobody ( 99)
PHP Version : 8.1.23
Disable Function : NONE
Directory :  /usr/lib/python2.7/site-packages/tuned/plugins/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyo
�
��\c@s�ddlmZddlTddlZddlZddlZddlZddlm	Z	ej
j�Ze	�Z
dejfd��YZdS(i(tbase(t*i����N(tcommandstVMPlugincBs�eZdZed��Zd�Zd�Zed��Zed�d��Z	ed�d��Z
ed�d	��Zed�d
��Z
ed�d��Zed�d
��ZRS(s(
	Plugin for tuning memory management.
	cCsidd6dd6dd6S(Nttransparent_hugepagesttransparent_hugepagestransparent_hugepage.defrag(tNone(tself((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_get_config_optionsscCst|_t|_dS(N(tTruet_has_static_tuningtFalset_has_dynamic_tuning(Rtinstance((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_instance_inits	cCsdS(N((RR
((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_instance_cleanupscCs%d}tjj|�s!d}n|S(Ns#/sys/kernel/mm/transparent_hugepages*/sys/kernel/mm/redhat_transparent_hugepage(tostpathtexists(RR((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt	_thp_path!s	RcCs�|dkr0|s,tjdt|��ndStjddt�}|jd�dkrt|sptjd	�ndSt	j
j|j�d
�}t	j
j
|�r�|s�tj||�n|S|s�tjd�ndSdS(
Ntalwaystnevertmadvises-Incorrect 'transparent_hugepages' value '%s'.s
/proc/cmdlinetno_errorstransparent_hugepage=isWtransparent_hugepage is already set in kernel boot cmdline, ingoring value from profiletenabledsDOption 'transparent_hugepages' is not supported on current hardware.(salwaysRR(tlogtwarntstrRtcmdt	read_fileR	tfindtinfoRRtjoinRRt
write_to_file(Rtvaluetsimtcmdlinetsys_file((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_set_transparent_hugepages)s"RcCs|j||�dS(N(R&(RR"R#((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_set_transparent_hugepageAscCsKtjj|j�d�}tjj|�rCtjtj|��SdSdS(NR(	RRR RRRtget_active_optionRR(RR%((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_get_transparent_hugepagesEscCs
|j�S(N(R)(R((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_get_transparent_hugepageNsstransparent_hugepage.defragcCshtjj|j�d�}tjj|�rJ|sFtj||�n|S|s`tjd�ndSdS(NtdefragsJOption 'transparent_hugepage.defrag' is not supported on current hardware.(
RRR RRRR!RRR(RR"R#R%((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt _set_transparent_hugepage_defragRscCsKtjj|j�d�}tjj|�rCtjtj|��SdSdS(NR+(	RRR RRRR(RR(RR%((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt _get_transparent_hugepage_defrag^s(t__name__t
__module__t__doc__tclassmethodRRRRtcommand_setR&R'tcommand_getR)R*R,R-(((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyR
s			(tRt
decoratorst
tuned.logsttunedRtstructtglobttuned.utils.commandsRtlogstgetRRtPluginR(((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt<module>s
	

ZeroDay Forums Mini