Received: by 2002:a25:7ec1:0:0:0:0:0 with SMTP id z184csp6976719ybc; Thu, 28 Nov 2019 08:39:22 -0800 (PST) X-Google-Smtp-Source: APXvYqz/qw2kXhq+W1OqDLDGn8wULZoKkX4g1GV8zAjM0Ugz9VoZglWCniVjZYEReIIZY60L1rMr X-Received: by 2002:a05:6402:28d:: with SMTP id l13mr39965282edv.286.1574959162280; Thu, 28 Nov 2019 08:39:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1574959162; cv=none; d=google.com; s=arc-20160816; b=eWM8n839i9PCRWGixSuen9qbBpGXAbl5nQnk4bDI+7U0lBoTkZoINP4dgfyaRdUXmq 1hVZwxVc2k0tHQ7nO5UfE7HilWlsQnePUDgtYUcXf4LZtjOtprGsNY1S9osEgrzc0trw zfDUXJ4VOErq+PCXh/d2t0O7yw3eGhvOhHuOpILusLDrt1XuTLJ8mxDGj0MU/qqi3dky ZhT5WwAC2MvMxR/bp/Z6JDjDXG5Ya0iB8u3Ol0ETba/qdVg9FqjYFum8TMxu9HnK+7vX B8hDH5iQHIN9xuecsIdsnkiq0NVZWeDS2QFfSa21OghRJxH+tcuL30J+Y94HvHLfr6n0 ktBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from; bh=zj2xj8Qdjka2Y/EDg7QtVY+plQTidbarxRa/jlBoGlI=; b=w9ulhzUzvCC9vQF4uCESNzr1NScoBIN8ndc9VumL+VG7WqxxSwfddD/y443xPXofWj Vuur99FTeNAtHOqbZKL93eEhiDZQS4gFiokEV+NtgDunN+Otecj8280tDCTyG6SLSkcU yEoX40NrisjaBGJdBYtFEOhafTqsxohijpwZIG9+JhvZf3p+ntTf6xHJCrYQi2/AdvdM PFFl2+Z35jXTg+KU+sLOya+R3viKKdsIhaD9arIkZ+DJ3+gQQLYDA7m+01lpQIeObqcC yhIn5SIKbZQKyusOczJdXvb9Bh1oZ9JJdh0RrCsYiQBs1LJlLDxvOzCxaFsIMCMY810y vYzg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h19si2684805ejb.181.2019.11.28.08.38.56; Thu, 28 Nov 2019 08:39:22 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726593AbfK1QhF convert rfc822-to-8bit (ORCPT + 99 others); Thu, 28 Nov 2019 11:37:05 -0500 Received: from eu-smtp-delivery-151.mimecast.com ([207.82.80.151]:37247 "EHLO eu-smtp-delivery-151.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726446AbfK1QhE (ORCPT ); Thu, 28 Nov 2019 11:37:04 -0500 Received: from AcuMS.aculab.com (156.67.243.126 [156.67.243.126]) (Using TLS) by relay.mimecast.com with ESMTP id uk-mta-230-AxEAhMhqPBirovqvBRqSxg-1; Thu, 28 Nov 2019 16:37:02 +0000 Received: from AcuMS.Aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) by AcuMS.aculab.com (fd9f:af1c:a25b:0:43c:695e:880f:8750) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Thu, 28 Nov 2019 16:37:01 +0000 Received: from AcuMS.Aculab.com ([fe80::43c:695e:880f:8750]) by AcuMS.aculab.com ([fe80::43c:695e:880f:8750%12]) with mapi id 15.00.1347.000; Thu, 28 Nov 2019 16:37:01 +0000 From: David Laight To: 'Jesper Dangaard Brouer' CC: 'Marek Majkowski' , linux-kernel , network dev , kernel-team , Paolo Abeni Subject: RE: epoll_wait() performance Thread-Topic: epoll_wait() performance Thread-Index: AdWgk3jgEIFNwcnRS6+4A+/jFPxTuQEdLCCAAAAn2qAADFPagAAAV68AAChM6IAACxvV8A== Date: Thu, 28 Nov 2019 16:37:01 +0000 Message-ID: References: <5f4028c48a1a4673bd3b38728e8ade07@AcuMS.aculab.com> <20191127164821.1c41deff@carbon> <5eecf41c7e124d7dbc0ab363d94b7d13@AcuMS.aculab.com> <20191128121205.65c8dea1@carbon> In-Reply-To: <20191128121205.65c8dea1@carbon> Accept-Language: en-GB, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted x-originating-ip: [10.202.205.107] MIME-Version: 1.0 X-MC-Unique: AxEAhMhqPBirovqvBRqSxg-1 X-Mimecast-Spam-Score: 0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jesper Dangaard Brouer > Sent: 28 November 2019 11:12 ... > > Can you test recv() as well? > > Sure: https://github.com/netoptimizer/network-testing/commit/9e3c8b86a2d662 > > $ sudo taskset -c 1 ./udp_sink --port 9 --count $((10**6*2)) > run count ns/pkt pps cycles payload > recvMmsg/32 run: 0 2000000 653.29 1530704.29 2351 18 demux:1 > recvmsg run: 0 2000000 631.01 1584760.06 2271 18 demux:1 > read run: 0 2000000 582.24 1717518.16 2096 18 demux:1 > recvfrom run: 0 2000000 547.26 1827269.12 1970 18 demux:1 > recv run: 0 2000000 547.37 1826930.39 1970 18 demux:1 > > > I think it might be faster than read(). > > Slightly, but same speed as recvfrom. I notice that you recvfrom() code doesn't request the source address. So is probably identical to recv(). My test system tends to increase its clock rate when busy. (The fans speed up immediately, the cpu has a passive heatsink and all the case fans are connected (via buffers) to the motherboard 'cpu fan' header.) I could probably work out how to lock the frequency, but for some tests I run: $ while :; do :; done Putting 1 cpu into a userspace infinite loop make them all run flat out (until thermally throttled). David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1PT, UK Registration No: 1397386 (Wales)