[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aYs5L1aG5S34teKT@google.com>
Date: Tue, 10 Feb 2026 13:57:03 +0000
From: Alice Ryhl <aliceryhl@...gle.com>
To: Shivam Kalra <shivamkalra98@...il.com>
Cc: Danilo Krummrich <dakr@...nel.org>, Lorenzo Stoakes <lorenzo.stoakes@...cle.com>,
Vlastimil Babka <vbabka@...e.cz>, "Liam R. Howlett" <Liam.Howlett@...cle.com>,
Uladzislau Rezki <urezki@...il.com>, Miguel Ojeda <ojeda@...nel.org>, Boqun Feng <boqun.feng@...il.com>,
Gary Guo <gary@...yguo.net>,
"Björn Roy Baron" <bjorn3_gh@...tonmail.com>, Benno Lossin <lossin@...nel.org>,
Andreas Hindborg <a.hindborg@...nel.org>, Trevor Gross <tmgross@...ch.edu>,
Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
"Arve Hjønnevåg" <arve@...roid.com>, Todd Kjos <tkjos@...roid.com>,
Christian Brauner <brauner@...nel.org>, Carlos Llamas <cmllamas@...gle.com>, rust-for-linux@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 0/4] rust: alloc: add Vec shrinking methods
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<T, A> 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@...il.com
>
> Does this look right? Any other concerns before I send v4?
>
> Thanks,
> Shivam
>
> Note: I previously sent patches as shivamklr@...k.li. That account
> has run out of quota, so I'm continuing from shivamkalra98@...il.com
> going forward. All future patches (v4+) will come from this address.
Powered by blists - more mailing lists