Clean the policy manipulation path in domain creation
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v4 Latest2 patches 5 repliesIn review
- v32 patches 5 repliesSuperseded
- v20 of 3 patches 2 repliesSuperseded
Earlier versions · 1
| Version | Posted | Patches | Replies | Status |
|---|---|---|---|---|
| v1 | 3 patches | 6 replies | Superseded |
Changes in v4 from the cover letter
* More changes in style and comments
* Removal of unneeded local variables
* Fixed unhandled corner cases in bsearch()
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | tools/xg: Streamline cpu policy serialise/deserialise callstools/ tools/ tools/ +2 more | +108 | 2 replies | |
| 2/2 | tools/xg: Clean up xend-style overrides for CPU policiestools/ | +130 | 1 reply |
Reviews trailers per patch
All 2 patches have a Reviewed-by or Acked-by.
| Patch | Roger Pau Monné | Oleksii Kurochko |
|---|---|---|
| Series | Release-Acked-by | |
| 1/2 | A-b | |
| 2/2 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.
Cover letter [PATCH v4 0/2] Clean the policy manipulation path in domain creation
v3 -> v4:
* More changes in style and comments
* Removal of unneeded local variables
* Fixed unhandled corner cases in bsearch()
v2 -> v3:
* Style adjustments
* Revert of loop index scope refactors
v1 -> v2:
* Removed xc_cpu_policy from xenguest.h (dropped v1/patch1)
* Added accessors for xc_cpu_policy so the serialised form can be extracted.
* Modified xen-cpuid to use accessors.
==== Original cover letter ====
In the context of creating a domain, we currently issue a lot of hypercalls redundantly while populating its CPU policy; likely a side effect of organic growth more than anything else.
However, the worst part is not the overhead (this is a glacially cold path), but the insane amounts of boilerplate that make it really hard to pick apart what's going on. One major contributor to this situation is the fact that what's effectively "setup" and "teardown" phases in policy manipulation are not factored out from the functions that perform said manipulations, leading to the same getters and setter being invoked many times, when once each would do.
Another big contributor is the code being unaware of when a policy is serialised and when it's not.
This patch attempts to alleviate this situation, yielding over 200 LoC reduction.
Patch 1: Mechanical change. Makes xc_cpu_policy_t public so it's usable
from clients of libxc/libxg.
Patch 2: Changes the (de)serialization wrappers in xenguest so they always
serialise to/from the internal buffers of xc_cpu_policy_t. The struct is suitably expanded to hold extra information required.
Patch 3: Performs the refactor of the policy manipulation code so that it
follows a strict: PULL_POLICIES, MUTATE_POLICY (n times), PUSH_POLICY.
Alejandro Vallejo (2):
tools/xg: Streamline cpu policy serialise/deserialise calls tools/xg: Clean up xend-style overrides for CPU policies
tools/include/xenguest.h | 14 +- tools/libs/guest/xg_cpuid_x86.c | 525 ++++++++++------------------ tools/libs/guest/xg_private.h | 2 + tools/libs/guest/xg_sr_common_x86.c | 56 ++- tools/misc/xen-cpuid.c | 41 +-- 5 files changed, 235 insertions(+), 403 deletions(-)
Signature · 1 line
2.34.1