Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp166360rdb; Wed, 21 Feb 2024 22:51:30 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCU8ACXSlTxDpOTcY62EWm/3uCt9EOrX9Cx6EPkemETJiZsd+D9GIyeExi/EB3VxY8j9EWUdUPCHEjEq95Hiem4mAOJ7ZQSfuAbA6Yr8Lg== X-Google-Smtp-Source: AGHT+IGwtA/fe2Nx3NE80xj0yZXx92jp3vQD+1Oc7RaN5dEz4qu1EcppjOYZ7Ap9ctye7HGo5GVq X-Received: by 2002:a17:907:76d4:b0:a3e:787d:d3bb with SMTP id kf20-20020a17090776d400b00a3e787dd3bbmr7562625ejc.75.1708584690059; Wed, 21 Feb 2024 22:51:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708584690; cv=pass; d=google.com; s=arc-20160816; b=HZUlbsmAIclSUlfhE9gsWZ12Jm8dd+ZIJJ7r2UgY+x7j+35Mfn8BsfuKmDWQeMV0Qs j0JlEdQV/sV8NsZJN/2xet2PDx4uhRZaOEzYYvsVHqcKk7PoetRP9hEu7+t1G2G1Yy3T VGskri+ViDlacixiaYLuhoi6BIue9kptOaauT1n0z3F3KzewOtTNQtj3piXhx/1y80Hi 06Is6GHIOe62rBo9YN5iVrNcS9rfUzq13Nsq7atQqeQB9YHUMESg5kdH237CNJbwXuaT g+b9bkGCRdlx+Vdzg9G5xN28/wOo2SDHyCYpoDi8z8jwOR2nct3z6n2OGlxk2pHBolSL SKSA== 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=i/7HIyFgwgzD7YbEDR31NVPlVkKUleWuI0Mc79KExFQ=; fh=7LP8t954uHnDkzu77Iidc1+r0eNDQrtruu0dALQ6seI=; b=x/0K7NijLOZZnE6CLg/ttOUfe7lvZaTpIsnmW+15YSrzUXiUUZ6adE7ZCzj/fwdnXe JEdrcE5SjD/6C4K1iwmdayyTZia99+9L/zjtFu+3OqpDOoZYvBHEV0ICT2NEoecv/EcV A4dbSEhDYqweRop+hqIS9mvq65tpLGCanlh6IGMzvdLfU0mUA9PZT4gDv7OtuzpjLfvc HbTAlQpNUtQwe/Ku2mGHPRiuydsHuRAxd5dC8Nk9n8V9zInbFO5QHNblT0d4VFHvJyTt 18kf1mRXnakqL/OXWySCc9hKcuJzw3OnnvG86FGH4qkLkVHqDqJfsEdy/yqdkXSU6Bos 1Olg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=apGU9qyw; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-75877-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75877-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id dr3-20020a170907720300b00a3e6faad133si4266787ejc.686.2024.02.21.22.51.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 22:51:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-75877-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=apGU9qyw; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-75877-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-75877-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 8F97D1F220FC for ; Thu, 22 Feb 2024 03:51:32 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3C87217593; Thu, 22 Feb 2024 03:51:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="apGU9qyw" 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 D0C9E111B2 for ; Thu, 22 Feb 2024 03:51:18 +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=1708573880; cv=none; b=BDXtZOIn83o5FFAdQ/rt+LzjziYtfNl76/G1OP5TadSNsrY/9n5QBu60dtzZBbbeNjNVwDlgZwmoQSHoc03ihFA9sE5TLFB9XUJuKxli/4gzvgilMkZL5Lp+ZiXBZ4O25vpuRtPX/3i5lGTx0gAG7MERBD7INwoHS6Sj43kZhc4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708573880; c=relaxed/simple; bh=U8r0bihuYdw2bLbxoL06ppuLdubJ4RlmL6Hu0e74X6Q=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=GE7N4YFVRoLAEVeWb3KUVJ4kS12OtTB2PhklPf334zvgGRwDE6dbxqNQhYopCu27ccn0q6Pqz6r+Kke6jZsUK2EmhyOQ8Oi470ojRDo1SOo2AH3qJ/BRdYNU8sfpliv57pSsBfaZiWPw4GaRdbORI0M6T5yYIH8Wve3onKYdPjk= 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=apGU9qyw; 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=i/7HIyFgwgzD7YbEDR31NVPlVkKUleWuI0Mc79KExFQ=; b=apGU9qywdin7SKMFel85/KBcxq dYyK6+2aDKa8SI4lIUbdk5vL8F/W3opK2JsUcA5cPvRrB8xCLy+95KzcQ7NTjZqy5bPe3/67Zh4WW hK8CG3AyqzQvw0cMVwsYaBhfM/+OmSqlEbo3MfnyYOGoNuSal00W5s0vE/g/Nq0Z9uLaDPouvqU08 zI+BXEYpwdpSiagmuzFestJBOfYN/E8dzzHW/v4/xvZvome5KYLvknMA2HUfUUh0BerLnJPfgT3Cs rMvsjf5nZRxDaKt1zE1qMmW1WrkE+4d1V/ixzdisgsUSZzQr9RpCs2+8ND7O1qxdRbNZcFXlftSNy z2OQdYSg==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rd07A-00000002VKP-1vyV; Thu, 22 Feb 2024 03:51:16 +0000 Date: Thu, 22 Feb 2024 03:51:16 +0000 From: Matthew Wilcox To: "Vishal Moola (Oracle)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, akpm@linux-foundation.org, muchun.song@linux.dev Subject: Re: [PATCH v2 4/5] hugetlb: Use vmf_anon_prepare() instead of anon_vma_prepare() Message-ID: References: <20240221234732.187629-1-vishal.moola@gmail.com> <20240221234732.187629-5-vishal.moola@gmail.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: <20240221234732.187629-5-vishal.moola@gmail.com> On Wed, Feb 21, 2024 at 03:47:31PM -0800, Vishal Moola (Oracle) wrote: > hugetlb_no_page() and hugetlb_wp() call anon_vma_prepare(). In > preparation for hugetlb to safely handle faults under the VMA lock, > use vmf_anon_prepare() here instead. > > Additionally, passing hugetlb_wp() the vm_fault struct from hugetlb_fault() > works toward cleaning up the hugetlb code and function stack. Reviewed-by: Matthew Wilcox (Oracle) > static vm_fault_t hugetlb_wp(struct mm_struct *mm, struct vm_area_struct *vma, > unsigned long address, pte_t *ptep, unsigned int flags, > - struct folio *pagecache_folio, spinlock_t *ptl) > + struct folio *pagecache_folio, spinlock_t *ptl, > + struct vm_fault *vmf) Is it worth removing vma, address and flags?