Received: by 2002:ab2:7407:0:b0:1f4:b336:87c4 with SMTP id e7csp161548lqn; Thu, 11 Apr 2024 18:21:32 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXEnKE0ekLdtdGrjsnKj5OBbj1YMq4Ka4gNHpy3dWsL1GADrE3ssKnYON1si95D/x32baGdvzVF8vkCKZL7GYeKUqgts2wsA95jK99oZw== X-Google-Smtp-Source: AGHT+IGnG6MmouhlEv9cySVI79dp/WbOSJlO5o+lWVVr2sA5lhKhzV9wiPNxEqdrja8LThZ4qYqn X-Received: by 2002:a05:6808:2b0e:b0:3c3:d80c:ee5f with SMTP id fe14-20020a0568082b0e00b003c3d80cee5fmr1045365oib.51.1712884892605; Thu, 11 Apr 2024 18:21:32 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712884892; cv=pass; d=google.com; s=arc-20160816; b=yiOMhtTlpyNbPGRmSFXKZCRcGaIZRaNVmjebZItA4w/+pMyHbnNYjLudW6LRWMjL2K sR/yjrYUuGtcPNXEdDjPU6/RBzBH/YKf0VYY0v3p/X2/FjnoH4PtzdtfKWDwdleW5XoB Pllzt4DckzMmx8yFY9JUpLbnlvZMyijQg7iBQpIJEihrMsQu0wVFFySeK6W/vJuoUYA8 qT19GZDLCxhEqNzMXQJAoR5wCjebCA/NiVw2xEiBtoYIe6WY42T7yWUq1N4hyWvKOu1l UI5AL8ah5niDRwm9z8tQTQAdzoFTepuaAtg2Msp2fhke3DNKGyjT5Mm/cp429UbtP1Ru QW5g== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=1tQ0lOIHbz5US+vfPM6E5TPrSdCoeYL4E06YeAvQ17s=; fh=8Qvc20vK4OOvnsQL2+jKNc3cv4woB11QyyRijNFjVdM=; b=Ni0IAgfi+jyhNTMDsy3mI0/Gy/cQ6ZGlOQ2W4Txi3yMnUOlq+LDSFvnxPIjUJm7WA4 dBJN4rwyVEUm83Rg2ZCvQejd+c7UrDjeFFK6es4uTf0HHDdahmzUSWIoyu7801wHQ5Kp aLONtwy8qvwvgPnihZb5iTaBtnCyuvNDP0O3Wqy1VVIjhRPbQfRZtjroQ0ATFZOvNckr mGnO1o1nDF2ventXDS7gzA+kGIMGm9HXK9jBOrmyBwMBPYUvEBCMjhA4eYLafxCP+nke mr32cuqen8qE5ao+G4V4lSUeeSiLX/d2Z62FnAO4X4xSsATmnolIQOfiQKegzFxtF1F6 +GvA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=D5sgudyB; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-141629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141629-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id c7-20020a654207000000b005f3e0538ba5si2246103pgq.606.2024.04.11.18.21.32 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 18:21:32 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=D5sgudyB; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-141629-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141629-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id EBE24B23DA4 for ; Thu, 11 Apr 2024 21:28:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 09B0D3716F; Thu, 11 Apr 2024 21:28:03 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="D5sgudyB" Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 0CB8D199AD for ; Thu, 11 Apr 2024 21:27:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=90.155.50.34 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712870881; cv=none; b=HqWSXTIOUQE49qCpJwgF3hxFLNJASsNSp+DVR5If2Nk2eVPeftD7FQuGou8cMaZvTy7GlYDa88Fv/hRECJWPphF4VBbif2+jDM7khuNko6Fa3jz+xT1ajhGk7OQWVs8JT/FTaIMBcX+pfolZZ3LMaBkKVctVxxO8B6LCkAYeD9A= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712870881; c=relaxed/simple; bh=Sa6qmjDsyUuvpBXhaxanG2UFhluRlyv65wd9j2Xu9wM=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=nTerPmanK3CMjt/r7R7w7EuFdlzRPDiBKcMqK5kWInmIVjHECl+6eIOB9jMb71ThJ88nkmoX3n4RfbrNLzLJtk2eHebQobUS65qsBgn+pKeEvg0dsW/sirWyNCrQ820ZIac0CzqdVcNcduubMr2++9IIoXTKYIiDglrcNR6AM2Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org; spf=none smtp.mailfrom=infradead.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b=D5sgudyB; arc=none smtp.client-ip=90.155.50.34 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: smtp.subspace.kernel.org; spf=none smtp.mailfrom=infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=1tQ0lOIHbz5US+vfPM6E5TPrSdCoeYL4E06YeAvQ17s=; b=D5sgudyBnVEWp5Tvvr6jUtqqI1 azQxRvV2ZzrQI4RjhaYwh8Amq3V/fcKd5eO55nAHPF30t972JaZpQp1HbEy99n0Usf2x7b9S9H6Le D4noTgL2drl3XfPVAho/3QKYQuzK8KUwKkzsZ5NkdFV3xgiEYmN0UAdd+h30keRLYngYG58LKLwqg GxoRaL4nAkviVNqqYNYtIW2ZPOx7FiZwJrT5x8rkrYwKTkkzc+6hdTI+tD3GLh4lTI9aaV5kkjrv6 XKqXREhQFcWmvDpMtwZIUohklBq4brkLR040e6S4OY5QGM7NPqwlMZGH2E/X7z4xgpatpBzHFpVbu +EPajBPg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rv1xc-00000007lZf-0YzY; Thu, 11 Apr 2024 21:27:56 +0000 Date: Thu, 11 Apr 2024 22:27:56 +0100 From: Matthew Wilcox To: Peter Xu Cc: "Liam R. Howlett" , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton , Suren Baghdasaryan , Lokesh Gidra , Alistair Popple Subject: Re: [PATCH] mm: Always sanity check anon_vma first for per-vma locks Message-ID: References: <20240410170621.2011171-1-peterx@redhat.com> <20240411171319.almhz23xulg4f7op@revolver> 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 Thu, Apr 11, 2024 at 05:12:02PM -0400, Peter Xu wrote: > The question is whether that's intended to make it as complicated. For > example, why don't we check anon_vma for anonymous too later when prepare > anon_vma, however we do it late for file memory. AFAICT there's nothing > special with file memory in this case. Yes, it's absolutely intended. If anything, anon memory is the special case that checks up-front. Congratulations on adding additional instructions to the common case. I don't understand why you persist with your nonsense. Please stop.