• B
    futex: introduce the direct-thread-switch mechanism · dad99a57
    briansun 提交于
    openeuler inclusion
    category: feature
    bugzilla: https://gitee.com/openeuler/kernel/issues/I4L9RU
    CVE: NA
    
    Reference: https://lore.kernel.org/lkml/20200722234538.166697-2-posk@posk.io/
    
    -------------------
    
    In some scenarios, we need to run several low-thrashing required threads
    together which act as logical operations like PV operations. This kind of
    thread always falls asleep and wakes other threads up, and thread switching
    requires the kernel to do several scheduling related overheads (Select the
    proper core to execute, wake the task up, enqueue the task, mark the task
    scheduling flag, pick the task at the proper time, dequeue the task and do
    context switching). These overheads mentioned above are not accepted for the
    low-thrashing threads. Therefore, we require a mechanism to decline the
    unnecessary overhead and to swap threads directly without affecting the
    fairness of CFS tasks.
    
    To achieve this goal, we implemented the direct-thread-switch mechanism
    based on the futex_swap patch*, which switches the DTS task directly with
    the shared schedule entity. Also, we ensured the kernel keeps secure and
    consistent basically.
    Signed-off-by: NZhi Song <hizhisong@gmail.com>
    dad99a57
Kconfig 80.2 KB