From patchwork Sat Mar 18 11:13:17 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lorenzo Stoakes X-Patchwork-Id: 13179743 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 0D523C61DA4 for ; Sat, 18 Mar 2023 11:15:31 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 01FE2900003; Sat, 18 Mar 2023 07:15:31 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id F11A9900002; Sat, 18 Mar 2023 07:15:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id DD9C1900003; Sat, 18 Mar 2023 07:15:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id CEDEB900002 for ; Sat, 18 Mar 2023 07:15:30 -0400 (EDT) Received: from smtpin28.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 3D39A1208BE for ; Sat, 18 Mar 2023 11:15:30 +0000 (UTC) X-FDA: 80581763220.28.8E4DBB7 Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by imf02.hostedemail.com (Postfix) with ESMTP id 7B8C380005 for ; Sat, 18 Mar 2023 11:15:28 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=oJlevLse; spf=pass (imf02.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=lstoakes@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=1679138128; 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:references:dkim-signature; bh=gAMkUBmCN5X3r9kQm0uq8aZ07PDcKdoRSeFhCE7Nwzc=; b=qr1rtj2IUB0HxAGQ1WsrCacsDnEVdo8jXa+kBqJrA7qkvyfBAgurzEPb/w6R6Z6O87pe1n QCBXNmrBxY/jp0Ks5Jz2w4fQ7HO0+MttxwB1Tc3mkE8HRD6zOQ4tcaJ7ANDTkD+CgRm+P3 /Sf/lPgoEEKLGrdtQU/svOgQWB+LE/o= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=oJlevLse; spf=pass (imf02.hostedemail.com: domain of lstoakes@gmail.com designates 209.85.128.50 as permitted sender) smtp.mailfrom=lstoakes@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1679138128; a=rsa-sha256; cv=none; b=JMNnQk6WNnzGK2uG6M2QgiXSWKY3r6gngb841LUb2hxHXtBdTMP31+cWSptamQjpeBY90r TzJC6PcoazzaUGrRttWiRIkTDcLcvDt6Sn2IQwyrqC/UBwpeE2E1xyd9a2RI17bmScy7r6 0myfMDJZgBbKgFupfc8dkiYA6ZUWCDg= Received: by mail-wm1-f50.google.com with SMTP id x22so4729838wmj.3 for ; Sat, 18 Mar 2023 04:15:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; t=1679138126; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=gAMkUBmCN5X3r9kQm0uq8aZ07PDcKdoRSeFhCE7Nwzc=; b=oJlevLsej7ONWhGMXP1jpMP9Rg/PeQtbFPG4kE0U4DQvnk2+/FuXnGGyj43qJxJLFI CAdJ1UUutiXpDPrOQCzGpm/1rxyWKN69Vvg0hkSWZOMCSHyam5/NveP3dMKTVMUZ6mGN 9jwTFaFalUmqfWib5uFG/ZA4il+IAGOJeiW3FaR6ZQPiJYTkHNfrybEmjMsowAxdAqwJ yOXD5sN/QiWTi+tN29VdoFi6AlWib+WfsZ6sDuAXauV3B5uzowRB2OjLgjjdop0kiA7w P01LF+kMU9pDtKSoRlF9TLPA28Z3y3yLzE9967WkKMF/Ag5hK9LV/LKs7pNi16OCM5ge FU/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679138126; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=gAMkUBmCN5X3r9kQm0uq8aZ07PDcKdoRSeFhCE7Nwzc=; b=ZeziNV1hzbW40wUr0lHG96zgdJKl4YV95ZhwVah6Zi9/Sx8G6sdhSBaIKCyQK4W0W1 oLxA0fIgwHZZSv3H/KQsVAFqwbkCoivCheYW4C4AzsCWLo+GFuu5Yz/YmPmyn0U/rFnM KRP+8qcGy8agZ0tjHyjO/+f8c2zl90gg2zISLJIN9lE+C77Afq/ERuZ+yurlX0QmMVhe yFvHd+RUdG5S2zrYBOwCYi8/1CZ+XPvZICxPkVnUhvNxQifCYs8XfypyQ0mSzlES/ztZ NgcyQgCYQcagE6akzXsBXCktgDBd56iiqPAdA/nUgV5W4ZtTV7spT3YwIfln3drJ8Ihz H+OA== X-Gm-Message-State: AO0yUKWPsVQG1Jj8B7LWqiM/PuoE1dPnsEXw5QP3nDInm/hnXtAuZqIf EzoLsv3s54olLTawywUzgKHTtBp5Kiw= X-Google-Smtp-Source: AK7set+m/2ZPNjyCcJsdIdEHcdktjiSMXPMjWYZjOWW4p0HAFsK5LwUTnqP6V4m6krhRKntwbzdw8A== X-Received: by 2002:a05:600c:4f50:b0:3ed:4b0f:5378 with SMTP id m16-20020a05600c4f5000b003ed4b0f5378mr9061075wmq.27.1679138126468; Sat, 18 Mar 2023 04:15:26 -0700 (PDT) Received: from lucifer.home (host86-146-209-214.range86-146.btcentralplus.com. [86.146.209.214]) by smtp.googlemail.com with ESMTPSA id n23-20020a1c7217000000b003eb68bb61c8sm4849965wmc.3.2023.03.18.04.15.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 18 Mar 2023 04:15:25 -0700 (PDT) From: Lorenzo Stoakes To: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Andrew Morton Cc: David Hildenbrand , Matthew Wilcox , Vlastimil Babka , "Liam R . Howlett" , maple-tree@lists.infradead.org, Lorenzo Stoakes Subject: [PATCH 0/4] further cleanup of vma_merge() Date: Sat, 18 Mar 2023 11:13:17 +0000 Message-Id: X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 7B8C380005 X-Stat-Signature: b5cj8ncp5ixaofxrqyst9jocbuhkottn X-Rspam-User: X-HE-Tag: 1679138128-928974 X-HE-Meta: U2FsdGVkX1+MYkM2ww9afbxaAhRa7UYFdYhA2af1VS7IGe2Hv1Q2XslZn0hjAD36PdtoPHLpcxJUV+v7oml/ky5UlT6h8SghCcu96qwDf8y2S78L00nNIDXDp7wAP0fon67omqAKIoIfweyT3n87fTWfpQyar4CPPDI30TRoC8pHFbG8mXh+tZYKpYpEEQHSZfVOsUZqEhV6Wcol0BnNF46Bv+yU8ukkQ8hJ8xjj41g/JyP0x3JVFjQpglOYH8obfiYtm2ETVbRPByBSjexlPFGa/t9Ie0jg1NdqEnAEKzQ1LAzFFnItclZGm1l0eEKvKGNjP+68/K1/LoAw+7yI48gCaBOURwk22YYsWW9gKW/mrl4vlZ9zxt7aHH509LLowJUeKHiTAIoqaBXzk2MazZ74J0NUP8wVdZ2v6hnJz6VfLR9IUow5qXEHtVf/Brb6xdrlK6cbYMTgfqmFrF42c3bOG3lLs83S37Fr5l8SHoVJBg6BGUPrvnD4MNoGjb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kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Following on from Vlastimil Babka's patch series "cleanup vma_merge() and improve mergeability tests" which was in turn based on Liam's prior cleanups, this patch series introduces changes discussed in review of Vlastimil's series and goes further in attempting to make the logic as clear as possible. Nearly all of this should have absolutely no functional impact, however it does add a singular VM_WARN_ON() case. Lorenzo Stoakes (4): mm/mmap/vma_merge: further improve prev/next VMA naming mm/mmap/vma_merge: set next to NULL if not applicable mm/mmap/vma_merge: extend invariants, avoid invalid res, vma mm/mmap/vma_merge: be explicit about the non-mergeable case mm/mmap.c | 165 +++++++++++++++++++++++++++++++++++------------------- 1 file changed, 107 insertions(+), 58 deletions(-) --- 2.39.2