[PATCH 4/4] vmbus: document numa_node sysfs

Stephen Hemminger stephen at networkplumber.org
Mon Dec 19 23:17:18 UTC 2016


On Mon, 19 Dec 2016 18:44:12 +0000
KY Srinivasan <kys at microsoft.com> wrote:

> > -----Original Message-----
> > From: Stephen Hemminger [mailto:stephen at networkplumber.org]
> > Sent: Monday, December 19, 2016 10:21 AM
> > To: Vitaly Kuznetsov <vkuznets at redhat.com>; KY Srinivasan
> > <kys at microsoft.com>; Haiyang Zhang <haiyangz at microsoft.com>
> > Cc: devel at linuxdriverproject.org; Stephen Hemminger
> > <sthemmin at microsoft.com>
> > Subject: [PATCH 4/4] vmbus: document numa_node sysfs
> > 
> > Update ABI to include numa_node.
> > 
> > Signed-off-by: Stephen Hemminger <sthemmin at microsoft.com>
> > ---
> >  Documentation/ABI/stable/sysfs-bus-vmbus | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> > 
> > diff --git a/Documentation/ABI/stable/sysfs-bus-vmbus
> > b/Documentation/ABI/stable/sysfs-bus-vmbus
> > index 183d14420152..dfd76b8c36aa 100644
> > --- a/Documentation/ABI/stable/sysfs-bus-vmbus
> > +++ b/Documentation/ABI/stable/sysfs-bus-vmbus
> > @@ -65,3 +65,11 @@ Description:
> >  		bindings. The format is UUID format similar to
> >  		/sys/bus/vmbus/devices/. For example:
> >  		# echo f8615163-df3e-46c5-913f-f2d2f965ed0e >
> > /sys/bus/pci/drivers/foo/unbind
> > +
> > +What:		/sys/bus/vmbus/devices/.../numa_node
> > +Date:		Dec 2016
> > +Contact:	Stephen Hemminger <sthemmin at microsoft.com>
> > +Description:
> > +		This file contains the NUMA node to which the VMBUS
> > device is
> > +		attached, or -1 if the node is unknown. The value comes from
> > +		the primary channel CPU mapping.
> > --
> > 2.11.0  
> Why don't you include the do update in the patch that adds the new sysfs field.
> 
> K. Y

The channel_vp_mapping was not designed according to the sysfs design guidelines
of one value per file. It really needs to be more like the net_devices queues sysfs.

$ cat /sys/class/net/eth0/device/channel_vp_mapping 
14:0
17:1

versus

$ ls /sys/class/net/eth0/queues
rx-0  rx-1  tx-0  tx-1
$ ls /sys/class/net/eth0/queues/tx-0
byte_queue_limits  tx_maxrate  tx_timeout  xps_cpus
$ cat /sys/class/net/eth0/queues/tx-0/xps_cpus 
00000000,00000000


So if VMBUS sysfs interface followed conventional guidelines:

Channel directory:  /sys/bus/vmbus/devices/XXXX/channels/
	0/
		out_read_bytes_avail
		in_read_bytes_avail
		id
		target_cpu
		numa_node

	1/

Therefore I would not like not to put existing layout into stable ABI.
It was a mistake because it doesn't handle multiple channel devices well,
and it also uses multiple values per file.

Since numa_node is property of target_cpu, maybe better to just redo
the sysfs channel layout and let application keep track of numa itself
based on CPU (it needs to know topology already about CPU's).




More information about the devel mailing list