From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f179.google.com (mail-pl1-f179.google.com [209.85.214.179]) (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 4D927388386 for ; Sun, 14 Jun 2026 14:10:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781446258; cv=none; b=YKn030q7n/7BMtGlPLbq0sRqpJi28jwWgBXe1dEyjwbUCqs7bN14ZceDPWqWcDexHepBPSD30W89yGYb8QES9syoukyw7GroKt23I8qH97YJbasZVdoPwd55Q6XeQ4ZdH9eqHZ7rJ59WNWFMhnEduUOiGU7XRjI75HVfeTuK/z0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1781446258; c=relaxed/simple; bh=DEQ1ozKAOlubTdqHXSC2p+fAsGAwjH75bNOq1F4U8do=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=SucDDCGOsAkZ/AzK/zBgl6WdfLNlcPDjDefiws5MywGxHh8mZO9/67neWZHUFOqgLLj/8l+Asgq8ovGrjxgS/9WGCok/PnB7JthwjiC+XoM01Qr1aS9EgaqoP/VkgvASK9kvdmY7QS776wjtAt8EEkaHMheWn9AqjJ3eW01DV4s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=dqxlW3eo; arc=none smtp.client-ip=209.85.214.179 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=google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="dqxlW3eo" Received: by mail-pl1-f179.google.com with SMTP id d9443c01a7336-2c0b1a48855so98945ad.0 for ; Sun, 14 Jun 2026 07:10:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20251104; t=1781446257; x=1782051057; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=yHF10+gcCY+52/p+MI0EpREqdUQuaXVQZcqVUlKnjNk=; b=dqxlW3eoVzBm2yQ2PN41SutQoF7Nk/JoJ2hBzJL6WU911XAZLVcC7W07Va5O2MO676 kyYvPzp/ZQqg4rNxbCLsKM/6G5rvi4DJVv4wvqF2iayZHw99yf9eAbGxnQQik9zffLni gXp92qxUCCsCwHRxs6gCCFmPUJc9n8o5tELl13sjZ3F5t8ympWciyuUZ1MtB6h3Ttedt ZUuNLZUGyI+MmMzMR8hnOs8HTRCfi5ZTIqblWmQQ337/9h5uirjXT/qzZCmc4HTuOuZe ZFFIyfoeeSEaUSuMuJW4x7YYivrNbNRwHMQpEscNlj1QmuCObKVHWnZ7yVQU3BO+6DKo UY/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781446257; x=1782051057; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yHF10+gcCY+52/p+MI0EpREqdUQuaXVQZcqVUlKnjNk=; b=gv0mlEovtzk7uLNW96LpvcRXynma0VwB0wjHOOLdP6cuVZBJavI+Jk+NeQFyrd32dQ ybN8PLWpia6qvqQjo5s+TFtl9oc8/tx7h7WIlnMow5D7017doV/yswrU0IB6zgyKYNXb CBPDPbh4eQpz892emh6KWt3XPLIGsKkudpGxmewmP4pQHKKxzuenCDIWZoA/Ic0mt88V tF22oJG8AwXFHUqO944ubca+eyh471XI3l8lvtqk6jmpia806e1PZlmUUuMa1XhRxO8a dStW0diLsyh6YiFLh1WhOw1XC9XqpK2g+GumVns8iSonpR+TQAnJnBF8PyCAv4ssoWG8 h41g== X-Forwarded-Encrypted: i=1; AFNElJ8YFr/SsAE//KT8ey8Q/xBgAmCybTIzkaXhzEjEFKgN4du2t1vTkLlvnmYnc7P0KCmj3OaWLzmuPcEZvng=@vger.kernel.org X-Gm-Message-State: AOJu0Yw4JbN5n3GIKOkWSvNOv3ojg3s8I2fEM2AuXDQ6N0yLQM59Ylsf y2QR+ReYgjvlI8oECIBq5D1O0AWcKH38ThVrmsm8OEzsgY6DDiis0whhgUuI0UUUrQ== X-Gm-Gg: Acq92OFhW5x9d/itOyJfDRCRfieR5+RHUfNNDTo60COy4jO9MECNd5XY4zsem7aDOSj sqk0Dx7iZ4Ig21QjaikyIojuQtmxRNwaPxgB9K0u92b562lG6qh+0jV3dERTUZPixOtvbbixXpD SMXybTjprtSTY/0jVi3QbnTA/qRAPqPbPUzoiZ0gV/bHOGGC8FQhpN/zXMBCToiO+pIaVlVk7h7 OKgF8pNVXS5tWHCl0KrfBbAQOtADXnhIcqkgEscEC26kXLBgRMGpFy4KOp0Jtr53lZbEbfgUq/d gvi6ITMWPWqgy2tmaqkbVNp9Re48zocdS2B4u+3PVXL+0sj3vz3jpd7PXrX5o16fWsMaxYG5Buy yKHrKa/sUnMHakHdVmWLJ5m14rxqSIJ/w709lKIe2V4y9CRbOjMO6HYZqyTkhLvOkKcDTGX+ewu +0feq05aLjAYCjucnIA+BvSpVeS/tHceGYSFNruzeEIQl7swVr4lbzlSmP7BRt2jRrCsaq5IXQM 2dC9HT3SUAoAq5DGkgF/x8i179VUGB3g7FuzCysuBgV1Q== X-Received: by 2002:a17:903:2d0:b0:2c1:ee6e:be1d with SMTP id d9443c01a7336-2c665ec6cc3mr1663605ad.27.1781446256310; Sun, 14 Jun 2026 07:10:56 -0700 (PDT) Received: from google.com (112.174.16.34.bc.googleusercontent.com. [34.16.174.112]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-37a233f4531sm7699437a91.2.2026.06.14.07.10.54 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 14 Jun 2026 07:10:55 -0700 (PDT) Date: Sun, 14 Jun 2026 14:10:50 +0000 From: Carlos Llamas To: Alice Ryhl Cc: Dave Hansen , Suren Baghdasaryan , "Vlastimil Babka (SUSE)" , Dave Hansen , linux-kernel@vger.kernel.org, Andrew Morton , Arve =?iso-8859-1?B?SGr4bm5lduVn?= , 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 Subject: Re: [PATCH v2 2/5] binder: Make shrinker rely solely on per-VMA lock Message-ID: References: <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> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Jun 12, 2026 at 07:50:16PM +0000, Alice Ryhl wrote: > 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. Right! This is the same suggestion I sent. ... Also, I would _prefer_ if the commit message was more accurate. The mmap_lock fallback was there because of "compatibility", as per-vma locking is technically behind CONFIG_PER_VMA_LOCK. This would be the only part that IMO describes the actual reason for the change: > Now that per-VMA locks are universally available, lock_vma_under_rcu() > will not persistently fail. Rely on it alone and simplify the code. Cheers, -- Carlos Llamas