Received: by 2002:a05:7412:cfc7:b0:fc:a2b0:25d7 with SMTP id by7csp2130943rdb; Tue, 20 Feb 2024 19:37:15 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUqPq2tCmdGEd416nw1+oJ0I6keCU87Mj7O1NVr0xBTQjUEobOJbDbFPCDLsymVFJtXm8c/2f4HRaRYdws0XH1hxfKkJNsNlV8lcsegpQ== X-Google-Smtp-Source: AGHT+IGbVBSYcdPY9IjcJx1YoMDg209OnLpfLqmnFLFQGavL/4UzrpX/9ooTmQrfvcF+C3yT5dgE X-Received: by 2002:a17:906:fc08:b0:a3e:883e:4049 with SMTP id ov8-20020a170906fc0800b00a3e883e4049mr5413581ejb.68.1708486635164; Tue, 20 Feb 2024 19:37:15 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708486635; cv=pass; d=google.com; s=arc-20160816; b=FneG7pzBOozjdliVSUtPA5OvyDE2WR+HmtJM6s3CRAclSMf7AZMu8qWhkeVeQyJL78 oFTGle9U+KYguFehWMN3DZ9VuY8FVM3Ulsomx7WStMimr+uefjUHJzR0Lbf0KEH976HE hvIfAj9MRl3UWyh52Ks/l0c0HmymminzgFCTHIqLP/ZcC7+vt0KMeEyikXLMngU6o0dV 9G0oReQdgdzxGqVFQ0IQFbSw7DlIbAHzKxkmbhDo+nxC2ewA+AMQoETZlMhyn0zbhefw XBEnlsWg1IFQZyYHHPp8CkvW2kRU2IfWmMdkkmVIY/7+MiJeczQlaLOQosmmNJQAsC2N USYA== 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=Bm8ztZBWaX+I8ZmKrLPgnl2Mm9WYFeNRbyX8E0zkgqk=; fh=7LP8t954uHnDkzu77Iidc1+r0eNDQrtruu0dALQ6seI=; b=OpqoBHky7tgPMFS21CCBpiGIR3jFZeaKzVgRga3kZQs9mudNAheAcTDuVenmOnZpk2 bnoyqRAwOx9/i30kJh6BXXLpgWK/4dCVtXhbnPkAksLwQHrv8k6X6BCY9XeXfUkHFfkN c/s+QlUXa7QfjJooaWH19O6jWN6isp1JawYR/WrZmiy8t6gigcRxhy+vmwpiDDGcY1B+ KWBP2jHN42LhnRGMpOi9VZu/4WWDpYhEW6eo1nDW/V3VThfLez1nMJLHIJiDsNkkW1yT Ry8h0BrdAOCpaOduzyUW7VYGIZy54vAf8WZUVhceC1xRPiASpxLx8IkfSWy9B9NO3gp6 IaXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NTKL0Yc2; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-74003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74003-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id h21-20020a1709063c1500b00a3e93d03446si2346185ejg.665.2024.02.20.19.37.15 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 20 Feb 2024 19:37:15 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-74003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=NTKL0Yc2; arc=pass (i=1 dkim=pass dkdomain=infradead.org); spf=pass (google.com: domain of linux-kernel+bounces-74003-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-74003-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 CA6D31F24FB9 for ; Wed, 21 Feb 2024 03:37:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 76C7D38DFA; Wed, 21 Feb 2024 03:37:07 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="NTKL0Yc2" 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 DBD1139AC5 for ; Wed, 21 Feb 2024 03:36:51 +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=1708486625; cv=none; b=kbb0o/E+ZM0VtviftegeupSQ7WfMXwl6FKssp6BZ0woyemH/qp1z9JxuynVNuctBScAcTQm51P1WrBhp6I7VGcyM4dqKnyQBDsc3cQr+xA2qz0gcW/kVFjWSskO8fpCAZYWC3tFnI/r+D3g3mWGfetPyQPLCBf1DuFiZdGwjBLE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708486625; c=relaxed/simple; bh=vbOYKSOfdfXf+a4GJHe6lHkZOMnmMuhk1Gp/avp8rPg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=T1SP1thFvs2GJBD9dctVlcE1mZcfX/pQu+zDh127RYOjMNmfmdmhy8fzZVjGoHHb5Jl1o8kBcZqqhCTr2Gv3q9iAoe+9oPkJZNukjZvvHbAdXMxolzJRCrhCsbnzuzu23gn2mH7LCDZ+G8EpjiHL6swIVFeRmB9mTqwKDwhHgKA= 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=NTKL0Yc2; 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=Bm8ztZBWaX+I8ZmKrLPgnl2Mm9WYFeNRbyX8E0zkgqk=; b=NTKL0Yc2oC+1BhjF1U7uQGgpLG oWjWcyVPyMdO4ISjl1oM1ToVHQAoDNPUU6EbUdcGE7U1eg4lFPoC/rNVHEU2d4DXJpIxUFerOxjpo wcsm82gKEc0cgv4WjlEoJ/CEcYqhjvjJRahP8ZvTDTyj3Lgwj7UOlqVWVHPYwJc42qdxuH2+DC6H0 iBn1thsA7O8JGOUx6JNUke4/yf0Orzcz+6rEFmK/Bpk64mcs+5Ea0C+yJV9Ik+zx/tf1Uiw8PFNXb rT+c5T0BgaKsCLhMF8eCOB75B4bgu7DggyNl6+NLktIJAXufwCG4WYDmFmjDH9k3EqPipnbtXCPUe cHtwXk+g==; Received: from willy by casper.infradead.org with local (Exim 4.97.1 #2 (Red Hat Linux)) id 1rcdPa-0000000HIb0-2xJF; Wed, 21 Feb 2024 03:36:46 +0000 Date: Wed, 21 Feb 2024 03:36:46 +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 1/3] mm/memory: Change vmf_anon_prepare() to be non-static Message-ID: References: <20240220231424.126600-1-vishal.moola@gmail.com> <20240220231424.126600-2-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: <20240220231424.126600-2-vishal.moola@gmail.com> On Tue, Feb 20, 2024 at 03:14:22PM -0800, Vishal Moola (Oracle) wrote: > In order to handle hugetlb faults under the VMA lock, hugetlb can use > vmf_anon_prepare() to ensure we can safely prepare an anon_vma. Change > it to be a non-static function so it can be used within hugetlb as well. I think the prototype for this should probably live in mm/internal.h? > +++ b/include/linux/hugetlb.h > @@ -272,6 +272,7 @@ void hugetlb_vma_unlock_write(struct vm_area_struct *vma); > int hugetlb_vma_trylock_write(struct vm_area_struct *vma); > void hugetlb_vma_assert_locked(struct vm_area_struct *vma); > void hugetlb_vma_lock_release(struct kref *kref); > +vm_fault_t vmf_anon_prepare(struct vm_fault *vmf); > > int pmd_huge(pmd_t pmd); > int pud_huge(pud_t pud); >