All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alice Ryhl <aliceryhl@google.com>
To: Shivam Kalra <shivamkalra98@gmail.com>
Cc: "Danilo Krummrich" <dakr@kernel.org>,
	"Lorenzo Stoakes" <lorenzo.stoakes@oracle.com>,
	"Vlastimil Babka" <vbabka@suse.cz>,
	"Liam R. Howlett" <Liam.Howlett@oracle.com>,
	"Uladzislau Rezki" <urezki@gmail.com>,
	"Miguel Ojeda" <ojeda@kernel.org>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Gary Guo" <gary@garyguo.net>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	"Benno Lossin" <lossin@kernel.org>,
	"Andreas Hindborg" <a.hindborg@kernel.org>,
	"Trevor Gross" <tmgross@umich.edu>,
	"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
	"Arve Hjønnevåg" <arve@android.com>,
	"Todd Kjos" <tkjos@android.com>,
	"Christian Brauner" <brauner@kernel.org>,
	"Carlos Llamas" <cmllamas@google.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 0/4] rust: alloc: add Vec shrinking methods
Date: Tue, 10 Feb 2026 13:57:03 +0000	[thread overview]
Message-ID: <aYs5L1aG5S34teKT@google.com> (raw)
In-Reply-To: <0d336a3f-f317-4a70-942a-d87a3faa3a89@gmail.com>

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@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.

  reply	other threads:[~2026-02-10 13:57 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-07 11:32 [PATCH v3 0/4] rust: alloc: add Vec shrinking methods Shivam Kalra
2026-02-07 11:32 ` Shivam Kalra via B4 Relay
2026-02-07 11:32 ` [PATCH v3 1/4] rust: alloc: introduce Shrinkable trait Shivam Kalra
2026-02-07 11:32   ` Shivam Kalra via B4 Relay
2026-02-07 11:32 ` [PATCH v3 2/4] rust: kvec: implement shrink_to and shrink_to_fit for Vec Shivam Kalra
2026-02-07 11:32   ` Shivam Kalra via B4 Relay
2026-02-07 17:23   ` Danilo Krummrich
2026-02-08 16:11     ` Shivam Kalra
2026-02-07 11:32 ` [PATCH v3 3/4] rust: alloc: add KUnit tests for Vec shrink operations Shivam Kalra
2026-02-07 11:32   ` Shivam Kalra via B4 Relay
2026-02-07 11:32 ` [PATCH v3 4/4] rust: binder: shrink all_procs when deregistering processes Shivam Kalra
2026-02-07 11:32   ` Shivam Kalra via B4 Relay
2026-02-09 13:54   ` Alice Ryhl
2026-02-10 11:47     ` Shivam Kalra
2026-02-10 13:38 ` [PATCH v3 0/4] rust: alloc: add Vec shrinking methods Shivam Kalra
2026-02-10 13:57   ` Alice Ryhl [this message]
2026-02-10 15:05     ` Danilo Krummrich
2026-02-10 17:42       ` Shivam Kalra
2026-02-10 20:05       ` Alice Ryhl
2026-02-10 20:43         ` Danilo Krummrich
2026-02-10 20:53           ` Danilo Krummrich
2026-02-10 20:56             ` Danilo Krummrich
2026-02-10 20:58             ` Alice Ryhl
2026-02-10 21:11               ` Danilo Krummrich
2026-02-11  1:08                 ` Shivam Kalra
2026-02-11  6:51                   ` Alice Ryhl
2026-02-11  8:41                     ` Shivam Kalra
2026-02-11  8:57                       ` Danilo Krummrich
2026-02-11  9:35                         ` Shivam Kalra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aYs5L1aG5S34teKT@google.com \
    --to=aliceryhl@google.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=a.hindborg@kernel.org \
    --cc=arve@android.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=brauner@kernel.org \
    --cc=cmllamas@google.com \
    --cc=dakr@kernel.org \
    --cc=gary@garyguo.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=lossin@kernel.org \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=shivamkalra98@gmail.com \
    --cc=tkjos@android.com \
    --cc=tmgross@umich.edu \
    --cc=urezki@gmail.com \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.