• E
    cpumap: optimize for clients that don't need online count · 3d0130cb
    Eric Blake 提交于
    It turns out that calling virNodeGetCPUMap(conn, NULL, NULL, 0)
    is both useful, and with Viktor's patches, common enough to
    optimize.  Since this interface hasn't been released yet, we
    can change the RPC call.
    
    A bit more background on the optimization - learning the cpu count
    is a single file read (/sys/devices/system/cpu/possible), but
    learning the number of online cpus can possibly trigger a file
    read per cpu, depending on the age of the kernel, and all wasted
    if the caller passed NULL for both arguments.
    
    * src/nodeinfo.c (nodeGetCPUMap): Avoid bitmap when not needed.
    * src/remote/remote_protocol.x (remote_node_get_cpu_map_args):
    Supply two separate flags for needed arguments.
    * src/remote/remote_driver.c (remoteNodeGetCPUMap): Update
    caller.
    * daemon/remote.c (remoteDispatchNodeGetCPUMap): Likewise.
    * src/remote_protocol-structs: Regenerate.
    3d0130cb
nodeinfo.c 40.9 KB