From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 29588359FAF for ; Tue, 10 Feb 2026 13:57:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770731827; cv=none; b=QuKMXmofAh/yEMbko4liqx7jolDiM/+3XiQpSpRRYp9V2jbtswIMFI7tA8RQ56j6qidprMYlyyDqG2rzBA25wBzgHIs2S7QwPFw4yIZ7J7qRFz79YlUNxJBw2H7hNQRY+K0LNXCmpYAvZAN1H2hWSm0dv+O40BLZb5zs8ecamLQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770731827; c=relaxed/simple; bh=a9e+Q5siCUQ5I3SJEbQxJsb6hBQNhiRiGIUmMSZXi/M=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=aJZYMwautSBdTbTIRVmVW4eKligXM8y6BjAtICgoCeP4mcheYZBJ4fhQ/ijxhC/1d2kkIZY4vow3Mn486rviWFTx3WaWUIxtCfP2j54PO3l+i28kWvA42mPnkyGAd+HMQ5Mb0s3xxiOJmn9lDVNt1GR4dQdRB1jezcnNUkuShD4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=3OYh3Pk2; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--aliceryhl.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="3OYh3Pk2" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4804157a3c9so34971605e9.1 for ; Tue, 10 Feb 2026 05:57:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770731824; x=1771336624; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=gf6cU9pv35ebpRCAES+qVGn52WnA5+sst08T+N7iQAg=; b=3OYh3Pk2xMu2Q0hUdKc1aC8nniQPmHB4DajG6H14Imp1aYF02bvTdjMWAB95UYZ7YF MAAUw95eX+ujtdwbnYDkjKxXTfizWwRQ8RsEoNR4jHLrfE1KIURjTagC34N3AL+aJ5QF 4AP5XCDV2wQcFukNTFgwFSmtD8HkxZY5j5J3X3rKwKd6sPyQaJMl7lfa1g7HRPfbTXkV 7rYv3urG9qpwL2TvN2KUNGduP8jc0SX34fi9U/vDhid9AmJBvw8WnhBIqqoc2bXm2kx+ eAvKB6IllG2QMRxPExADX6jfVQv7K/61+lJprjAqF1jNP+18646lHbkTaGBbmcYx9oU0 ibnA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770731824; x=1771336624; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=gf6cU9pv35ebpRCAES+qVGn52WnA5+sst08T+N7iQAg=; b=UGzrGAdf5xcYw5iYnMb4eZ9FZ/hF0zBetz8uEzfQxtKvnwcWA5I03xhYcUEIi88B9w JhSono5aisndsQgCeWBwnf5K4ytq23v23BH66J2aLhewdjiu6MREgVjEjmU5KMiNUqQu 90NWIUvMweg5jQCtyhJtqQwwZHXS6IldhBUpPGDyFTbFvoH5oqbeek7UhXvF8LkxdOTF Jd6w1uNXpYcMPYyZjq1rpPUTLb8CZP9iEXQtskIhO8OWTrZ1kzbO3qoLgdTlfV0rqw2o 7A9McjHbyyOzWlWEapZhAT5I43UJcRF6JxbKn9KeTrg6T3cRg2D67H627Z/fsSMA5eKT d+Ow== X-Forwarded-Encrypted: i=1; AJvYcCWqfqZbLjqqREgg3pYAn37azRkAUptQjUAdyXHg+iMCaWMs5RH67E4BwbXTQ6O9kmwKSG55HhtLfbsCXLA=@vger.kernel.org X-Gm-Message-State: AOJu0YyPjUK8qnkLa53bzoolD+c9OvG0lofcoz91fvvzk26XF77pwJIW KA3IIaMtkd47qFp3uQAM9yP7LvgM6fY1r+1NKZbdtuyvqVfGzu/HQ3Z0S+QMubcHEa9TtKwc0Tw PDuRLuH8+bpG7q0o7gA== X-Received: from wmon23.prod.google.com ([2002:a05:600c:4657:b0:47e:df88:7cfe]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:8489:b0:47a:9560:5944 with SMTP id 5b1f17b1804b1-48320229bbfmr230670705e9.34.1770731824562; Tue, 10 Feb 2026 05:57:04 -0800 (PST) Date: Tue, 10 Feb 2026 13:57:03 +0000 In-Reply-To: <0d336a3f-f317-4a70-942a-d87a3faa3a89@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260207-binder-shrink-vec-v3-v3-0-8ff388563427@cock.li> <0d336a3f-f317-4a70-942a-d87a3faa3a89@gmail.com> Message-ID: Subject: Re: [PATCH v3 0/4] rust: alloc: add Vec shrinking methods From: Alice Ryhl To: Shivam Kalra Cc: Danilo Krummrich , Lorenzo Stoakes , Vlastimil Babka , "Liam R. Howlett" , Uladzislau Rezki , Miguel Ojeda , Boqun Feng , Gary Guo , "=?utf-8?B?QmrDtnJu?= Roy Baron" , Benno Lossin , Andreas Hindborg , Trevor Gross , Greg Kroah-Hartman , "Arve =?utf-8?B?SGrDuG5uZXbDpWc=?=" , Todd Kjos , Christian Brauner , Carlos Llamas , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Tue, Feb 10, 2026 at 07:08:09PM +0530, Shivam Kalra wrote: > This is a follow-up to my v3 series: > https://lore.kernel.org/rust-for-linux/20260207-binder-shrink-vec-v3-v3-0-8ff388563427@cock.li/ > > Hi all, > > Thanks for the feedback on v3. Before I respin, I want to confirm > the direction for v4 to avoid unnecessary iterations. > > Proposed changes for v4: > > 1. Drop the Shrinkable trait entirely. Make shrink_to() a normal > method on Vec that calls A::realloc(). (Danilo) > > 2. Add a temporary ShrinkQuirk trait to handle the vmalloc workaround > (page-boundary check + manual alloc+copy+free) until vrealloc > gains in-place shrinking support. (Danilo) I don't think you want any new traits at all. What types would even implement the trait? The special code can go in the realloc() method of Vmalloc struct in rust/kernel/alloc/allocator.rs. > 3. In the binder patch, use a less aggressive shrink strategy to > avoid shrink-then-regrow oscillation: (Alice) > if len < cap / 4 { > shrink_to(cap / 2); > } > > 4. Fix commit prefix to rust_binder: instead of rust: binder:. (Alice) > > Also noting that starting from v4, I will be sending patches from > a new email address: shivamkalra98@gmail.com > > Does this look right? Any other concerns before I send v4? > > Thanks, > Shivam > > Note: I previously sent patches as shivamklr@cock.li. That account > has run out of quota, so I'm continuing from shivamkalra98@gmail.com > going forward. All future patches (v4+) will come from this address.