-
Notifications
You must be signed in to change notification settings - Fork 114
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
Kernel params set by the config daemon should be verified #486
Kernel params set by the config daemon should be verified #486
Conversation
Thanks for your PR,
To skip the vendors CIs use one of:
|
/cc @SchSeba |
/cc @lmilleri |
Pull Request Test Coverage Report for Build 6502105920
💛 - Coveralls |
/hold |
I don't think this is fixing the issue. We aren't reconciling the state of the system to a desired state whenever the current state is different. What we want is to trigger setting the desired kargs at any point when they are set to something else then we expect. Reference for this: OCPBUGS-16909 It's a step in the good direction though, by performing the necessary check when we are making a change. We just need to have this check be executed more frequently. |
We have one remaining situation to fix due to how enable-kargs.sh works. Let's say we've run enable-kargs.sh, and we returned non-zero, i.e. we made a change and we need to reboot. Now, before we actually get to the point of the reboot, the daemon is restarted. Now, assume again execution gets to the point of running enable-kargs.sh but this time, since rpm-ostree kargs contains the pending kargs, it will return 0 since from the perspective of rpm-ostree we are good and we won't reboot. We need to fix this on line 10 in enable-kargs.sh |
@bn222
If ret > 0 then we will be marked for reboot. |
Yes, I agree this is an issue. I was thinking of calling it earlier in |
Yes, that happens in normal execution. What happens when we kill the pod immediately after we are marked for reboot? I think we will run through the whole logic from start again, but this time we will not mark for reboot, and we will just wait. iow, I believe there is an edge case due to non-idempotency. |
Hi folks, let me add some ideas here. we can improve this one with a simple fix I think. and I don't think we need to revalidate this every few seconds it's a waster of resource as this variable is loaded or unloaded after reboot you can't do it when the system is already running. meaning if the user disable it but didn't reboot all good we still have it. so again I think the only change needed is to check if we need to reboot by looking on the source of true that is /proc/cmdline and not the output of the rpm-ostree or grubby |
that is correct and also what I'm proposing. No need to recheck that every time. A reboot implies a start of execution from the beginning, but we do need to check /proc/cmdline instead. While at it, please move the .sh to .go (maybe as a separate patch). I don't see any need to use .sh here. |
/lgtm |
discussed with William offline. This is good to go from my side. |
/unhold |
Thanks for your PR,
To skip the vendors CIs use one of:
|
/hold cancel |
LGTM from me on this. We would want to have a separate go function that does the configuring and another that checks if the config needs to be done), but we will address that in a PR that cleans up the .sh file (by moving that functionality into .go) and separates out the two tasks (check & set). |
@adrianchiris @e0ne Could you PTAL, Thanks! |
c52c3cc
to
0d2a741
Compare
27b8785
to
335d64d
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
335d64d
to
6cee22e
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
/test-all |
6cee22e
to
0cd892a
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
0cd892a
to
07eb354
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
LGTM |
07eb354
to
fa46710
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
@adrianchiris Please take a look, much appreciated! |
@wizhaoredhat I see the CI failed, could you take a look into that? I will give this PR a quick review tomorrow once I am online |
fa46710
to
882dee0
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
In the case of vfio-pci, the config daemon might not notice it has to reboot to add kernel arguments. This could happen if the vfio driver state was updated but the config daemon was interrupted (e.g policy was removed and readded quickly). This could lead to a pending change to the kernel arguments via grubby or os-tree but without a reboot, these changes wouldn't be applied. This change introduces a map to hold the desired kernel arguments that the config daemon wishes to apply. This map is then validated against "/proc/cmdline" to see if the desired kernel arguments are actually applied. If not then there will be a subsequent attempt to apply these arguments. We need to make sure that the kernel arguments are set, thus we should pass the errors up to the config daemon instead of silently consuming the errors when setting kernel arguments. Signed-off-by: William Zhao <[email protected]>
882dee0
to
99e5aa9
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
/test-all |
When creating VFs via sysfs sriov_numvfs, there is a chance of getting the error syscall.ENOMEM "cannot allocate memory". This could occur when the BIOS is not providing enough MMIO space for VFs. A solution is to reallocate the MMIO space via "pci=realloc". Signed-off-by: William Zhao <[email protected]>
99e5aa9
to
3eaac7e
Compare
Thanks for your PR,
To skip the vendors CIs use one of:
|
@@ -285,33 +337,39 @@ func (p *GenericPlugin) needDrainNode(desired sriovnetworkv1.Interfaces, current | |||
return | |||
} | |||
|
|||
func needRebootIfVfio(state *sriovnetworkv1.SriovNetworkNodeState, driverMap DriverStateMapType) (needReboot bool) { | |||
driverState := driverMap[Vfio] | |||
func (p *GenericPlugin) addVfioDesiredKernelArg(state *sriovnetworkv1.SriovNetworkNodeState) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: addVfioDesiredKernelArg -> addVfioDesiredKernelArgs to keep it the same as other methods ? WDYT.
Although, we are only adding a single arg here....
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer singular. It's only adding 1 arg.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also prefer it being singular. Let's keep it as is. Thanks for reviewing!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
its adding two, what am i missing ?
L343, L344
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sorry I grouped IOMMU as singular. There is infact Intel IOMMU and the general IOMMU. However this is a small NIT on naming.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall, PR lgtm.
Can you confirm CI failure is due to CI itself and not this PR?
|
set := utils.IsKernelArgsSet(kargs, desiredKarg) | ||
if !set { | ||
if attempted { | ||
glog.V(2).Infof("generic-plugin syncDesiredKernelArgs(): previously attempted to set kernel arg %s", desiredKarg) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@wizhaoredhat if you previously attempted to set the arg, it means setKernlelArg succeeded.
then why do we need to set it again ? shouldnt we "continue" here ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This captures the case where we hit this case, but either the kernel arg wasn't set properly or if the reboot did not occur for some reason. This results in IsKernelArgsSet
returning false even though it was set before. So we should try again.
In the case of vfio-pci, the config daemon might not notice it has to reboot to add kernel parameters. This could happen if the vfio driver state was updated but the config daemon was interrupted (e.g policy was removed and readded quickly).
This could lead to a pending change to the kernel parameters via grubby or os-tree but without a reboot, these changes wouldn't be applied.
This change introduces a map to hold the desired kernel parameters that the config daemon wishes to apply. This map is then validated against "/proc/cmdline" to see if the desired kernel parameters are actually applied. If not then there will be a subsequent attempt to apply these parameters.
We need to make sure that the kernel parameters are set, thus we should pass the errors up to the config daemon instead of silently consuming the errors when setting kernel parameters.