From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796270592; b=OpHIHAIVjYOigDgPNuWp92wsrowQ94/ta75aZnWUXMqCG5bczePW7vCzjecTRTDEorIJ R5M32s7lqDh0a+tFrPp2ohjn5eXgoQK3CGlcQF2bNWM1RFtwYWNpyec9AI8rbdznxKnBO RR7ACNj49l40TeMppYfpE8m6SfCD08TTjYgLCAjwIEzBGf8gz3tFCnh34aezcqmPNZiuI WxMZRPodywVV837Z4DH4OyIwxwPXra4kct1sYsILO0aAYwwb/i+bvPfPG0hpFb5pjrOAb QKxl/9Mvfkbvc2mOB4yl7rh0hGUo5Tr8Qi+iUUkEv/9xnX2YculLuS1vcwG1iuqWk5w== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796270592; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Gm-Message-State:X-Gm-Gg:X-Received:Received:Content-Type:Date: Message-Id:Cc:Subject:From:To:In-Reply-To:References: Content-Transfer-Encoding:MIME-Version; bh=XdZRG4dAj4Hke+N2ypLOuvzw/wTVjl+bDVD1cABaOOA=; b=qxHBc7nq8sF32f3uw7lT/cnXstzMLFAoyUaKIoKAJJFgoEajhJOgmfgV23vcYNciJhvf jHMRDlslA5w2K7I7dllOkywJPQ1ZZ04zSZIkpfRSQdckRE9v/KtO1G66prZAd7C9whS6x 5E2gKIu6QhClUL7RQHzHWnweL5Ztgp3mPhyf0Sx8eKFyqvxZnp8W5RauBNoT77AIVu4tZ Jnz4MkvD6TPlGnNqaUPvy4IenM0uKiUpozKngZ+1jJskM0awQ0MlEOifgy03gwClhIvV+ a4FyMOLp3tl6u4i9RBnt6pt1IDsGI4OVBQ7DeqBZgqmhqD/lf6/jbt6eAg5T6yIoevw== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MQwJ7ikA; arc=none smtp.remote-ip=209.85.210.176 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A8656606A322 for ; Thu, 3 Dec 2026 04:03:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org A8656606A322 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=MQwJ7ikA Received: by mail-pf1-f176.google.com with SMTP id d2e1a72fcca58-8b58d6f67a5so6993104b3a.2 for ; Wed, 02 Dec 2026 20:03:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796270591; x=1796875391; darn=vger.kernel.org; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:from:to:cc:subject :date:message-id:reply-to:content-type; bh=XdZRG4dAj4Hke+N2ypLOuvzw/wTVjl+bDVD1cABaOOA=; b=MQwJ7ikAOJcHejqODArujIaQz9ujqVRBf/SDelli4nAX3ATk4obmQW0gmLe3Cerd2d rHlqlaNjAuY6ane30tD6KzZ2/c9/WpZXMozp6xSCioJo6nuNdJVk7zt+yqGz182iHcSe RYAtrR0ZSTyjAD8rKN0wW+jh1e+F21o05jOiK4Y6tAq4p+VApihKOcUH60voJDJVQJfM Py8RVl94fSDlJ+PUKpBCHQfW3Hhn5FoN+KvaVH7JPc1kOKdhHbdzUrhr/xxg/fPt2e7r D30oMW7RjUy9YJfWGCdZ//FpV1vkwfMrEqsPKwksF3YrpzUYrFoPPPE9WaGpanUygRmf +B4A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796270591; x=1796875391; h=mime-version:content-transfer-encoding:references:in-reply-to:to :from:subject:cc:message-id:date:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=XdZRG4dAj4Hke+N2ypLOuvzw/wTVjl+bDVD1cABaOOA=; b=QV0BBf9X8jUtnt8ofdpXz6iJ7KXCAcaAxwl4ldr7uOgIHoMqW4u3dbkIsPcuzh9bFw BwEBkLRgfAJn4ScrJjRLquRsBcyqtFoWoZ5VJwISBTswHubDb5FJMrwE4cY9JcBKbiiY /y9C9k2Pf/krnOkJkyE+Wzj9ZjwxQv1pjsoXbFDMbkzYeEaI1fuMRHrQntP9dn8btJ7/ xQO+OkU0De227Wqif4zYTtWQ4+AFQTu+EA4iXdWj+qDNz14sUpewcPUv3PFPbGG+QZrT mmpddyogmRewP3raVll5TEDDM+7VOig2WebLYejFFUw1STLzZ7fLatN4Y0tFA78NrDp4 hbWA== X-Gm-Message-State: APuU4Z/XUBMf3BykXxGSeE5RCpVx8M3sDnBINIXu5N/zsX3CfXSDwt0Y 0EU6jxJXPO7aTE2xMRUjUeASAIKGUrCllVUcsqW0k3r8r+CKvZribuMB X-Gm-Gg: AZFdTZcInM2RSTpPvoSvML4uu2nR+G6+ZK7sQ17WlcgOG/Tp9venh4vBvQtsqX+xl3F HQtRoxfWYfkNRoc73bwJjH7n0fMJAaO01KnQslSUiJtJEye053uI3vWSCxc9qWnctoRixW39FPL 84xnCNlvBj14I65u8MwWPTSTwlB3ou2SH0h49oaQD1CoAVkDvNW5T1bEWpr47QsqY8j7oTxLO46 bHPdsX9iZ9jtog1BgdtClP2tW3SukZIss4EIO4OXV1DFcMwPttpukrFXnsUn0S0tWfPaWr2o/rg +RghxfGbkydfe3gp1lR6qlu4RLYbMf1tQYXXtqPpKVEVrX+JyWXwUrtm9ZPRKiECTXOm4FjyJez /I488pSQTUVIDPd8I/NMcpokbz9Oj7VNVUBHBZ5nTBahyeCS8+FNvZW6Db5dEpG0vvvFbr3ubiw HXuHFFRuq0xH9cZHrq8XcI8vwx/++aTjO0b/ZeNQ8xFLCBFu221Ggzem+V8CwsaxVbfzilf9dgY amrBXxGJOAANrBcm+I/azZXl2y8HwjxtY0IHhnOVxee+wmiJKK8k/3PwOoTqmUoUEt/irpDQ00x OF/TfI8IG2LvD9cM3sPbantP0iys9+vhMqqH5gSJ6zrL+LUiTtpUNDlqHDj0bPumQFBWX1WJKjm 6C5hwu/EPF4DxQ226aaEM2gZSs8Fw9je9lg== X-Received: by 2002:a05:6a00:2d06:b0:8a9:95d6:31f4 with SMTP id d2e1a72fcca58-8c87c8605d3mr40033283b3a.32.1796270590690; Wed, 02 Dec 2026 20:03:10 -0800 (PST) Received: from localhost ([153.61.198.255]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-8c87343f726sm23831366b3a.36.2026.12.02.20.03.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 20:03:10 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Thu, 03 Dec 2026 04:03:09 +0000 Message-Id: Cc: , "Andrii Nakryiko" , "Daniel Borkmann" , "Martin KaFai Lau" , "Eduard Zingerman" , "Kumar Kartikeya Dwivedi" , "Song Liu" , "Yonghong Song" , "Jiri Olsa" , "John Fastabend" , Subject: Re: [PATCH] bpf: ringbuf: add wakeup coalescing From: "Alexei Starovoitov" To: "Michael S. Tsirkin" In-Reply-To: <20261202020853-mutt-send-email-mst@kernel.org> References: <5663e1035f52f0b358710721c1c77e5c73552a2e.1796135892.git.mst@redhat.com> <20261201192254-mutt-send-email-mst@kernel.org> <20261201195613-mutt-send-email-mst@kernel.org> <20261202020853-mutt-send-email-mst@kernel.org> Content-Transfer-Encoding: 8bit X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 On Tue, Dec 01, 2026 at 11:19 PM Michael S. Tsirkin wrote: >> No. Not every ringbuf is a stream of samples. > > Right. What if I limit it per type or something? Can make it > palatable? No. The type doesn't tell a stream of samples from a one-off signal. A ringbuf isn't tied to a prog type either. Progs of different types can share one. > Shrug. I didn't write this thing. So what can be done about misbehaving > ones, that hammer the box with wakeups on every event anywhere under /? > Any idea? It's a wakeup per event only while the consumer keeps up with the prog. bpf_ringbuf_commit() with flags == 0: else if (cons_pos == rec_pos && !(flags & BPF_RB_NO_WAKEUP)) irq_work_queue(&rb->work); So slow down the consumer. Try cpu.max on the cgroup of the tool. Once the tool is out of quota: prog consumer rec 1: cons_pos == rec_pos wakeup throttled before it reads rec 1 rec 2 to N: cons_pos != rec_pos no wakeup next period: reads rec 1 to N That's per box and per tool. No need for kernel changes. If the quota is too low the ring fills up and records are lost.