Re: [PATCH v13 23/25] virt: geniezone: Add support for guest VM CPU idle

From: Hillf Danton
Date: Tue Dec 17 2024 - 05:46:07 EST


On Thu, 14 Nov 2024 18:08:00 +0800
> +/**
> + * gzvm_vcpu_wakeup_all - wakes up all vCPUs associated with the specified
> + * gzvm.
> + * @gzvm: Pointer to gzvm structure.
> + */
> +void gzvm_vcpu_wakeup_all(struct gzvm *gzvm)
> +{
> + for (int i = 0; i < GZVM_MAX_VCPUS; i++) {
> + if (gzvm->vcpus[i]) {
> + gzvm->vcpus[i]->idle_events.virtio_irq += 1;
> + rcuwait_wake_up(&gzvm->vcpus[i]->wait);
> + }
> + }
> +}
> +
> static enum hrtimer_restart gzvm_vtimer_expire(struct hrtimer *hrt)
> {
> + struct gzvm_vcpu *vcpu;
> +
> + vcpu = container_of(hrt, struct gzvm_vcpu, gzvm_vtimer);
> +
> + gzvm_vcpu_wakeup_all(vcpu->gzvm);
> +
Given vcpu, what sense could thunder herd make?

> return HRTIMER_NORESTART;
> }