Project

General

Profile

Feature #14705 ยป 0001-eval.c-ruby_setup-disable-THP-on-Linux.patch

normalperson (Eric Wong), 04/22/2018 10:21 PM

View differences:

eval.c
20 20
#include "mjit.h"
21 21
#include "probes.h"
22 22
#include "probes_helper.h"
23
#ifdef HAVE_SYS_PRCTL_H
24
#include <sys/prctl.h>
25
#endif
23 26

  
24 27
NORETURN(void rb_raise_jump(VALUE, VALUE));
25 28

  
......
52 55
	return 0;
53 56

  
54 57
    ruby_init_stack((void *)&state);
58

  
59
    /*
60
     * Disable THP early before mallocs happen because we want this to
61
     * affect as many future pages as possible for CoW-friendliness
62
     */
63
#if defined(__linux__) && defined(PR_SET_THP_DISABLE)
64
    prctl(PR_SET_THP_DISABLE, 1, 0, 0, 0);
65
#endif
55 66
    Init_BareVM();
56 67
    Init_heap();
57 68
    Init_vm_objects();
58
-