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 634353438B4 for ; Fri, 12 Jun 2026 19:50:19 +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=1781293820; cv=none; b=jjx4S4wh5AObzhgHvVT4sN8IYbb79sUQX1HJ2leZ5etMQ8q/w64g7N16WBdULCN61uo2OhcyJdKJwz1e95mdTBACR2qE7C4M6PgIRd1PVcLX0lJK656P4rgQANn/aa8QJKOoUfXAyWuF8OjNo3MxlRIWi/YZVhHoCzcuXHZaAwM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781293820; c=relaxed/simple; bh=gX5y+wqAP96q+Fv7j8iUel+Mkqn2h3ystDL7w/XRTwM=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=LRuicLa4Fk86k5Dme5lTX3deg1NsQWQqNFWVkR1wbTmNo3jvUypkiXgF7NGeozPdClsW/N2AfvwMnlBqxkxs25gMFsFOItMDGtXhXHVehAfYjLQEQQPcntO1Rc2uI8slgiI2KvsJjMg2sJ0X/FUGLYQsEU7b2FnmsRhvErpWNug= 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=ta3AeayL; 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="ta3AeayL" Received: by mail-wm1-f74.google.com with SMTP id 5b1f17b1804b1-490b37e1f47so9964895e9.0 for ; Fri, 12 Jun 2026 12:50:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781293818; x=1781898618; 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=yJtaeor/RMdRA8pDnzGdMSIMMP892NMMkV6Jr1/bAH8=; b=ta3AeayL5FR/ttBmcZBINLkdp+y//oHpmtd5Vwgi8QJxcE8ZMuFDqluHPvXBygtl3/ mpgx26166EHs3WUyXUReIXBzqQ7f264lV+opppnt/oVcJLZBydgClhfuw6ufphaQIhaG 12uBHY8yhO/40lpPbblPgP1xOCY8jKAX9MxmRVf6eXz+W2hAvyuakysHWrgdB5l5M3xK qKDsafO0UJIECWUvai9iE4quidiNL1PNcENTKyOq1X9VVD5t44+KOyTDdudGyQMKNwol wizsY0LhzRIOvQPUKpeR2611oLsUy2K4cYP7n/9d50m5+puWeMCH+aSPGkd+oLNeNX3y HEmA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781293818; x=1781898618; 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=yJtaeor/RMdRA8pDnzGdMSIMMP892NMMkV6Jr1/bAH8=; b=OUt4vxs/gK6HwFgoDU1d/Vstecho4Gl3iJPEZtH2TgCtpfZY/rT3M07S3anidiJjsT Y9NvmiZ859UnxVnuYEBnKzWu3hvKAipZeBWckrRmdhTUX+ueh69uHqZUgReO6RTEU02k TvJzu5LyERIJA3rsW9q3yv63pH7N3iTr9iADwOs8C/Y+6HsZnDrT6OnGlvCTMx0LDivC 72nH3NY01IQqGtXi/RWIxkumSCH7HNb77XDZOpPIThzWLDnwo9IG39jVzmOE+aroK2YI fEyKLs6UV6ahTif3EyuDVM483Jm1croKuzSOIyBpm9M7gOH/VSjyyBhkPUmbmzPfm9jf nvhg== X-Forwarded-Encrypted: i=1; AFNElJ/vv5Z77pbzA3NRfsRu1QjwNLxF0o7V5USmrvhJ77LlfMvA6N112r7BXvgaas/KvcNISVZsij3Lflpz7GY=@vger.kernel.org X-Gm-Message-State: AOJu0YwDXXtyLTdmaSpTtMU6uM5SgrRC8CSw6RXVk8v6RAYWIyEC0ti/ SssQ0+WU0ttJrcRg7rypu9if13mi4SkpAwtMNIrwZ3GZcv+YHXa3Z0/YuIQPaquC91cFjBH73Fn LG3L/wSmO0uXMx0i+Xg== X-Received: from wmsk6-n2.prod.google.com ([2002:a05:600d:8486:20b0:490:3fd8:77de]) (user=aliceryhl job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:1790:b0:48a:8b02:ae91 with SMTP id 5b1f17b1804b1-49220092ec4mr6888375e9.11.1781293817496; Fri, 12 Jun 2026 12:50:17 -0700 (PDT) Date: Fri, 12 Jun 2026 19:50:16 +0000 In-Reply-To: <2da031dd-4442-45b7-9515-72ffc60e8d8c@intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260610230409.A44D29FA@davehans-spike.ostc.intel.com> <20260610230413.D68967BC@davehans-spike.ostc.intel.com> <131c6a49-9177-418b-a653-8f13942fb8d3@kernel.org> <876077cc-db6a-4517-9d81-cdfbb43e599e@intel.com> <2da031dd-4442-45b7-9515-72ffc60e8d8c@intel.com> Message-ID: Subject: Re: [PATCH v2 2/5] binder: Make shrinker rely solely on per-VMA lock From: Alice Ryhl To: Dave Hansen Cc: Suren Baghdasaryan , "Vlastimil Babka (SUSE)" , Dave Hansen , linux-kernel@vger.kernel.org, Andrew Morton , "Arve =?utf-8?B?SGrDuG5uZXbDpWc=?=" , Carlos Llamas , Christian Brauner , David Ahern , "David S. Miller" , Greg Kroah-Hartman , "Liam R. Howlett" , linux-mm@kvack.org, Lorenzo Stoakes , netdev@vger.kernel.org, Shakeel Butt , Todd Kjos Content-Type: text/plain; charset="utf-8" On Fri, Jun 12, 2026 at 11:47:59AM -0700, Dave Hansen wrote: > On 6/12/26 10:44, Suren Baghdasaryan wrote: > >> It's not impossible, but I do think it is irrelevant. Or at least that > >> the *VMA* is irrelevant in this case. binder_alloc_is_mapped()==false > >> means that the binder VMA is gone. It's not in the maple tree, and it's > >> not coming back. If a VMA is found, it's an impostor. > > Right, but before your change we were bailing out early. With your > > change we would be generating the traces and freeing the page. I think > > that's a functional change. Was that your intention? > > Yeah, it was intentional. > > I think the existing behavior is buggy. It also complicates the goal of > removing the mmap lock fallback. I've broken that behavior change out > into a separate patch. (attached here) I think you can just: 1. do a lock_vma_under_rcu(). 2. if it fails, check binder_alloc_is_mapped(). 3. if still mapped, return LRU_SKIP, otherwise behave like a failed vma_lookup() does today under the mmap read lock. Or you can even skip steps 2 and 3 and treat failed lock_vma_under_rcu() as LRU_SKIP because processes that unmap their Binder vma without immediately closing the fd (freeing all the pages) does not really exist in practice. Alice