On 4/6/2016 2:17 PM, Yuanhan Liu wrote: > On Wed, Apr 06, 2016 at 02:05:51PM +0800, Tan, Jianfeng wrote: >> >> On 4/6/2016 1:44 PM, Yuanhan Liu wrote: >>> On Wed, Apr 06, 2016 at 01:32:12PM +0800, Tan, Jianfeng wrote: >>>> Hi, >>>> >>>> Just out of interest, seems that the message handling thread which runs >>>> new_device() is pthread_create() from the thread which calls the >>>> dev_start(), usually master thread, right? But it's not necessary to be the >>>> master thread to poll pkts from this vhost port, right? So what's the >>>> significance to record the numa_node information of message handling thread >>>> here? Shall we make the decision of numa_realloc based on the final PMD >>>> thread who is responsible for polling this vhost port? >>> It doesn't matter on which core we made the decision: the result >>> would be same since we are querying the numa node info of the >>> virtio_net dev struct. >> OK, according to your hint, read numa_realloc() again, it's to keep *dev >> (struct virtio_net), *dev->virtqueue[], on the same numa socket of shared >> memory with virtio? > Sort of, and I'm guessing that the comment have already made it clear? > > /* > * Reallocate virtio_dev and vhost_virtqueue data structure to make them > on the > * same numa node as the memory of vring descriptor. > */ > >> And numa_realloc() is called in vhost_set_vring_addr(), which is after >> new_device()? > It's actually before new_device(). > > --yliu
Yes, exactly as you said. Thanks for explanation! Jianfeng