lkml.org 
[lkml]   [2018]   [Dec]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH] ksm: React on changing "sleep_millisecs" parameter faster
    On Mon, Dec 10, 2018 at 07:06:18PM +0300, Kirill Tkhai wrote:
    > ksm thread unconditionally sleeps in ksm_scan_thread()
    > after each iteration:
    >
    > schedule_timeout_interruptible(
    > msecs_to_jiffies(ksm_thread_sleep_millisecs))
    >
    > The timeout is configured in /sys/kernel/mm/ksm/sleep_millisecs.
    >
    > In case of user writes a big value by a mistake, and the thread
    > enters into schedule_timeout_interruptible(), it's not possible
    > to cancel the sleep by writing a new smaler value; the thread
    > is just sleeping till timeout expires.
    >
    > The patch fixes the problem by waking the thread each time
    > after the value is updated.
    >
    > This also may be useful for debug purposes; and also for userspace
    > daemons, which change sleep_millisecs value in dependence of
    > system load.
    >
    > Signed-off-by: Kirill Tkhai <ktkhai@virtuozzo.com>

    Kirill, can we rather reuse @ksm_thread variable from ksm_init
    (by moving it to static file level variable). Also wakening up
    unconditionally on write looks somehow suspicious to me
    though I don't have a precise argument against.

    \
     
     \ /
      Last update: 2018-12-10 21:11    [W:3.319 / U:0.188 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site