ó ±2öYc@s‹ddlZddlTddlZddlZddlZddlZddlmZej j ƒZ eƒZ dej fd„ƒYZdS(iÿÿÿÿN(t*(tcommandstVMPlugincBs’eZdZed„ƒZd„Zd„Zed„ƒZedƒd„ƒZ edƒd„ƒZ e dƒd „ƒZ e dƒd „ƒZ RS( s( Plugin for tuning memory management. cCsidd6dd6S(Nttransparent_hugepagesttransparent_hugepage(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_hugepage/enableds2/sys/kernel/mm/redhat_transparent_hugepage/enabled(tostpathtexists(RR((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt _thp_file s RcCsÍ|d kr0|s,tjdt|ƒƒndStjddtƒ}|jdƒdkrt|sptjd ƒndS|j ƒ}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 profilesDOption 'transparent_hugepages' is not supported on current hardware.(salwaysRR(tlogtwarntstrRtcmdt read_fileRtfindtinfoRRRRt 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#(RRR ((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_set_transparent_hugepage?scCs<|jƒ}tjj|ƒr4tjtj|ƒƒSdSdS(N(RRRRRtget_active_optionRR(RR"((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_get_transparent_hugepagesCs cCs |jƒS(N(R&(R((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyt_get_transparent_hugepageLs(t__name__t __module__t__doc__t classmethodRR RRt command_setR#R$t command_getR&R'(((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyR s   (tbaset decoratorst tuned.logsttunedRtstructtglobttuned.utils.commandsRtlogstgetRRtPluginR(((s;/usr/lib/python2.7/site-packages/tuned/plugins/plugin_vm.pyts