Skip to content
Snippets Groups Projects
  • Daniel Jordan's avatar
    ktask: multithread CPU-intensive kernel work · c48676ef
    Daniel Jordan authored and 谢秀奇's avatar 谢秀奇 committed
    
    hulk inclusion
    category: feature
    bugzilla: 13228
    CVE: NA
    ---------------------------
    
    A single CPU can spend an excessive amount of time in the kernel
    operating on large amounts of data.  Often these situations arise
    during initialization- and destruction-related tasks, where the data
    involved scales with system size. These long-running jobs can slow
    startup and shutdown of applications and the system itself while extra
    CPUs sit idle.
    
    To ensure that applications and the kernel continue to perform well as
    core counts and memory sizes increase, harness these idle CPUs to
    complete such jobs more quickly.
    
    ktask is a generic framework for parallelizing CPU-intensive work in the
    kernel.  The API is generic enough to add concurrency to many different
    kinds of tasks--for example, zeroing a range of pages or evicting a list
    of inodes--and aims to save its clients the trouble of splitting up the
    work, choosing the number of threads to use, maintaining an efficient
    concurrency level, starting these threads, and load balancing the work
    between them.
    
    The Documentation patch earlier in this series, from which the above was
    swiped, has more background.
    
    Inspired by work from Pavel Tatashin, Steve Sistare, and Jonathan Adams.
    
    Signed-off-by: default avatarDaniel Jordan <daniel.m.jordan@oracle.com>
    Suggested-by: default avatarPavel Tatashin <Pavel.Tatashin@microsoft.com>
    Suggested-by: default avatarSteve Sistare <steven.sistare@oracle.com>
    Suggested-by: default avatarJonathan Adams <jwadams@google.com>
    Signed-off-by: default avatarHongbo Yao <yaohongbo@huawei.com>
    Reviewed-by: default avatarXie XiuQi <xiexiuqi@huawei.com>
    Tested-by: default avatarHongbo Yao <yaohongbo@huawei.com>
    Signed-off-by: default avatarYang Yingliang <yangyingliang@huawei.com>
    c48676ef