From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by passt.top (Postfix) with ESMTP id 0BEB95A004F for ; Fri, 26 Jul 2024 15:26:17 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1722000377; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=iALrY0Y+fS7r3/Krm9nNsI8fyEgONJz0053bFDq4NAM=; b=Y71EfSRi/KOAWsyA/uZB60hV5Gwg3PfjMEsdmw82LlR2hd6RKbSADR+DiCbB4uylHCTVT2 /HZrCwdTFTJlk2czrvSfIu7zHFZWilt9sF9C77KdCOenWtjMQjbVNGza/YivlgR9HFAMVJ fRJhiLAPX5pJ1gi0E6GMOBcrZpvyP08= Received: from mail-oi1-f197.google.com (mail-oi1-f197.google.com [209.85.167.197]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-600-E1MtfPvVN0SuIIzADTakgw-1; Fri, 26 Jul 2024 09:26:15 -0400 X-MC-Unique: E1MtfPvVN0SuIIzADTakgw-1 Received: by mail-oi1-f197.google.com with SMTP id 5614622812f47-3db1595837dso1171470b6e.3 for ; Fri, 26 Jul 2024 06:26:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1722000374; x=1722605174; h=content-transfer-encoding:mime-version:organization:references :in-reply-to:message-id:subject:cc:to:from:date:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=iALrY0Y+fS7r3/Krm9nNsI8fyEgONJz0053bFDq4NAM=; b=IhRn/hgk4EwDeDGCeXOyvTGReDI+X7aDnZsf6zq7Ibb4lL95Jw7DMVnDVWZcdACj6R fVTZ2OSG8NEV+rwdr7j4pi+RmCmU6RwXkaIbMj6YCr4SAfaaGa3pFw7vqdqdoqbeLImD HZ4Na/I7XQcGmkm0jjwpK3cnYhOeT/VcnDwPkwxQV1uhw4jAcYCIl6U97xvSrCLpDbZH olmDKaw8kvebNxCZXIgyebjJe9OSvsGWPHVE+A1X8jCgHz5/2NzsnfftxTDbzgNb7tIz euivON1DfidCUKn3LCbPEkAlMo4B4Bf1wsx5sxz9a6DRyzfmPDdVKOdGHtnakhg5wl78 F+vQ== X-Gm-Message-State: AOJu0Yyx5wVwLpdfyxsE/vCWcWc4W4cTzwdur+6XSnkySZZr4sypq5AU LsgHObq4n0UCslyAamfD6PIIKokF29lcUWNlqzUJqZEvsqsmYj5Fz/LSom+QgwQB0G9aytFJSsP 4DYjDUjm9RIEtO6OtcjVfpVIpYjPEYyRCCJ88u1FR59F5aQV24wUDo88szl1d X-Received: by 2002:a05:6358:6486:b0:19f:5a42:d2bd with SMTP id e5c5f4694b2df-1acfb98751bmr581207255d.22.1722000373708; Fri, 26 Jul 2024 06:26:13 -0700 (PDT) X-Google-Smtp-Source: AGHT+IE6LxKb3eJqDiyYObnaP9HtEX750Vo4GGDAjQa42BYf9ScKIOlfS5WSO4SZEy4YpJpbpNEpZg== X-Received: by 2002:a05:6358:6486:b0:19f:5a42:d2bd with SMTP id e5c5f4694b2df-1acfb98751bmr581205555d.22.1722000373182; Fri, 26 Jul 2024 06:26:13 -0700 (PDT) Received: from maya.cloud.tilaa.com (maya.cloud.tilaa.com. [164.138.29.33]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6bb3fb05265sm16463626d6.135.2024.07.26.06.26.12 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Fri, 26 Jul 2024 06:26:12 -0700 (PDT) Date: Fri, 26 Jul 2024 15:25:38 +0200 From: Stefano Brivio To: David Gibson Subject: Re: [PATCH 3/5] tap: Don't use EPOLLET on Qemu sockets Message-ID: <20240726152518.7daab5bc@elisabeth> In-Reply-To: References: <20240726072031.3941305-1-david@gibson.dropbear.id.au> <20240726072031.3941305-4-david@gibson.dropbear.id.au> <20240726100056.235b65de@elisabeth> Organization: Red Hat X-Mailer: Claws Mail 4.2.0 (GTK 3.24.41; x86_64-pc-linux-gnu) MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Message-ID-Hash: MUJTACIZR5A22SA6SXFB3GH4LUT3EMBK X-Message-ID-Hash: MUJTACIZR5A22SA6SXFB3GH4LUT3EMBK X-MailFrom: sbrivio@redhat.com X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: passt-dev@passt.top X-Mailman-Version: 3.3.8 Precedence: list List-Id: Development discussion and patches for passt Archived-At: Archived-At: List-Archive: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: On Fri, 26 Jul 2024 22:12:27 +1000 David Gibson wrote: > On Fri, Jul 26, 2024 at 10:00:56AM +0200, Stefano Brivio wrote: > > On Fri, 26 Jul 2024 17:20:29 +1000 > > David Gibson wrote: > > > > > Currently we set EPOLLET (edge trigger) on the epoll flags for the > > > connected Qemu Unix socket. It's not clear that there's a reason for > > > doing this: for TCP sockets we need to use EPOLLET, because we leave data > > > in the socket buffers for our flow control handling. That consideration > > > doesn't apply to the way we handle the qemu socket however. > > > > It significantly decreases epoll_wait() overhead on sustained data > > transfers, because we can read multiple TAP_BUF_SIZE buffers at a time > > instead of just one. > > That's a reason to keep the loop, but not EPOLLET itself, AFAICT. I'd > be happy enough to put the loop back in as an optimization (although, > I'd prefer to avoid the goto). True, we could actually have that loop back without EPOLLET. But the reason why I added EPOLLET, despite the resulting complexity, was surely increased overhead without it. I can't remember (and unfortunately I didn't write this in that commit message from 2021) exactly how that looked like, if we had spurious or more frequent wake-ups or what else. Maybe that was a side effect of something that's fixed or otherwise changed now, but still we should give this a pass with perf(1) before we try to optimise this again (if it even needs to be optimised, that is). -- Stefano