per-cpu polling(4) support

Sepherosa Ziehau sepherosa at gmail.com
Fri Sep 14 20:02:39 PDT 2007


On 9/14/07, Sepherosa Ziehau <sepherosa at gmail.com> wrote:
> Hi all,
>
> Following patch adds per-cpu polling(4) support:
> http://leaf.dragonflybsd.org/~sephe/pcpu_polling.diff

Above patch is updated to address a problem I found later last night,
new patch is at:
http://leaf.dragonflybsd.org/~sephe/pcpu_polling1.diff

The things got fixed in the new patch:
- Correctly set up poll_cpumask
- Nuke unused NETISR_{POLL,POLLMORE} macros
- Polling is now enabled by default on the first 32 CPUs (*); there is
no need to set kern.polling.cpumask tunable to make CPU polling
capable.

(*) This will not hurt anything, since its rate is 1/seconds.

Best Regards,
sephe

>
> It is against HEAD.  You need to apply it under /usr/src.  At least
> quickworld and quickkernel are required.
>
> You need to set tunable kern.polling.cpumask to make specific CPU
> capable of polling:
> e.g. 0x1 - CPU0, 0x3 - CPU{0,1} ...
> It also implies that you can do polling on CPU1 instead of CPU0 by
> setting kern.polling.cpumask to 0x2
>
> To put NIC on a polling capable CPU_Y; Whether NIC is on polling
> capable CPU_Z or not does not matter:
> ifconfig ifaceX pollcpu Y
>
> To pull NIC off a polling capable CPU:
> ifconfig ifaceX -polling
>
> kern.polling.Y.{nodes} contain sysctl nodes for CPU_Y
>
> Noticeable changes:
> 1) kern.polling.{nodes} contain sysctl nodes for lowest polling
> capable CPU, which is not necessarily CPU0 depending on
> kern.polling.cpumask tunable (default is CPU0)
> 2) ifconfig ifaceX polling, will put ifaceX onto the lowest polling
> capable CPU, which is not necessarily CPU0 depending on
> kern.polling.cpumask tunable (default is CPU0)
> 3) Polling is enabled by default on polling capable CPUs
> 4) If polling capable CPU has no NICs associated, its poll clock rate
> will be reduced to 1/sec
>
> Please review it.
>
> Best Regards,
> sephe
>
> --
> Live Free or Die
>


-- 
Live Free or Die





More information about the Submit mailing list