Message ID | 20240816111405.11793-3-spasswolf@web.de (mailing list archive) |
---|---|
State | New |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 59EC3C531DE for <linux-mm@archiver.kernel.org>; Fri, 16 Aug 2024 11:14:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id F26E76B00FC; Fri, 16 Aug 2024 07:14:29 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DEBE46B00FA; Fri, 16 Aug 2024 07:14:29 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C8BA86B00FC; Fri, 16 Aug 2024 07:14:29 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id A9B686B009B for <linux-mm@kvack.org>; Fri, 16 Aug 2024 07:14:29 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay01.hostedemail.com (Postfix) with ESMTP id 6162B1C5B60 for <linux-mm@kvack.org>; Fri, 16 Aug 2024 11:14:29 +0000 (UTC) X-FDA: 82457850258.23.E550990 Received: from mout.web.de (mout.web.de [212.227.17.11]) by imf06.hostedemail.com (Postfix) with ESMTP id 69EA9180007 for <linux-mm@kvack.org>; Fri, 16 Aug 2024 11:14:27 +0000 (UTC) Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=web.de header.s=s29768273 header.b=bsK8cuuI; dmarc=pass (policy=quarantine) header.from=web.de; spf=pass (imf06.hostedemail.com: domain of spasswolf@web.de designates 212.227.17.11 as permitted sender) smtp.mailfrom=spasswolf@web.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1723806807; a=rsa-sha256; cv=none; b=xaMQLRY0TL3wt07TcGrcl0HOQkTA1VL5bcK8eAkepqoX0Fv/PSfPrQd0zuk88GT0W1UEbU 6amOrZowV08+pahQa9Eft+VzKGYZ9ZAOdVm3wU0x8qnFa/t2ghgRxvJh6Vn8paRb/RlLB2 TLhqiSMCy1JNEVS1Hmo6vYGL85GyEw0= ARC-Authentication-Results: i=1; imf06.hostedemail.com; dkim=pass header.d=web.de header.s=s29768273 header.b=bsK8cuuI; dmarc=pass (policy=quarantine) header.from=web.de; spf=pass (imf06.hostedemail.com: domain of spasswolf@web.de designates 212.227.17.11 as permitted sender) smtp.mailfrom=spasswolf@web.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1723806807; 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=PD0UJnTTUnduI4jUI2AUZd3cQsVgrFRB0T+PkKYNVlE=; b=3fnw9sodlYTSjFTbNAbwTd9FbEhSZ1SsNjcdT0o2/WTUhDyaxBz/lmZ0YDawBWgTpAqxvc y+vn9IR9bhqBFfZybsmKLhwphzaV77yM1AKplMO37BsaIC0fIy/6R/20Ph2hgq/EBJmHEb /BSZtItldrzcAcjq0rm7IspuMQZAGcU= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1723806860; x=1724411660; i=spasswolf@web.de; bh=PD0UJnTTUnduI4jUI2AUZd3cQsVgrFRB0T+PkKYNVlE=; h=X-UI-Sender-Class:From:To:Cc:Subject:Date:Message-ID:In-Reply-To: References:MIME-Version:Content-Transfer-Encoding:cc: content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=bsK8cuuIwKJQ7Clao6dvNXejoLvUACj62D88xFuXrHIS+SqZqZTiIkujgT3A9ogY IhQJSqIE6uwM4jJUu3Y+OOCpiLqhjeQUQBAvfUIKQ9GY/NyQncvVRmKmO9P1KznFv mICbU3RCOrx6UYEEc6F8F9j60SD2wIqZlWOrUuIbPditRuTPuMpICwfgd83XWKsJ+ NAVvDNQCmC8+8/prBKp1+f/N1mhVGUKIdWaMxOA5qW4vuiHTMby3PmANgpRWjQD+d pgBkbFv+LVhQcrkVk3+H+FMLZUjvNWBz5Fnw/R6Pf0xtu6f2i2Vi1M3bApaKoWOwZ /+jId0FSCoX7SPdC3A== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 Received: from localhost.localdomain ([84.119.92.193]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1M1JEu-1scB5F3PJa-00Efvc; Fri, 16 Aug 2024 13:14:19 +0200 From: Bert Karwatzki <spasswolf@web.de> To: "Liam R . Howlett" <Liam.Howlett@oracle.com> Cc: Bert Karwatzki <spasswolf@web.de>, Suren Baghdasaryan <surenb@google.com>, Vlastimil Babka <vbabka@suse.cz>, Lorenzo Stoakes <lstoakes@gmail.com>, Matthew Wilcox <willy@infradead.org>, sidhartha.kumar@oracle.com, "Paul E . McKenney" <paulmck@kernel.org>, Jiri Olsa <olsajiri@gmail.com>, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Andrew Morton <akpm@linux-foundation.org>, Kees Cook <kees@kernel.org>, Jeff Xu <jeffxu@chromium.org>, Lorenzo Stoakes <lorenzo.stoakes@oracle.com> Subject: [PATCH v5.1 02/19] mm/mmap: Introduce abort_munmap_vmas() Date: Fri, 16 Aug 2024 13:13:43 +0200 Message-ID: <20240816111405.11793-3-spasswolf@web.de> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20240816111405.11793-1-spasswolf@web.de> References: <20240816111405.11793-1-spasswolf@web.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Provags-ID: V03:K1:t7KgXoE5HB9OV298a3GOVGcOeApkwDqVfJq67tQ9GhMRkOUXHJq gQe/uyt64zx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kfizZ Uak1G5WW wzMPJvRIDlXhSiq1XsAmMBtw5yraezdT6zDpESBJXWzrNe6Nc92Xj70WOzYPzfn7qLhBMYjxJvqjEm5dmBAUVKNyhwaJd8mfai0DXNLO/PBNDq7J++EVsLSnZS/54qTiX+JC1zIv5SFS1kHyRVQaRoc7ldsD2GLjaH24EIAPssqcuCDWBIIJZqByhKJcCYleALvFxGavcX9uhFE0+cvJB1Y81WvSaQn7Soo05dSta1nUcj+yERMGPNY04bJ2p1dtbJdxypJpXrvq+6u+nwRb5TchOQcSmTWxXZSXYn8CsHJHug5Fz+U7g90BuPCpE3xdj2/4MO7q4TEG0T9XfR7A/eeX9ZQ== 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
Rebase v5 patchset to next-20240816
|
expand
|
diff --git a/mm/vma.c b/mm/vma.c index 02e4f7cf489f..83260a3142b3 100644 --- a/mm/vma.c +++ b/mm/vma.c @@ -668,6 +668,22 @@ void vma_complete(struct vma_prepare *vp, validate_mm(mm); } +/* + * abort_munmap_vmas - Undo any munmap work and free resources + * + * Reattach any detached vmas and free up the maple tree used to track the vmas. + */ +static inline void abort_munmap_vmas(struct ma_state *mas_detach) +{ + struct vm_area_struct *vma; + + mas_set(mas_detach, 0); + mas_for_each(mas_detach, vma, ULONG_MAX) + vma_mark_detached(vma, false); + + __mt_destroy(mas_detach->tree); +} + /* * do_vmi_align_munmap() - munmap the aligned region from @start to @end. * @vmi: The vma iterator @@ -822,11 +838,7 @@ do_vmi_align_munmap(struct vma_iterator *vmi, struct vm_area_struct *vma, userfaultfd_error: munmap_gather_failed: end_split_failed: - mas_set(&mas_detach, 0); - mas_for_each(&mas_detach, next, end) - vma_mark_detached(next, false); - - __mt_destroy(&mt_detach); + abort_munmap_vmas(&mas_detach); start_split_failed: map_count_exceeded: validate_mm(mm);