From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.215.181 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796226981; b=uOaOPXuwB1Iu6j3eTjt+zVFWoe3nDhmO3WHfd9xM6JFircJtV1GUiOygjNHYBPHx+XmB 1S9wYfECtOXLBq4RTT9xlOv+NVztn9MX/OWyAQdPh2HlWWa0CzF8VRLdcr5K06L72HOfz E3tj8Z9E7+6BOEwbC/yMGwZY5u2rwJGKAO6+0fN5klzl4s3gTMwHA1mfHM3HG9q3NazbG Sxoh8k7Zg4VDPZNuLJiZ9MMjfi4glEM1jiCu5YrkcZU7ubqYBFy3Hm8q/BvzyBMQ5ba2T S8dqGvZdnHKSr72gv9cvTLQOjDrSfmizNEzVRafUzpQptGGpt9FFgdzEQaVapwGyF0A== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796226981; 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=HMyIl+WS/uAuZasKI+BuEqKrO7ow4KtcMF7LXuvIrBM=; b=zJyIuED2krgGX9Oteqxtfj8jvTHdEBK+Irro6zUteiEEJ4/iKaZYTbVmzYyH6tBvtx2A bMEIVzZchi4h+EtzdOSQRy4jqw/cVWPfIx687020lcUpYW5wMUGa7bNfzhHcZYg4Zz3F/ ExBwObszv7ZQgifpiYNIquo1bewnb7lGrz6euvZFFMJ7pDDWDQYa8AFxu4eb+K+W3xU0i 33d/Xdqxh7i4mb28mIFiQiDFVn9OrXRcD2GCax8MmSBwto9g1KTjvPlVCZlniBZ4oTCg5 NVopLrMxyJUuC34ruWE4MdWqvI4P2Mr4XRGVUEv1VoMIGsGyzSdBN6NPrMhfihAzoEA== 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=Wh9FPrLP; arc=none smtp.remote-ip=209.85.215.181 Received: from mail-pg1-f181.google.com (mail-pg1-f181.google.com [209.85.215.181]) (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 B4A04606A31A for ; Wed, 2 Dec 2026 15:56:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org B4A04606A31A 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, unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=Wh9FPrLP Received: by mail-pg1-f181.google.com with SMTP id 41be03b00d2f7-cddc250d815so5216567a12.2 for ; Wed, 02 Dec 2026 07:56:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796226980; x=1796831780; 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=HMyIl+WS/uAuZasKI+BuEqKrO7ow4KtcMF7LXuvIrBM=; b=Wh9FPrLPgfgx9GM5tCJ+fLRzoG3VrcDF0goeBIXrbXV06oG08Sabco44imhT+oa8ER 5GLqpSg644SRTMz28tJ+iVxcx0+D6UUp83nA6ZQjY1MeXzAUwZHpUiGjYNL1/aSWPrxt qRXSoJuKlzQwss72YW3sdOnwCc2RoBVLMRIaZg0EuBJpgVyLtZ0HjymzrF/Uhgmo75uk Fvxu9WZHtqcOeOfA5YqEeq39k2Prslbnft7E2YRE+zNJI8YmWW84CQGMcXckBZ9GQSqm 9mIRy/YBN65evHDgGJsWaRlfGtT05mXNrOfhVGF5unhnF/s2bn7l1ZwZOZOyhAXO2SSU ZlOA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796226980; x=1796831780; 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=HMyIl+WS/uAuZasKI+BuEqKrO7ow4KtcMF7LXuvIrBM=; b=envjijORnGIXyxhLCwSlCZw3L1ZVH1EItZaXXiFUtXE7pI/L3VR2SSvWCku3MWzmgl +luNz4Xo5rbWMFTBS8UJMMMbQWqaOPFeJIpphms5WJzteL9/tZ26tkGW9Azf7BxmPRLW 9N9H6ZFpknNZYvwlyhGiYXzV12aI9/t6KJVEuKIRPo2NPKSAMg+k/ZHlrc6W7qifiTxv s1EiesZZnc1/EVBkYvGLwz899qtk97+Y0ol0qeFi9fAsdbVRx6e21HM/mQs2urAPzzQk BIMeeX3uNB0507QwOEbMgz7K9FotPtfNYML7pdRxaHYMcvd+4SQeYvre1kbHjUq/TWMR 9UPw== X-Forwarded-Encrypted: i=1; AL+hErF8xa1aZdPmbMdxvSps27Dyw446HMX95rMpGJFVTWfP7sioPvEQNxub6p4Lecoo5rzh1Go=@vger.kernel.org X-Gm-Message-State: APuU4Z/J/p1u4hye5OblpZZQVxwTxsbK2DZz1HYrROMAtmdOWtXjBVD7 CL6PF8qPpo+OcJxnm/CowzKvMLez+coS4nAzD9SHetkG2JkXpUfZTBJ+ X-Gm-Gg: AZFdTZc4JAfmj44ZgCu/CO9oJfp0LkLce+HnYibvtYP6UAfY/OO6SKRebiWokn1QIl8 4Xti63ZbUh2Bs//9sOW1AD1hPweZvBV4W1UM//M58aN873F2VBjuFSgpphehNdkItM6ZF+gjqeQ IgWrnt/V/AoGDSiw0PCQcsoQzbtorHFgetZe5jNBzpkUFquCsxINNQakxjSqhd/eNb7wUeTimul rk8r7HS1XxdbZaTO43NGHXLjwBW5p+R2MMW8RdYUtyw7o2mTiQDogiGSaBcsn8c2Dlr4uFN7ZWw llxhD8wq+vV6fwq19bvKQ+s9Vsjo91iyTrrWaXaXnOi0AlHn9trictmCx1h/RLywMD81PRzmlFh +q1sAKF60l6w2Xx0lPbwZXRyPrdDRM/3jR8wUrRqdjmIUUbwGMhA41o55WglCBF7GjAHeXsQpwr L7ODnn2Oi0khmUn5ktN1pC/Y3sKPqTqoIBjP9/+wlieZjTebyEZBkykPRfEn08ZJabBKUk1O6vO 2unSKAF9vA/TY8znY/332gcWZe85VcwrRzNlmdNV1BpCX7pQZyAh/n01IiiF8KUetU0FphiBf+d 6Ye3QwMQ/Briegcr1CIuvMj4HcbaxkcBcciHD/ptSUjE+4tT7y5SOTwBBHmS5FUGJ+lem/kJvah 4iI2EDxK2WlU02LcREXZTAwWY0WYKha8OEA== X-Received: by 2002:a17:90a:e70c:b0:3b1:ba59:56a1 with SMTP id 98e67ed59e1d1-3b41c939b8cmr37533664a91.39.1796226979542; Wed, 02 Dec 2026 07:56:19 -0800 (PST) Received: from localhost ([153.61.198.253]) by smtp.gmail.com with ESMTPSA id 41be03b00d2f7-cde6cff4c1asm22229531a12.15.2026.12.02.07.56.18 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 02 Dec 2026 07:56:19 -0800 (PST) Content-Type: text/plain; charset=UTF-8 Date: Wed, 02 Dec 2026 15:56:18 +0000 Message-Id: Cc: "Andrii Nakryiko" , "Daniel Borkmann" , "Eduard Zingerman" , "Emil Tsalapatis" , "Ihor Solodrai" , , , "Tejun Heo" Subject: Re: [PATCH bpf-next v1 00/73] Cancellations From: "Alexei Starovoitov" To: "Kumar Kartikeya Dwivedi" , In-Reply-To: References: 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 Mon, Nov 30, 2026 at 08:38 PM Kumar Kartikeya Dwivedi wrote: > In this series, we take the approach of treating all of the instances > above as points where a program will halt execution or abort, and treat > them using a unified cancellations mechanism. Applied 1-58, 60 and 69-73. Thanks. > A program with landing pads of its own still gets to clean up. A pad that > can only clean up and continue unwinding, such as a C++ destructor or > Rust drop glue, runs when its frame is cancelled, and generated code then > releases what the frame still holds. A pad that can catch is skipped, and > a generated pad runs in its place. I suggested it, but decided to drop it. It takes 2300 lines to run Rust pads on a cancellation and the way it's implemented a cleanup pad is verified a second time, and Rust progs pay for it: rust-bpf w/o with 59, 61-68 ----------------------------- ------- --------------- cosmos_enqueue, _select_cpu load rejected, E2BIG qmap_dispatch, insns 167K 775K JITed size of tests vs base +3% +12% tests where the stack grows 0 288 of 434 We can reconsider implementation and do a follow up. Two pieces don't need cleanup pads and can be a follow up on their own: 68 without its pads.c hunks, and bpf_hidden_slots_settle() from 62 and 66. Fixes folded into the patches: patch fix ------ ------------------------------------------------------------ 11 check_held_in_leftover() at exit insns only, not at sites 11 rehash the states when a pass goes over live types budget 12 'time - p->timestamp' wraps after preemption, false time-out 15 oops on cg.marks after a failed allocation 22 don't repeat a pass for a late may_goto in the top frame 25 NULL from a subprog overwrites a hidden slot, ref leak 28 no memory for the note of a return, wrong release 30 try the hand-over before the partition 42 bpf_throw() moves to common_btf_ids, all prog types have it 22, 49 tests that cancel a subprog run on x86-64 and arm64 only Processed insns: prog base before fixes applied ---------------------- ---- ------------ ------- rust qmap_dispatch 160K 1387K 167K rust qmap_init 638K 1298K 672K strobemeta, gcc 15 361K 1447K 366K coolbpf trace_recvfrom 575K 923K 515K A few comments are stale now: note_entered() in pads.c, the example of a hidden slot, and when try_more() hands a reference over.