From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.210.178 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796270592; b=LeaDHm/iPU9wW9XZuWZ21LtEa7rr7NaGbbz7p7tLoWSm7Q2ecSa2RJGkpGkZ9D/Ge8UI aO32KZQCp6hQNQ1ZPzq4cmTb+VkAJttnbFqeUoTT5wisnSTuz0+qe8Xe1J+g0PGr9df8g nR2A9q0HbA/1qJM6te01O0TBFMuP4TOwBaWf4oHXx5W64/J1V/Bi8iw548iGdk7VBfxXe OfFgatd9YO6YlnSODM7CmjNNQbF0Rz5mKi4GuylyvzHb/Yjfab/8bldSA5QZI1r+0N/6R s8sWQsuKxiU5sGEQZt79ti8XI75YqUhwSgVH5ufOhyTBXsZqhxVUPT+/BNtdJsnWevw== 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-Forwarded-Encrypted: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=YGKKxAjicChPRJJs5BlMbaYD+ognQXHHzDSSO+4WaY9r739CXVzJrTje+wlun1jhCDmi 0Q8dnbkd+sZs7Y9D+lU1rGazlcKo6s0Wn7HZ3pyaMfgwfGDmR0SdtOVTOj3ELv3N8eR7h 0RzVloLql9MSttXKe5b+Ov1bhNdWZHol6swdWqICCLsvtqASEBmhLy4BoU1vcX1f9UTWT rKESxDulgdAdS8kQvP2gfCbiGLva7jmwCdFDJgWw3Ku70n2sptzPv8Z5nKBkQGySAA4IZ 4M6+VnONe2Gv+47AR1oQFqCOXirg8OLh01I7M4R2O03U5QY9Hob0zA8Gym8TFc+JHSw== 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.178 Received: from mail-pf1-f178.google.com (mail-pf1-f178.google.com [209.85.210.178]) (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 B2471606A32C for ; Thu, 3 Dec 2026 04:03:11 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B2471606A32C 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-f178.google.com with SMTP id d2e1a72fcca58-8b904d10882so5785535b3a.0 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=1YKg+wjF95J+aHbPif5KwO2GKz4AmdWbD06B7niBPfCXAwpWW46rxpjH1g0oAGhBbF NSemn6mYXPLqQfmAHnaQuhiuqXbEuw6HBmtUu2jQe2Az5nklr6EaQquaOgSj26rl8tqu JD8GxUpb6o+y/CCg7mpgt6ZljJQEPFvsQ0QljJCxzrgukTet5YKm+FnVdDsmXW/1fwTm vZW4A8xCKU67/+lsEAfYA7/py/kiD/RpAGyhHA3452K1Y6PYmeWfoWruOfDoFEVDFAqf m9U3nnBe/7CitFYYz+BCq40voz+ad+HrVeaoS4zOtMxRbdLJvoHhNBrkDrplZRZ5KuhC r4ug== X-Forwarded-Encrypted: i=1; AL+hErF2bTBJSBapKSO+P2Z7qrOUoW6G63mmagcGhIL2cUJq+e2gBZXIVSkhoDYnGaMis99/De0=@vger.kernel.org X-Gm-Message-State: APuU4Z9cWSavaH3FpR2Z3xERRq1awo03P2Y7970D5wo9EbK4JQMPHu6d MxQApBFKAs96ayHkJem5iWITXkeLxesPiIq1UEqaGzoOtF64iPEVI8uN X-Gm-Gg: AZFdTZeOez2YCsFHqVlBPuoOu1Jm33r/qG5GObzd0mvKjnD6HKLgswjLYxLxRZupW7m S6QwJEJIb7xRJWt5f30c/ii8HHTZrxlmRYtFm5S+iWeLnLVrxlVssRm42C4p8TB8wmrWYppwCYX av5bBCJ8c7LDXJII0WY7VI4RC1n87gmMZ6H4iZQCyRsFh4IJeRIpyIMcVpu1kb5tiACJJ+3+qPN xBOB4nmyyRFXne3sXhIorRu7t7B/vDac5vzn50KNJcqg7ZnzoEr2CNn+O6ZCOlkzIFGjiBpUkRa 8IwY0vcaCNNlrXpmb0QCJMMYuOj3EKp3X+pVHeie2nftc2Z6Njf/gHk3+znsh4vV4kBJ8uVcME+ 6QUC1ip2u8AaY7a0Ft14KlbJb9YiEX+Aa5lbtBmDeqL6pKQF9Bm7kVUpt9o+L+HjQf167KLFbJI vQ75x9laLjLO56xVozlhQVscZPJp1WkghlRv5iy7vHhIVl8TInU1ZMoLCiPufbOyZAxq0N38pgc dpxpT+s+q9rxRorVpK45ZQIWfDJkBTBUOrC/jCoPeqB98wWrjOer457B0cgyz4J0R28M+93R3AC KX/Uq1X1FvoiboscKv30Rf/sXYffqu8Y/5gQeCnd02H1N7ex9eajtHfpCE4DqE+ooBdPzWYyCRL tsxvenJNegOf59YmtYVpbKr5nXF8iDUh2tg== 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: bpf@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.