Skip to content

CP-10531: Update vm_guest_metrics to implement PV drivers update #2160

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

huizh
Copy link
Contributor

@huizh huizh commented Feb 16, 2015

  1. Introduce networks_path_optimized and storages_path_optimized flags to vm_guest_metrics.
  2. Update the implementation of PV_drivers_up_to_date.

Signed-off-by: Hui Zhang hui.zhang@citrix.com

@thomassa
Copy link
Contributor

thomassa commented Mar 2, 2015

@xen-git Retest this please


field ~qualifier:DynamicRO ~ty:Bool ~in_oss_since:None
~lifecycle:[
Removed, rel_dundee, "Disabled in favour of the PV drivers auto-update"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be marked as Deprecated, not Removed. Suggested text:
"Deprecated in favour of network_paths_optimized and storage_paths_optimized, and redefined in terms of them."

@thomassa
Copy link
Contributor

thomassa commented Mar 2, 2015

At present some of the English is rather foreign: please would you change "networks_path" to "network_paths" in identifiers such as "network_paths_optimized", and the equivalent for "storage_paths"?

(Note: I've not finished reviewing this yet.)

@simonjbeaumont
Copy link
Contributor

I don't think we should have a commit in the history with message: Implement REQ19-R7. The commit message needs to make sense without JIRA or supporting documentation.

I see the main body includes more useful information. It would be better if the title had a description of the change and (if absolutely necessary) you reference the REQ in the body of the message.

This page has some good thoughts on commit messages:

http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html

@huizh
Copy link
Contributor Author

huizh commented Mar 17, 2015

Thanks Thomas and Simon for the comments.
I have addressed them and would update the pull request for your review.
Thanks.

@huizh huizh changed the title CP-10531: Implement REQ19-R7. CP-10531: Update vm_guest_metrics to implement PV drivers update Mar 17, 2015
@@ -233,6 +281,25 @@ let all (lookup: string -> string option) (list: string -> string list) ~__conte
Db.VM_guest_metrics.set_other ~__context ~self:gm ~value:other;
Helpers.call_api_functions ~__context (fun rpc session_id -> Client.Client.VM.update_allowed_operations rpc session_id self);
end;
if(vif_state_cached <> vif_state) then begin
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there any reason not to just cache network_paths_optimized instead of building up vif_state and caching that?

Same for VBDs.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks Thomas.

To get network_paths_optimzied, the following steps must be run:

  1. get vif_state which contains the state of all VIFs;
  2. execute logical AND of the states.
    That means under each vm_guest_metrics refresh, to compare network_paths_optimized and network_paths_optimized_cached,
    network_paths_optimized must be calculated with both step 1 and 2 even if vif_state has no change.

If we just cache vif_state, step 1 is mandatory with vm_guest_metrics refresh.
But only when vif_state doesn't equal to vif_state_cached, step 2 will be executed.

Considering vif_state is normally immutable, step 2 seldom needs to run.
For VBD, that's similar.

Could you please let me know if you have any concern?
Thanks.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Comparing vif_state with vif_state_cached is more costly than doing a logical AND across one of them.

But as I said, I see no need to build up vif_state in the first place: we can do logical AND as we go along and cache the result.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK. I see.
Just update the pull request, could you please help review it?
Thanks.

@thomassa
Copy link
Contributor

Looks good to me except that in xapi_guest_agent I think we should calculate and cache network_paths_optimized instead of building up a vif_state map and caching that. Also the equivalent for storage_paths_optimized and VBDs.

1. Introduce networks_path_optimized and storages_path_optimized flags to vm_guest_metrics.
2. Update the implementation of PV_drivers_up_to_date.

Signed-off-by: Hui Zhang <hui.zhang@citrix.com>
@huizh
Copy link
Contributor Author

huizh commented Mar 23, 2015

Hi Thomas

Thanks for your suggestion that "we can do logical AND as we go along and cache the result."
The code has been updated to implement it.
Could you please help to review it again?

Thanks.

@thomassa
Copy link
Contributor

Looks good now.
Should this go on the REQ-19 feature-branch for now though?

@huizh
Copy link
Contributor Author

huizh commented Mar 24, 2015

Thanks Thomas for the review.
Besides this PR, I have another one in xenopsd repo for this feature:
xapi-project/xenopsd#167
Should it be moved to feature branch too?
Thanks.

@huizh
Copy link
Contributor Author

huizh commented Mar 26, 2015

Hi Thomas,
Per your suggestion to move the code to feature branch, pull request #2198 is created.
So close this PR.
Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants