From owner-freebsd-current@FreeBSD.ORG Thu May 29 05:17:14 2014 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 69313A69 for ; Thu, 29 May 2014 05:17:14 +0000 (UTC) Received: from mail-qg0-x229.google.com (mail-qg0-x229.google.com [IPv6:2607:f8b0:400d:c04::229]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 269AF2C8A for ; Thu, 29 May 2014 05:17:14 +0000 (UTC) Received: by mail-qg0-f41.google.com with SMTP id j5so21036914qga.28 for ; Wed, 28 May 2014 22:17:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:date:message-id:subject :from:to:cc:content-type; bh=8Kh+JrT9ZjE9LeKltSHsMLwSh+pfjIL0M6W7d9GSMy4=; b=0813kydcOsAypAf4nfYn4nXjG05cKdX9WCoC+6g8vUVVJZIW69nBPdCXMb+QH0GjK3 dhHmfCLZmMlI8Z7tSKPR5MBV2dQc8bx4FUdoXL8/6cAL/b7Adja4YM+OqGpZkVKw5j0I Y+0wnRqsuJ28FEPyR+Z6vNUHiqBph07zvJ0TBATA9Pin69gmGjnIzkY23Grw9Cr524D+ fSd7rGZCvOK1vUjrDsSi75paBVDEl/53ALQLTkHL6vFSmwTMcgOLYD9aYWyH/bFszxHb 4leGBrTQd8UKF7wJ9cRaxyX0utEhMIegL73Nrc/QvtGWxRhV1HMiq+2GOYXqqFp3o9/3 TwZQ== MIME-Version: 1.0 X-Received: by 10.224.43.148 with SMTP id w20mr6556724qae.26.1401340633155; Wed, 28 May 2014 22:17:13 -0700 (PDT) Sender: adrian.chadd@gmail.com Received: by 10.224.191.201 with HTTP; Wed, 28 May 2014 22:17:13 -0700 (PDT) In-Reply-To: <3223163.UsW4aPcrLi@overcee.wemm.org> References: <00d301cf7af9$d5ce5bb0$816b1310$@freebsd.org> <3223163.UsW4aPcrLi@overcee.wemm.org> Date: Wed, 28 May 2014 22:17:13 -0700 X-Google-Sender-Auth: U9LTLgDM649cEKglF-Rj1T3EvAQ Message-ID: Subject: Re: RES: KQueue vs Select (NetMap) From: Adrian Chadd To: Peter Wemm Content-Type: text/plain; charset=UTF-8 Cc: Fred Pedrisa , freebsd-current , Jan Bramkamp X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 May 2014 05:17:14 -0000 what he said. -a On 28 May 2014 22:02, Peter Wemm wrote: > On Thursday 29 May 2014 01:57:38 Fred Pedrisa wrote: >> Hello, >> >> There are 4 threads, and a total of 32 FDs. What do you think ? > > I think it is time for you to try it and find out... > > I suspect it wouldn't make much difference at all if you just implement select > semantics with kqueue. > >> -----Mensagem original----- >> De: owner-freebsd-current@freebsd.org >> [mailto:owner-freebsd-current@freebsd.org] Em nome de Adrian Chadd >> Enviada em: quinta-feira, 29 de maio de 2014 01:52 >> Para: Fred Pedrisa >> Cc: freebsd-current; Jan Bramkamp >> Assunto: Re: KQueue vs Select (NetMap) >> >> If your netmap thread(s) just have one or two FDs in some low range (say, >> under FD 8 or 10) - no. >> >> If you have a whole bunch of active FDs and your netmap threads get FDs that >> are high - then yes. select() operates on a bitmap of FD numbers. So if >> your netmap FD is like, FD 8 and it's the highest FD that you're interested >> in, select() only has to scan up to that FD. So it scans up to 8 FDs. If >> you have a very active program and it has thousands of FDs open, select() >> has to check all the FDs in the bitmap to see if they're set before getting >> to your netmap FD. >> >> So yes. kqueue() is actually rather nice. >> >> >> >> -a >> >> On 28 May 2014 21:48, Fred Pedrisa wrote: >> > Hello, >> > >> > Ok, but in practice, is there any performance gain by moving from select >> >> to kQueue implementation ? Or is it not significant at all ? >> >> > -----Mensagem original----- >> > De: adrian.chadd@gmail.com [mailto:adrian.chadd@gmail.com] Em nome de >> > Adrian Chadd Enviada em: quinta-feira, 29 de maio de 2014 01:46 >> > Para: Fred Pedrisa >> > Cc: Jan Bramkamp; freebsd-current >> > Assunto: Re: KQueue vs Select (NetMap) >> > >> > The advantage is being able to include it in the rest of a kqueue IO loop >> >> where it's doing other things. >> >> > -a >> > >> > On 28 May 2014 20:53, Fred Pedrisa wrote: >> >> Hello, >> >> >> >> Yes, but kqueue support was added in recent commits as it says in the >> >> netmap changelog, is there any advantage ? >> >> >> >> -----Mensagem original----- >> >> De: owner-freebsd-current@freebsd.org >> >> [mailto:owner-freebsd-current@freebsd.org] Em nome de Jan Bramkamp >> >> Enviada em: quinta-feira, 29 de maio de 2014 00:30 >> >> Para: freebsd-current@freebsd.org >> >> Assunto: Re: KQueue vs Select (NetMap) >> >> >> >> On 29.05.2014 03:04, Fred Pedrisa wrote: >> >>> Hey Guys, >> >>> >> >>> >> >>> >> >>> How does kQueue performs over select with netmap ? >> >> >> >> You are asking for a comparison between apples and oranges. Netmap is >> >> an API for high performance access to the low-level features of >> >> modern NICs. It works on batches of frames in hardware queues. >> >> >> >> The kqueue() and kevent() system calls are an event notification API. >> >> It is mostly used by application dealing with a large amount of >> >> non-blocking sockets (or other file descriptors). It reduces overhead >> >> inherent in >> >> select() and poll() by preserving state between calls. It also >> >> supports multiple types of events (read ready, write ready, timer >> >> expired, async i/o, etc.). >> >> >> >> Afaik the netmap pseudo-device supports only select() and poll(). >> >> This is no performance problem because every thread will only deal >> >> with a small number of file descriptors to netmap devices. >> >> >> >> Netmap is designed to bypass the FreeBSD IP stack (for most frames). >> >> Kqueue is designed to scale to many sockets per process within the >> >> FreeBSD IP stack. >> >> _______________________________________________ >> >> freebsd-current@freebsd.org mailing list >> >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> >> To unsubscribe, send any mail to >> >> "freebsd-current-unsubscribe@freebsd.org" >> >> >> _______________________________________________ >> >> freebsd-current@freebsd.org mailing list >> >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> >> To unsubscribe, send any mail to >> >> "freebsd-current-unsubscribe@freebsd.org" >> >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >> >> _______________________________________________ >> freebsd-current@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-current >> To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" > > -- > Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com; KI6FJV > UTF-8: for when a ' just won\342\200\231t do.