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 21CA92C159A for ; Mon, 30 Mar 2026 08:05:46 +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=1774857948; cv=none; b=aTAgi/hFYj6gAmdOLkgMcG45JXRt4d7BL+GHoLspBUdydMEAuRHAczpKGfj81oC8wlMMJLZIJiDMgUXV40n8y2Anfecy+AlJQesyrHKJjum+J5phkx7DhCEKwax8blc6/OiluTcRK/kkCC+fIN7TmwmpTpZVcdyP5KouvjQmgjY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774857948; c=relaxed/simple; bh=w7GsG/Ewei9bKH5PXCU7e7YEcWKd0TNegJxCP4ezxDc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=W64iXjlvZsvqOSIZg+i0hKJZMADqwFoR7xol0ypdBrl+NxwtIq2euyL+pf6hIHEjAfI9d2PJI4sDXVnM3tmuo5KOZapIogOKDZNeuiu7/MlV6yzgYyzmSHwp8UrTt3DFGVgI9lA5eepVQBETCzv1ieU9hgdf/w698dENx8TYWxk= 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=qMFT4ihI; 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="qMFT4ihI" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-486fa35b005so52003385e9.2 for ; Mon, 30 Mar 2026 01:05:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1774857945; x=1775462745; 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=SxrbijMaKAuewdVUb4A1KCDJ8qmmr9UD/wuwFSQmNlU=; b=qMFT4ihIzbgsuZvov1SZSyg2QCkqvkq5inx9LxDzBd+LQ/0QGM2n1K+0f+cEH/1YvL cZNEiNr8VDZLDom3TQvNEfJKVocq094R7OkW0xOC3mwbkaB35RaYdp/f3Vp0uWcNdyF+ rCsqGcrDuJiEBg4HtuBM6k9yVO/fKlNFFv/8NTHWkfeSCBf8gWC4nRIMW5hwCRW8VEQP VomWzqs/a0Aq+hK+4seO+iE+MOaKajzD4s0BiCbMTn+E9gkTHPgmWHcCIvoSBmuTHCNa qBBnOYZv+d6XZxmqJqh8KD5zHMuoznC3iYt4dvIa3fA+stc++eJjMITovU3AV86e+Nqv YrAA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774857945; x=1775462745; 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=SxrbijMaKAuewdVUb4A1KCDJ8qmmr9UD/wuwFSQmNlU=; b=rGD9l31nMGnMpfXohoMv+1sxjV+HNxGQvTetwJXqfwx0KVWoxxtZ1yRiU9VsJZrPzG xEgYS2NrQUVB1YcxzHgjK61Ld+T89ZmPwCDveGJdY3rBoOWnz6N0svCY1lyDOuoAv9Sp q/i5WYUSIoRkKTUrYSX/9J/gffUWne7plN2zf+VZelsKBJ0WI5jlaKbr65lhS1fwxO/W Q1lgwAx1/WXnBigo1Bk7TQGSlRqONnR54Abo8AmRN66buMJVFk2P4cNxtKkLbjJofqrK w3lhx7qV0v3CYAp+DUYa58WpDCp92O2ygpe2Gf6YX2LD56hgY3nE7sXggPNvoQ8+iiTZ 0RHg== X-Forwarded-Encrypted: i=1; AJvYcCWuyfii51up08KuqWqJTG5YrwcYYY8s+vDwuC8I6ydcngOa5M1qC4iQuvMlyKUSNJCoQWir8B0aGDYFrJE=@vger.kernel.org X-Gm-Message-State: AOJu0Yz1bpnnTcEJTIb328NPXLa4Ex2i2iiMYmfMBz4bA8CXsKd4OUMw Ya1beV1aPrP8j9SzEiYfdKJ6h0hdER2QIDts8OgQDVx4OVjT1Si9rq+twM5YnQ0rdovXkzLVIOG AD6Hgh8W2CjBfENmdcA== X-Received: from wmby6.prod.google.com ([2002:a05:600c:c046:b0:485:3a2f:2f7e]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:810b:b0:487:219e:41c with SMTP id 5b1f17b1804b1-48727f36da5mr169791385e9.28.1774857945322; Mon, 30 Mar 2026 01:05:45 -0700 (PDT) Date: Mon, 30 Mar 2026 08:05:44 +0000 In-Reply-To: <20260327113758.75f04588310a707b4d4b1aac@linux-foundation.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260327-vmalloc-shrink-v8-0-cc6b57059ed7@zohomail.in> <20260327113758.75f04588310a707b4d4b1aac@linux-foundation.org> Message-ID: Subject: Re: [PATCH v8 0/6] mm/vmalloc: free unused pages on vrealloc() shrink From: Alice Ryhl To: Andrew Morton Cc: shivamkalra98@zohomail.in, Shivam Kalra via B4 Relay , Uladzislau Rezki , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Danilo Krummrich Content-Type: text/plain; charset="utf-8" On Fri, Mar 27, 2026 at 11:37:58AM -0700, Andrew Morton wrote: > On Fri, 27 Mar 2026 15:18:36 +0530 Shivam Kalra via B4 Relay wrote: > > > This series implements the TODO in vrealloc() to unmap and free unused > > pages when shrinking across a page boundary. > > Thanks. I'd prefer to defer this until the next -rc cycle > (https://lkml.kernel.org/r/20260323202941.08ddf2b0411501cae801ab4c@linux-foundation.org). > If Ulad would prefer that we push ahead then OK. That's fine. No rush from my side. > Are we able to describe how much memory this change might save under > various scenarios? If the savings are impressively large then that > would get attention. The primary purpose of this is to ensure that this scenario is not possible: * There is a global list in the Binder driver. It's an array allocated using kvmalloc and resized on demand using kvrealloc. * A process decides to add a bajillion elements to that global list. * The process exits, taking its entries with it. * The global list now remains extremely large for no good reason. I don't know if it would save a significant amount of memory for well-behaved programs. Alice