qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v4 3/3] Add support for RAPL MSRs in KVM/Qemu


From: Anthony Harivel
Subject: Re: [PATCH v4 3/3] Add support for RAPL MSRs in KVM/Qemu
Date: Fri, 05 Apr 2024 10:33:27 +0200
User-agent: aerc/0.15.2-111-g39195000e213

Hi Daniel,

> > +    SocketAddress saddr = {
> > +        .type = SOCKET_ADDRESS_TYPE_UNIX,
> > +        .u.q_unix.path = socket_path
> > +    };
> > +    QIOChannelSocket *sioc = qio_channel_socket_new();
> > +    Error *local_err = NULL;
> > +
> > +    int r;
> > +
> > +    qio_channel_set_name(QIO_CHANNEL(sioc), "vmsr-helper");
> > +    qio_channel_socket_connect_sync(sioc,
> > +                                    &saddr,
> > +                                    &local_err);
> > +    g_free(socket_path);
> > +    if (local_err) {
> > +        goto out_close;
> > +    }
>
> In the previous posting I suggested that connectiong to the
> helper again & again for every individual MSR read is a
> high overhead. Connect once, and then just keep the socket
> open forever.
>

Indeed, this would be way more efficient. 

Does that means that I should create the socket during the 
initialisation of the main loop (kvm_msr_energy_thread_init) and keep 
track of the context variable and then just give the QIOChannelSocket 
pointer has a parameter to the vmsr_read_msr() function to send the 
data?

Regards,
Anthony




reply via email to

[Prev in Thread] Current Thread [Next in Thread]