Skip to content

Instantly share code, notes, and snippets.

@yoku0825
Created April 2, 2015 00:54
Show Gist options
  • Save yoku0825/a89932c6a1491fcb758c to your computer and use it in GitHub Desktop.
Save yoku0825/a89932c6a1491fcb758c to your computer and use it in GitHub Desktop.
from mysql-5.7.6-m16/storage/innobase/buf/buf0flu.cc
2942 #ifdef UNIV_LINUX
2943 /* linux might be able to set different setting for each thread.
2944 worth to try to set high priority for page cleaner threads */
2945 if (buf_flush_page_cleaner_set_priority(
2946 buf_flush_page_cleaner_priority)) {
2947
2948 ib::info() << "page_cleaner coordinator priority: "
2949 << buf_flush_page_cleaner_priority;
2950 } else {
2951 ib::info() << "If the mysqld execution user is authorized,"
2952 " page cleaner thread priority can be changed."
2953 " See the man page of setpriority().";
2954 }
2955 #endif /* UNIV_LINUX */
2900 /**
2901 Set priority for page_cleaner threads.
2902 @param[in] priority priority intended to set
2903 @return true if set as intended */
2904 static
2905 bool
2906 buf_flush_page_cleaner_set_priority(
2907 int priority)
2908 {
2909 setpriority(PRIO_PROCESS, (pid_t)syscall(SYS_gettid),
2910 priority);
2911 return(getpriority(PRIO_PROCESS, (pid_t)syscall(SYS_gettid))
2912 == priority);
2913 }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment