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.129.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id B354323EA99 for ; Sat, 14 Feb 2026 18:18:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771093130; cv=none; b=c1dCkdDZGQMbZESWBpZ/zF1ZoOAW5TjGLvo8fDo6VB2qXM385RixxmsPB/of/aOc0FVTmgxVnNJcLnUYa8zRSFuDymRUwJ2zxgeH1+TTFM/N3xoRZ6Tl9KQOJWTNZW2zRl154sfLZdfMnNTGheDymxweoK4qIZfpDdbobtTJf4Q= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771093130; c=relaxed/simple; bh=yEelQuIDmS5A4nF6l+/HEJSY7JzkT8eOu+50RPHRcm0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=ncsljQ0ZyXTjeOU4/Jj7sg28pxuibKub5Z3FEAp1dlSbx2YoL0X5s1Ku1FG3IND1NLiIifhVTbuYHrDi5N88m4vcSFiQiJ8saoeQY0hU0IeBhk2xWpzlsmKRoC9JYdvhLyqOq9KP+i4j7+gK2oY9++tn22OtifmerFc65p4yH4g= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=Vo9DZrym; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b=qdIvS4YA; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="Vo9DZrym"; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.b="qdIvS4YA" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1771093127; 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: in-reply-to:in-reply-to:references:references; bh=hGvEkNLWiFwc7xvXmNfeTPVLJWvbXxlHncgYSGzv/5o=; b=Vo9DZrymcApH6zTFCb14CAigQ435Eu7rpwULe8eBeZhvuXMc1dK/jpQ2bJEdCqqm3IMxJF 0IN05htTHQ+lG5e5FME4DIr8qQoWvRRjvvwNw6N89rGqxpAmygASWZHAKWXVKvUOTs9SvQ f1nxi9i5d/Db0XLMgjE59KKsOrgpM6k= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-445-PBfoKW5xNKaCstanmwgdNA-1; Sat, 14 Feb 2026 13:18:46 -0500 X-MC-Unique: PBfoKW5xNKaCstanmwgdNA-1 X-Mimecast-MFC-AGG-ID: PBfoKW5xNKaCstanmwgdNA_1771093125 Received: by mail-wm1-f69.google.com with SMTP id 5b1f17b1804b1-48372facfedso16317685e9.0 for ; Sat, 14 Feb 2026 10:18:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1771093125; x=1771697925; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=hGvEkNLWiFwc7xvXmNfeTPVLJWvbXxlHncgYSGzv/5o=; b=qdIvS4YAkVnmIoOstaP/B0Uq5mvZXin2Kw/oE0qZ+AGOlpqQB5S4kzO5UtIXmqdzJq MjttFGFrX2hq7X9X/7ixu8LObFTlMs91edNW1hO1yHD5mRlOAbQorfkVKf7JZZW7Zofn HBb9U/2tqy8BSCugSz4FaJN1b/eEg5vAgWWjMDymZimEZOwAO00wbMcCgKrLyC2Ow+dB 9TkbDswNKZtB+X3T2CGTufhi/NCrgNXvpmBUCMnd/BUjSOzoXwX8wNyhQSHZEFux1Ofg dSjQd2hQTwEgLEUI4DoBwTQqDkftSCz3DAO6h3J+78Zq2EqUloMK2m7wyRTwhjZnP56O QyiA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771093125; x=1771697925; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=hGvEkNLWiFwc7xvXmNfeTPVLJWvbXxlHncgYSGzv/5o=; b=AyIVVcRf473EP1HUay0A2DKOYjtL+TNoXad/Hmo9hAmGLPdkEonYjCSri5yWhK4DpE yMIL90F0ca4wNhwgAKuytTRTGMCu5AtZYeUYZcExvg09RjD9f5joGNZk8HoJdklukFWE J8fsygbNJPO+bwuI1mPeEQm3uW6PqSu98MJB6MV/3+74+Q0AdZb1xt3E6OIhwl7+GdG1 4ac+hcyUsYeWN/hDPgfR4XbSjh245Ysqtl5ZuGa9lHy6vk/2+5Opq7X45uzHCLUC3QSA 8e83EsnEuQ9RN/WdkFL/txXM67WuzkZ8+a8OpnWwR7RYpQvDg9/ddki6XEd9gtFXsaoP lvFA== X-Forwarded-Encrypted: i=1; AJvYcCU87vbkEG5fgVSqPpSlu0RfAOPbwqmZ/YzNJrAQphYAEHe99Pgcut7U420ZudnMMHuq8AEktWi7uF9ziRM=@vger.kernel.org X-Gm-Message-State: AOJu0Yxtqt/DsGz/7n9CLJlU/GUuzajBLWY7g2h67KY/F1HNTiMkncEM 2Ug9rZ9Y/yqPyL4zFGYutjMAoujUd79/iIUmeBdHVcP/JtdPcuZs5N3+Hcze0T93Gv2DRydeB2M nmHskk0sUpcMKavNwmoHVF1Qxs9uWRQ9eDL0fTTBhiRqoaRfKPkODslEl37+K76IAwQ== X-Gm-Gg: AZuq6aKYfzioo3iNEvH+QVC0/TfdunzvC6OTgSacF9pRsACFLKVxbBoH2P/B/XOazZ+ RuVxTqxmVqLMcUZO1g5dwrpMtjPEJKGCjR6YWFIkAEo4639TTv79mR/6bISWbpGD5QzsHHA1ZfZ ybYgFyzeaZcptok1mQxb74+zqoKPZt5qfHDwwYOzKI5YtvY565sjkCgUdC7isaMw76taCBUmQfY WOzuaJlrRfxaZY8BIl62B4JKh4nn8iz/LutwxaAjddzKUWH2Y4OQVJFeV98g2addzh6eY8XE9oX mFoViKU0mRuqwLiIPM2XR6hNi3vmdThNko+JnnAz/qJCxxVjXz7sinboQDqZd0nnaE+3tMEUFG+ JjZGSGvuM7xnlETkPDA== X-Received: by 2002:a05:600c:40c4:b0:47d:403a:277 with SMTP id 5b1f17b1804b1-48378f062b0mr48481425e9.4.1771093125063; Sat, 14 Feb 2026 10:18:45 -0800 (PST) X-Received: by 2002:a05:600c:40c4:b0:47d:403a:277 with SMTP id 5b1f17b1804b1-48378f062b0mr48481055e9.4.1771093124647; Sat, 14 Feb 2026 10:18:44 -0800 (PST) Received: from redhat.com ([2a06:c701:73e3:8f00:866c:5eeb:fc46:7674]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4837e565f5esm65320555e9.10.2026.02.14.10.18.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 14 Feb 2026 10:18:44 -0800 (PST) Date: Sat, 14 Feb 2026 13:18:41 -0500 From: "Michael S. Tsirkin" To: Simon Schippers Cc: Jason Wang , willemdebruijn.kernel@gmail.com, andrew+netdev@lunn.ch, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, eperezma@redhat.com, leiyang@redhat.com, stephen@networkplumber.org, jon@nutanix.com, tim.gebauer@tu-dortmund.de, netdev@vger.kernel.org, linux-kernel@vger.kernel.org, kvm@vger.kernel.org, virtualization@lists.linux.dev Subject: Re: [PATCH net-next v7 3/9] tun/tap: add ptr_ring consume helper with netdev queue wakeup Message-ID: <20260214131703-mutt-send-email-mst@kernel.org> References: <0ebc00ba-35e7-4570-a44f-b0ae634f2316@tu-dortmund.de> <197573a1-df52-4928-adb9-55a7a4f78839@tu-dortmund.de> <0c776172-2f02-47fc-babf-2871adca42cb@tu-dortmund.de> <205aa139-975d-4092-aa04-a2c570ae43a6@tu-dortmund.de> <59529fd2-2a08-4a89-a853-27198b76f842@tu-dortmund.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <59529fd2-2a08-4a89-a853-27198b76f842@tu-dortmund.de> On Sat, Feb 14, 2026 at 06:13:14PM +0100, Simon Schippers wrote: ... > Patched: Waking on __ptr_ring_produce_created_space() is too early. The > stop/wake cycle occurs too frequently which slows down > performance as can be seen for TAP. > > Wake on empty variant: Waking on __ptr_ring_empty() is (slightly) too > late. The consumer starves because the producer > first has to produce packets again. This slows > down performance aswell as can be seen for TAP > and TAP+vhost-net (both down ~30-40Kpps). > > I think something inbetween should be used. > The wake should be done as late as possible to have as few > NET_TX_SOFTIRQs as possible but early enough that there are still > consumable packets remaining to not starve the consumer. > > However, I can not think of a proper way to implement this right now. > > Thanks! What is the difficulty? Your patches check __ptr_ring_consume_created_space(..., 1). How about __ptr_ring_consume_created_space(..., 8) then? 16? -- MST