From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f74.google.com (mail-wm1-f74.google.com [209.85.128.74]) (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 0DF62246797 for ; Sun, 18 Jan 2026 09:36:24 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.74 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768728986; cv=none; b=fa/gEboD6xQwU6WWEq5VgBVTvaxfhjlBiUH/xmwLxMvPHkI5mh3DkrRMHd8E6F/X9L/l6j7Tj8KKtmYcvwZztbO4r4va7RmoHLBsvXpRLiOMDiLtEi1wQbLc8p4cyzeGB1MsXuAJcREfL4ppLCLoCxuXwQA4aeRr6maxvsbRHpc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1768728986; c=relaxed/simple; bh=C7CPlKGivPcWmJbKWTQcq9bmy6VGDEUA6Q6+uWkMGWo=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=m6dwmrFR+jhEAuOt0WBE+m2arIBLt6UTWsP7svmCX62V5TKQ3fsZZX+uWpk91eqzQU8EwKkaDokzoua8zoiAlCyCLzaGVVtQFC+81AZNax0UbowjmunxvdhPQRBwJl6sky/G1R9DQU3tzDtJD8WJNFfyqEeYsC3dcB871Dbt888= 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=AfbDMvAr; arc=none smtp.client-ip=209.85.128.74 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="AfbDMvAr" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-47ee33324e8so19835505e9.1 for ; Sun, 18 Jan 2026 01:36:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1768728983; x=1769333783; 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=2crpElwSyZjSC6LxlxSuY/9mqjbdgSHe3K2sax8WY1o=; b=AfbDMvArbsc/ootm21Vji3obEZ1QU1W1TxrbCWPq+tcBedQyRnJTsvrmL+7OgQEP7O NAxvwH2poYTaNx/zXUoPH9JEKe11jD1BnCymy/4XW4pP1H+mSaRHreFVjLml/hHueSfv YY5QIymtECvOGthTk6w0u1BWpflTiaGx3Nxz9gcurZH7lLzkv+8U5uOxXdaJ+b9im2+L Tc/PdynStmjKFAUmI0gCnzJdaz00AjE/YlsX5grBhYNzQ/viHAUQcng01C2sGGVM0Osv HHBOk9L2IK+xwCzf12W5eBZr2x0Zon1C4ZcO1P0IlWpDlrZs4By2YWh9BFNTs8GXptst LOAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1768728983; x=1769333783; 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=2crpElwSyZjSC6LxlxSuY/9mqjbdgSHe3K2sax8WY1o=; b=jfFM+v4DhflskalhVhBuhBE3WRpWnnPHsmfg47tnYmrhsldlEZWtagf8GUwRFfVDJh X2HaVx3ZfA2omXbZ0Q5RHNuvrBVdQ88wFRl8svqpdTWmpv6YDoE6rjZE9DCN4gBvlMiY DCnmPcUcHzKIhyl75xaRppdX/IpdfhmUsunl9fenImbVVUTTURJJF4FGigwtxIFPFjrs zkPLX79pvG7j3xRioS/q1NyvG16mQ+AUEoD9Wsrvf27QAwhtrWdVVum4KhFBkx8elrgU zkfLSRoYd6uBMNt3FwF0PSMQhU2EKponQf/dFan9vy/f6kAWsY5r1vARCcWaw71NV1ce 9sbg== X-Forwarded-Encrypted: i=1; AJvYcCXjBtmWStBi90YAocGi14b72OQNpQNPfbsQySEuF4lRLa9OGePgW1Fap0HHpH89nShJXf/W1+TpTUneN0Y=@vger.kernel.org X-Gm-Message-State: AOJu0YyGYo431fH5FAsE5gBoSou9lD4QOKIP7zupcCOV0xtXSynOxiWV V83Xwj/KDSEVa9q0m77rbgWLLIXjtZ1D+0pZH5Q07pDEE0ed8TO/WfV6IzDwnWCUDysqzNs5MkS fdypAQmOiQkQx7GxAVw== X-Received: from wmqe8.prod.google.com ([2002:a05:600c:4e48:b0:47d:5dae:74f0]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:4f54:b0:46e:761b:e7ff with SMTP id 5b1f17b1804b1-4801e34821cmr85100115e9.28.1768728983396; Sun, 18 Jan 2026 01:36:23 -0800 (PST) Date: Sun, 18 Jan 2026 09:36:22 +0000 In-Reply-To: <20260117162242.950194-1-jason.kei.hall@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260117162242.950194-1-jason.kei.hall@gmail.com> Message-ID: Subject: Re: [PATCH rust-next] rust: binder: refactor context management to use KVVec From: Alice Ryhl To: jkhall81 Cc: Greg Kroah-Hartman , "Arve =?utf-8?B?SGrDuG5uZXbDpWc=?=" , Todd Kjos , Carlos Llamas , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="utf-8" On Sat, Jan 17, 2026 at 09:22:42AM -0700, jkhall81 wrote: > Replace the intrusive linked list management in context.rs with KVVec. > This modernization simplifies the ownership model by using standard > Arc-based tracking and moves away from manual unsafe list removals. > > The refactor improves memory safety by leveraging Rust's contiguous > collection types while maintaining proper error propagation for > allocation failures during process registration. > > Suggested-by: Alice Ryhl > Link: https://github.com/rust-for-linux/linux/issues/1215 > Signed-off-by: jkhall81 The subject says [PATCH rust-next], but this would land through char-misc, not rust-next, as that's where Binder belongs. You can leave out the branch name and just say [PATCH]. Also, I usually use 'rust_binder:' instead of 'rust: binder:' for the commit message. > pub(crate) fn get_all_contexts() -> Result>> { > pub(crate) fn get_all_procs(&self) -> Result>> { These two methods need to use KVVec instead of KVec. Also, I think some of these loops could be replaced with simply Vec::clone(). Alice