From owner-freebsd-questions@FreeBSD.ORG Sun Sep 20 12:24:33 2009 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 0A950106568F for ; Sun, 20 Sep 2009 12:24:33 +0000 (UTC) (envelope-from pieter@degoeje.nl) Received: from mx.utwente.nl (mx1.utsp.utwente.nl [130.89.2.12]) by mx1.freebsd.org (Postfix) with ESMTP id 823618FC0C for ; Sun, 20 Sep 2009 12:24:32 +0000 (UTC) Received: from lux.student.utwente.nl (lux.student.utwente.nl [130.89.170.81]) by mx.utwente.nl (8.12.10/SuSE Linux 0.7) with ESMTP id n8KCD4XE019640; Sun, 20 Sep 2009 14:13:04 +0200 From: Pieter de Goeje To: freebsd-questions@freebsd.org Date: Sun, 20 Sep 2009 14:13:03 +0200 User-Agent: KMail/1.9.10 References: In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200909201413.03882.pieter@degoeje.nl> X-UTwente-MailScanner-Information: Scanned by MailScanner. Contact icts.servicedesk@utwente.nl for more information. X-UTwente-MailScanner: Found to be clean X-UTwente-MailScanner-From: pieter@degoeje.nl X-Spam-Status: No Cc: Agus Subject: Re: Polling and kern.hz X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Sep 2009 12:24:33 -0000 On Saturday 19 September 2009, Agus wrote: > Hi guys... > > Im reading ant playing with polling and kernel..... I read that > polling increase net performance and i plan on using it... Now the > question that arises is.. is polling and performance in general > affected by the value of kern.hz? i have put in /boot.loader.con > kern.hz=50 and was wondering if this number affects the number i > choose for the polling options > > I wanna recompile kernel using > > options DEVICE_POLLING > options HZ=1000 > > So that 1000hz how affects the system? if it affects it at all........ > > thanks for anyone who can give me a hint.... > > Cheers, > A To quote polling(4): "Device polling disables interrupts by polling devices at appropriate times, i.e., on clock interrupts and within the idle loop. This way, the context switch overhead is removed. Furthermore, the operating system can control accurately how much work to spend in handling device events, and thus prevent livelock by reserving some amount of CPU to other tasks." HZ affects how often the device is polled. For high bandwidth situations, it is important that the latency is kept as low as possible. That means that you must poll the device as often as possible. So generally people use very high HZ values for polling, for example 10000. HZ=50 leads to latencies of about 20ms, way too high for normal network I/O. Note that you can change HZ without recompiling by specifying kern.hz="###" in loader.conf. -- Pieter de Goeje