From mboxrd@z Thu Jan 1 00:00:00 1970 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 7A20DC433F5 for ; Thu, 3 Feb 2022 12:08:40 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E2C878D0146; Thu, 3 Feb 2022 07:08:39 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DB52A8D0124; Thu, 3 Feb 2022 07:08:39 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C07AB8D0146; Thu, 3 Feb 2022 07:08:39 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.a.hostedemail.com [64.99.140.24]) by kanga.kvack.org (Postfix) with ESMTP id AEB4C8D0124 for ; Thu, 3 Feb 2022 07:08:39 -0500 (EST) Received: from smtpin01.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id AEE301208CB for ; Thu, 3 Feb 2022 12:08:38 +0000 (UTC) X-FDA: 79101346716.01.074810E Received: from mail-ua1-f46.google.com (mail-ua1-f46.google.com [209.85.222.46]) by imf08.hostedemail.com (Postfix) with ESMTP id 42028160003 for ; Thu, 3 Feb 2022 12:08:38 +0000 (UTC) Received: by mail-ua1-f46.google.com with SMTP id w21so4733074uan.7 for ; Thu, 03 Feb 2022 04:08:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=+xYUiL1/dI8fAOExcqcrQPfM5bBJBMlqGF1dPN8Xu7M=; b=eQspLdFmo5bLzpsBd7r1CYb2D4Q9sL2/j664dwJwUYpjvTA//39tbXI1vT8fF6NXOC KMWbSUqEahpnuupz+auUcbjQBFz8D+szV7X0VKfCH+NmMVkIPvpLkKNjJpA/eEl4y4Km S9yyRwX2cvgPPd/1ErQ29GhzIXyLdahed72rnXv0G6S9Kwp5KZx3qp13Ixm5fLveVEJd y0H/j8HzYld8eGOKAsI7Tx5MpxczyuG69p7El8JkfeXVHXciuJM7N5WqVZbuSvw6G6be 0G3ZwCun7OmdTkoLM4OnyScjnW+R62w3t09ZxRma30mJYrFwiNEEwbYwtiD2IMEKOxdK mCkw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=+xYUiL1/dI8fAOExcqcrQPfM5bBJBMlqGF1dPN8Xu7M=; b=uEdGPNM/ed2/YOv1+cYgPoRXJm+M8Rc0sdQaUOpGfHynudFpxcT+dFEg17HcPt/Z+1 Zz+ejWGw/xibTDxcahMKoKLFjdaxQhXqA2wN5jl4OuagTLkPHAUZX9KkdUHRdIyh+PpQ oqmvPv4Mju9uKeuvo5hXKZyhXzyErA/rbIG3PuRyjCegPbmNNgFmCmqVuzB1mhTkRNGx kUbnUi5zuCyqFEE20akZgPozd/mxUbjXf3++4jJpcgG1TAIzOHgVRQc7iQOiopiFACrw guANfLyiEbNVca75mxg4uyOdiAhH+N0gS4ACOWtqILWLjC5yFxUp0PzO+HSo4frk20hL ENVA== X-Gm-Message-State: AOAM5317Klh/2QwlxTO5eTF1Jp8yRRsZvQpTWN/gJScSHwesVHwe/WZP IWpvS7RK6MxGTFbpHcyshpOyniL/4ES8TrYG0D4= X-Google-Smtp-Source: ABdhPJwtdfOagc6zgauDjS1hUg9bQ5nC5Fe+Sy2qhjzZy2FWSESY4+L8x3I6a3hk6zmVP6x/50ss2i7VWweJyIcxYbg= X-Received: by 2002:a05:6130:315:: with SMTP id ay21mr16140257uab.49.1643890117561; Thu, 03 Feb 2022 04:08:37 -0800 (PST) MIME-Version: 1.0 References: <20220202024137.2516438-1-Liam.Howlett@oracle.com> <20220202024137.2516438-69-Liam.Howlett@oracle.com> In-Reply-To: <20220202024137.2516438-69-Liam.Howlett@oracle.com> From: Mark Hemment Date: Thu, 3 Feb 2022 12:08:25 +0000 Message-ID: Subject: Re: [PATCH v5 68/70] mm: Remove the vma linked list To: Liam Howlett Cc: "maple-tree@lists.infradead.org" , "linux-mm@kvack.org" , "linux-kernel@vger.kernel.org" , Andrew Morton Content-Type: text/plain; charset="UTF-8" X-Stat-Signature: pkdyzqewthxyprpii58ibyaduxhgxorp X-Rspam-User: nil Authentication-Results: imf08.hostedemail.com; dkim=pass header.d=googlemail.com header.s=20210112 header.b=eQspLdFm; spf=pass (imf08.hostedemail.com: domain of markhemm@googlemail.com designates 209.85.222.46 as permitted sender) smtp.mailfrom=markhemm@googlemail.com; dmarc=pass (policy=quarantine) header.from=googlemail.com X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 42028160003 X-HE-Tag: 1643890118-458751 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: On Wed, 2 Feb 2022 at 02:43, Liam Howlett wrote: > > From: "Liam R. Howlett" > > Replace any vm_next use with vma_find(). > > Update free_pgtables(), unmap_vmas(), and zap_page_range() to use the > maple tree. > > Use the new free_pgtables() and unmap_vmas() in do_mas_align_munmap(). > At the same time, alter the loop to be more compact. > > Now that free_pgtables() and unmap_vmas() take a maple tree as an > argument, rearrange do_mas_align_munmap() to use the new tree to hold > the vmas to remove. > > Remove __vma_link_list() and __vma_unlink_list() as they are exclusively > used to update the linked list > > Drop linked list update from __insert_vm_struct(). > > Rework validation of tree as it was depending on the linked list. > > Signed-off-by: Liam R. Howlett > --- > include/linux/mm.h | 5 +- > include/linux/mm_types.h | 4 - > kernel/fork.c | 13 +- > mm/debug.c | 14 +- > mm/gup.c | 2 +- > mm/internal.h | 10 +- > mm/memory.c | 33 ++- > mm/mmap.c | 518 +++++++++++++++++---------------------- > mm/nommu.c | 2 - > mm/util.c | 40 --- > 10 files changed, 264 insertions(+), 377 deletions(-) ... > -static inline int > -unlock_range(struct vm_area_struct *start, struct vm_area_struct **tail, > - unsigned long limit) > -{ > - struct mm_struct *mm = start->vm_mm; > - struct vm_area_struct *tmp = start; > - int count = 0; > - > - while (tmp && tmp->vm_start < limit) { > - *tail = tmp; > - count++; > - if (tmp->vm_flags & VM_LOCKED) { > - mm->locked_vm -= vma_pages(tmp); > - munlock_vma_pages_all(tmp); > - } > - > - tmp = tmp->vm_next; > - } > - > - return count; > -} Trivial: Comment in exit_mmap(), for oom-victim case, has a reference to this removed function (unlock_range()). Cheers, Mark