]> xenbits.xensource.com Git - libvirt.git/commit
admin: Introduce virAdmServerSetThreadPoolParameters
authorErik Skultety <eskultet@redhat.com>
Mon, 22 Feb 2016 13:24:04 +0000 (14:24 +0100)
committerErik Skultety <eskultet@redhat.com>
Mon, 18 Apr 2016 15:07:46 +0000 (17:07 +0200)
commit93ab4da5f44111a9287535f35b015f2dbd0ee394
tree1953defbde58e969ceaaea737a842c95f5e96721
parentcaa16d31688725b6031e155d8c1e20d5008559ba
admin: Introduce virAdmServerSetThreadPoolParameters

Since threadpool increments the current number of threads according to current
load, i.e. how many jobs are waiting in the queue. The count however, is
constrained by max and min limits of workers. The logic of this new API works
like this:
    1) setting the minimum
        a) When the limit is increased, depending on the current number of
           threads, new threads are possibly spawned if the current number of
           threads is less than the new minimum limit
        b) Decreasing the minimum limit has no possible effect on the current
           number of threads
    2) setting the maximum
        a) Icreasing the maximum limit has no immediate effect on the current
           number of threads, it only allows the threadpool to spawn more
           threads when new jobs, that would otherwise end up queued, arrive.
        b) Decreasing the maximum limit may affect the current number of
           threads, if the current number of threads is less than the new
           maximum limit. Since there may be some ongoing time-consuming jobs
           that would effectively block this API from killing any threads.
           Therefore, this API is asynchronous with best-effort execution,
           i.e. the necessary number of workers will be terminated once they
           finish their previous job, unless other workers had already
           terminated, decreasing the limit to the requested value.
    3) setting priority workers
        - both increase and decrease in count of these workers have an
          immediate impact on the current number of workers, new ones will be
          spawned or some of them get terminated respectively.

Signed-off-by: Erik Skultety <eskultet@redhat.com>
15 files changed:
daemon/admin.c
daemon/admin_server.c
daemon/admin_server.h
include/libvirt/libvirt-admin.h
src/admin/admin_protocol.x
src/admin/admin_remote.c
src/admin_protocol-structs
src/libvirt-admin.c
src/libvirt_admin_private.syms
src/libvirt_admin_public.syms
src/libvirt_private.syms
src/rpc/virnetserver.c
src/rpc/virnetserver.h
src/util/virthreadpool.c
src/util/virthreadpool.h