Skip to content
  • Nicolas Saenz Julienne's avatar
    71ad4713
    util/event-loop-base: Introduce options to set the thread pool size · 71ad4713
    Nicolas Saenz Julienne authored
    
    
    The thread pool regulates itself: when idle, it kills threads until
    empty, when in demand, it creates new threads until full. This behaviour
    doesn't play well with latency sensitive workloads where the price of
    creating a new thread is too high. For example, when paired with qemu's
    '-mlock', or using safety features like SafeStack, creating a new thread
    has been measured take multiple milliseconds.
    
    In order to mitigate this let's introduce a new 'EventLoopBase'
    property to set the thread pool size. The threads will be created during
    the pool's initialization or upon updating the property's value, remain
    available during its lifetime regardless of demand, and destroyed upon
    freeing it. A properly characterized workload will then be able to
    configure the pool to avoid any latency spikes.
    
    Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-id: 20220425075723.20019-4-nsaenzju@redhat.com
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    71ad4713
    util/event-loop-base: Introduce options to set the thread pool size
    Nicolas Saenz Julienne authored
    
    
    The thread pool regulates itself: when idle, it kills threads until
    empty, when in demand, it creates new threads until full. This behaviour
    doesn't play well with latency sensitive workloads where the price of
    creating a new thread is too high. For example, when paired with qemu's
    '-mlock', or using safety features like SafeStack, creating a new thread
    has been measured take multiple milliseconds.
    
    In order to mitigate this let's introduce a new 'EventLoopBase'
    property to set the thread pool size. The threads will be created during
    the pool's initialization or upon updating the property's value, remain
    available during its lifetime regardless of demand, and destroyed upon
    freeing it. A properly characterized workload will then be able to
    configure the pool to avoid any latency spikes.
    
    Signed-off-by: default avatarNicolas Saenz Julienne <nsaenzju@redhat.com>
    Reviewed-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
    Acked-by: default avatarMarkus Armbruster <armbru@redhat.com>
    Message-id: 20220425075723.20019-4-nsaenzju@redhat.com
    Signed-off-by: default avatarStefan Hajnoczi <stefanha@redhat.com>
Loading