1. 20 4月, 2016 24 次提交
  2. 19 4月, 2016 7 次提交
  3. 18 4月, 2016 9 次提交
    • E
      virt-admin: Introduce srv-threadpool-info and srv-threadpool-set commands · 510991b6
      Erik Skultety 提交于
      Wire up the server threadpool tunable APIs to virt-admin client. Also, provide
      a man page for both commands.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      510991b6
    • E
      admin: Introduce virAdmServerSetThreadPoolParameters · 93ab4da5
      Erik Skultety 提交于
      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: NErik Skultety <eskultet@redhat.com>
      93ab4da5
    • E
      admin: Introduce virAdmServerGethreadPoolParameters · caa16d31
      Erik Skultety 提交于
      New API to retrieve current server workerpool specs. Since it uses typed
      parameters, more specs to retrieve can be further included in the pool of
      supported ones.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      caa16d31
    • E
      admin: Prepare admin protocol for future worker related procedures · c618d48a
      Erik Skultety 提交于
      Before any getter or setter methods can be introduced, first specify a set of
      public attributes/flags that these methods will be compatible with.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      c618d48a
    • E
      util: Add more getters to threadpool parameters · c516e7d3
      Erik Skultety 提交于
      In order for the client to see all thread counts and limits, current total
      and free worker count getters need to be introduced. Client might also be
      interested in the job queue length, so provide a getter for that too. As with
      the other getters, preparing for the admin interface, mutual exclusion is used
      within all getters.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      c516e7d3
    • E
      util: Use a mutex when retrieving threadpool data · e981607e
      Erik Skultety 提交于
      So far, the values the affected getters retrieve are static, i.e. there's no
      way of changing them during runtime. But admin interface will later enable
      not only getting but changing them as well. So to prevent phenomenons like
      torn reads or concurrent reads and writes of unaligned values, use mutual
      exclusion when getting these values (writes do, understandably, use them
      already).
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      e981607e
    • E
      util: Report system error when virThreadCreateFull fails · 79685175
      Erik Skultety 提交于
      Otherwise 'Unknown' error will be returned to client.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      79685175
    • E
      util: Refactor thread creation by introducing virThreadPoolExpand · 396f8051
      Erik Skultety 提交于
      When either creating a threadpool, or creating a new thread to accomplish a job
      that had been placed into the jobqueue, every time thread-specific data need to
      be allocated, threadpool needs to be (re)-allocated and thread count indicators
      updated. Make the code clearer to read by compressing these operations into a
      more complex one.
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      396f8051
    • E
      admin: Enable usage of typed parameters · 84d21591
      Erik Skultety 提交于
      Make all relevant changes to admin protocol, in order to achieve $(subj)
      Signed-off-by: NErik Skultety <eskultet@redhat.com>
      84d21591