From patchwork Wed Feb 21 23:47:28 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13566618 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 86C9EC48BEB for ; Wed, 21 Feb 2024 23:50:04 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1150B6B0075; Wed, 21 Feb 2024 18:50:04 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 09DE96B0078; Wed, 21 Feb 2024 18:50:04 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E31EA6B007B; Wed, 21 Feb 2024 18:50:03 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id C395F6B0075 for ; Wed, 21 Feb 2024 18:50:03 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 6F9CFA107F for ; Wed, 21 Feb 2024 23:50:03 +0000 (UTC) X-FDA: 81817456686.02.827FB7A Received: from mail-pl1-f171.google.com (mail-pl1-f171.google.com [209.85.214.171]) by imf17.hostedemail.com (Postfix) with ESMTP id A1F1D4000F for ; Wed, 21 Feb 2024 23:50:00 +0000 (UTC) Authentication-Results: imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YL1KM1FH; spf=pass (imf17.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1708559400; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=D9r0dNhUKJEdGKYYdAqMzZgO1joAP6x5GpmEzjGgfls=; b=k32Hr+hTZbOcOZGDjJELMLFLN7wmLVspODT2z8AvEDfRS8HaLqexaNINR1P4CQlO++v+Dx zzFQwqLcX+IJ2hS8XAt8OvTEr0C5JMIVn0PNQhdJ/VXgKwaGIr/ZFWpVTDLVzAeX+6LJio JH8potlP6b4XH9QR3p1BaLw07BQxclY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1708559400; a=rsa-sha256; cv=none; b=SiArIDESv0uaxbRNhJ0KtW1MIlvjID2TbxqPu+6RRF8kSVn1xsP5TuPRcknJ9e3EOaFMZu uZ5of9HDlKkwMUbUHl43L5vRDgRaPogsY5uXewS/YVuoeT62cW2ogRgQulvWUZ5cFr8/ih Ue4uUjuE+8QQK6+wIMfOLiuLZP9XHQs= ARC-Authentication-Results: i=1; imf17.hostedemail.com; dkim=pass header.d=gmail.com header.s=20230601 header.b=YL1KM1FH; spf=pass (imf17.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.214.171 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com Received: by mail-pl1-f171.google.com with SMTP id d9443c01a7336-1d746856d85so48084445ad.0 for ; Wed, 21 Feb 2024 15:50:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1708559399; x=1709164199; darn=kvack.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=D9r0dNhUKJEdGKYYdAqMzZgO1joAP6x5GpmEzjGgfls=; b=YL1KM1FHnUz7l54X8VjfRBo+3guUChN7M5GjfR/dyaQZLFSa4NiBaOLHUlux9tfbTH O2Gc7UIxAippOZIVqwS/FybcTv6KnSV+15kpIEkuji+/u2hxlWHdDu7vmCQ+S2uG8ri/ Z1h3MBoDyAMswljGTYHKfR2diE1hZVhCOiuGv83ESeXNvRPAqgAgoicRC9NKLLjDjQQU zM0vZQjyu101xX0S5ujeX+V4fBh/HsaRlrBBnxSKs5b8c4hlkahUPF6DSKQLu/ELznCf PrJEh8k9/2oYdWWv7PKGdT2CKfcTW0LOMVHKT3T5UNX/X2k2IS/sLdKUDVbWUcc5URWv mC1Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708559399; x=1709164199; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=D9r0dNhUKJEdGKYYdAqMzZgO1joAP6x5GpmEzjGgfls=; b=v/TUBMkXlvYtIt0uL+O4wmrxYRdAefpDGSCoGfWB9BwMI7qUBNkbLtQoXYTmJQ4Hyj ALhF3QycMSwweMUVevJqVbfLM5uNWCWC0RitrGYksSj+gle+O8pR+CHNIS70oZAOea9w qossDcdJvyIDm9M56gXQnD3QQeoyicb9w5tfoo8YvAxkAPmVF304Ht1LcmPODjvhi4fs yCFUBqgFEQvDEExP0Cg2O3NWdLaOfWmr2w7R6uH+34ZEow1Kp316b/s0rRKBnl5cermX rbTlYKv096/PBB2MV1yFORhZwQlsvRzWWn7rHOcsEI0G08PTQVInFoS2h0J9lpsedsEY egsg== X-Gm-Message-State: AOJu0Ywdbg3xdqfJ8hxhcZAzB2LeeGz3JHu8ZMjrYBvwIl06ElFmZf08 DeufcljLCi0eO1Syeqxwx79YEZwYniNm8cBsQPxYN2whmecFMEKBJAzmlgLC X-Google-Smtp-Source: AGHT+IFr5csdbedkdbc7gfWNEnT4VGUpgBUjTFBU/uVZRy4b5xVJHZlEkUhQBpB/fS9dWQPuHu1AWQ== X-Received: by 2002:a17:902:d4c6:b0:1db:d2f7:68a4 with SMTP id o6-20020a170902d4c600b001dbd2f768a4mr14329598plg.24.1708559399353; Wed, 21 Feb 2024 15:49:59 -0800 (PST) Received: from fedora.. (c-73-170-51-167.hsd1.ca.comcast.net. [73.170.51.167]) by smtp.googlemail.com with ESMTPSA id jx3-20020a170903138300b001d752c4f36asm8657794plb.78.2024.02.21.15.49.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 21 Feb 2024 15:49:58 -0800 (PST) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, muchun.song@linux.dev, willy@infradead.org, "Vishal Moola (Oracle)" Subject: [PATCH v2 1/5] mm/memory: Change vmf_anon_prepare() to be non-static Date: Wed, 21 Feb 2024 15:47:28 -0800 Message-ID: <20240221234732.187629-2-vishal.moola@gmail.com> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240221234732.187629-1-vishal.moola@gmail.com> References: <20240221234732.187629-1-vishal.moola@gmail.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: A1F1D4000F X-Rspam-User: X-Rspamd-Server: rspam11 X-Stat-Signature: mgbpfjkps4rzd7kqfy5houfzhhe6r5dj X-HE-Tag: 1708559400-212277 X-HE-Meta: U2FsdGVkX198Hgfh1ZXuovY8ON4yUbF1G/IM6Scvv5ilr1RwXFsbiwP1xLuBfX938PP6QiwStoGlcMKH9J2zp+tlOQTlR2PN4Eycc3gzkBiKcsnJsdU7zdHNRNAEEAkGVCILVgEX3N3QvmjqszOo1SCOMrLKtBxvZmm5/mr2hDwY+4p+HOd/ELJXI10wXRr9/iAroY2J1ml08AiR88zx8a7QhJdmS3uL6sy2aKsq9eY5D7SLyCCQZkAj0uBpoaVn6NIb2BdLuCKyixshc/ejrLsCwrBnHQC2hZpkZRNqw2i/iA4yVhrgdgH8iy6sw/3sPVixICWJJNr4d2m1cLgbf8941pEvM5TknXyCrMfLr2RYIIYZ5h7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qnkUKFhgdwh8XI6qKrv5Fi31iJew8l/nILp0ViWr0pqimHYAWC6F9sERtcNcQq8lVuutEJPkkat0jGWOYAt8zoaeESfOxtlmBLJvm1SPf1jJM0qKZfeUt/bw+GgSMM1ullW2w9z0HQ2RS2b5yw== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: 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. Signed-off-by: Vishal Moola (Oracle) Reviewed-by: Matthew Wilcox (Oracle) --- mm/internal.h | 1 + mm/memory.c | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/internal.h b/mm/internal.h index f309a010d50f..b9b6b2bc1663 100644 --- a/mm/internal.h +++ b/mm/internal.h @@ -103,6 +103,7 @@ static inline void wake_throttle_isolated(pg_data_t *pgdat) wake_up(wqh); } +vm_fault_t vmf_anon_prepare(struct vm_fault *vmf); vm_fault_t do_swap_page(struct vm_fault *vmf); void folio_rotate_reclaimable(struct folio *folio); bool __folio_end_writeback(struct folio *folio); diff --git a/mm/memory.c b/mm/memory.c index 89bcae0b224d..c93b058adfb2 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -3081,7 +3081,7 @@ static inline vm_fault_t vmf_can_call_fault(const struct vm_fault *vmf) return VM_FAULT_RETRY; } -static vm_fault_t vmf_anon_prepare(struct vm_fault *vmf) +vm_fault_t vmf_anon_prepare(struct vm_fault *vmf) { struct vm_area_struct *vma = vmf->vma;