From patchwork Thu Mar 9 11:12:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13167255 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 8B246C64EC4 for ; Thu, 9 Mar 2023 11:13:15 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id EC3E56B0078; Thu, 9 Mar 2023 06:13:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E51936B0071; Thu, 9 Mar 2023 06:13:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C7C0F280001; Thu, 9 Mar 2023 06:13:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id B29036B0071 for ; Thu, 9 Mar 2023 06:13:14 -0500 (EST) Received: from smtpin22.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 97D7980832 for ; Thu, 9 Mar 2023 11:13:14 +0000 (UTC) X-FDA: 80549098308.22.B8A142C Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf05.hostedemail.com (Postfix) with ESMTP id A98A410000D for ; Thu, 9 Mar 2023 11:13:12 +0000 (UTC) Authentication-Results: imf05.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=veUZEMzE; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=uNtMsgjS; spf=pass (imf05.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1678360392; 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=wE1al//pCc1to1HvUyvkZo2jQrSNJIISu5e3jqOmb4s=; b=oLvkzFbxpF3+BtOx04F988j0SJVJOMa838v9mhpkFW8301/HuWKJuGlwjs+gNLM3dB+XjV hNi5eTzW5G05jw/rlKbdH00ySZjHXk5kESgv105soE+vvIhu4JllXrklZ9/vt2xlBWi88y wmiM8n3Kku7A11kMZCI6YVEoeJpyU/I= ARC-Authentication-Results: i=1; imf05.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=veUZEMzE; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=uNtMsgjS; spf=pass (imf05.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678360392; a=rsa-sha256; cv=none; b=te2QgJHq24yfjc8SUTiCfTDYusu7qLv/Q3QyUNnUXUoPBbyY3aRxuteQ6ktUdE/JGmm11A kjxd84+juLPlu9PSLQyNBmvqbcdPVdPcODqkmYmIYzNACitUXBVnOoBmn7uHiBL/RZ3j/A 6cFgGwm4T8FzL4/tlwiYTzpps0H8meg= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 7CE9821E8C; Thu, 9 Mar 2023 11:13:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1678360391; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wE1al//pCc1to1HvUyvkZo2jQrSNJIISu5e3jqOmb4s=; b=veUZEMzEMFoFQBSMkP7TVCeLql/YYD/acm4DYFiB8bth7DfTCzjmSL7zWAGRSKNsFvCzPv 80vdMoqx0HTQ4/7N9cFLCg8kRPqV7ipaRyEJY3x42qSIis4ntpoOTThU2WXvVT+g36j1KN RtXw5mM+Lk132MHltILMEq5ZhGqMj0Q= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1678360391; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=wE1al//pCc1to1HvUyvkZo2jQrSNJIISu5e3jqOmb4s=; b=uNtMsgjSDTk/7Nv8XNxPldzlzzfl+cS/tPmooh3HejHqR7vHiuhfcC3t1a+EIzZdoeipTI HFfyME6YvqFto0Bg== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 5DE691391B; Thu, 9 Mar 2023 11:13:11 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id qHtIFke/CWRiRwAAMHmgww (envelope-from ); Thu, 09 Mar 2023 11:13:11 +0000 From: Vlastimil Babka To: Andrew Morton Cc: "Liam R. Howlett" , Matthew Wilcox , linux-mm@kvack.org, linux-kernel@vger.kernel.org, patches@lists.linux.dev, maple-tree@lists.infradead.org, Vlastimil Babka Subject: [PATCH 04/10] mm/mmap/vma_merge: use the proper vma pointer in case 4 Date: Thu, 9 Mar 2023 12:12:52 +0100 Message-Id: <20230309111258.24079-5-vbabka@suse.cz> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230309111258.24079-1-vbabka@suse.cz> References: <20230309111258.24079-1-vbabka@suse.cz> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: A98A410000D X-Rspam-User: X-Stat-Signature: u7cb5b1tr8s6ir55abahn8g8iati5r1f X-HE-Tag: 1678360392-139187 X-HE-Meta: U2FsdGVkX19ulT0Z2UY7hLpoiHg0foPfMYoxUcN47/uxtTflLrV/7uOO20iYMKPv9bfKz//moFc2jfonoSJVb1a+neUBH49/SlnEFMFWKo8fMl/+WEnCMpHlI5n4uZwtFDMTgcqwtt83UIO2qK6OKU3UAvE55PSB8MxjVQ83ySiwAlXIJOyw0pZwoXYkecLKruqhI48kDaGbGp/Vr22Nu086UOV5TtjwbXiVQybPRV8sjtPnHq61bT6sNUFR6ll4rOT8Fi+4DHGakPVKTvim1AF9bytsjtCqHKY/BfZojq1SH9fWFfviu/g4pv9YgMN9qaOjX4//4s31bbKM7AOgaFEGtdMrPyBiRTe2jEgmU1G1Za3Wu54uqMSfDzbuG1uro6tz/L4j//o+NqF4DFYsC7VXhl9mt6KVmuDzRRWzEJ2430GgefbFaK5c3l+MFSnhSzayi+t5BFxB3UAysm1SsysFwH9NpkN8LvlXufE62/qLLiAz6Au99WiJoDI4/0pmeNYUdA6YKTUx7SFMwfHy1YG3I8tn+sOxdYo+EESENaaD0M1ufZz+nI88B2HLOv430lXzPnfgCs4SoVz4XXMa9q4Oqb3XxX6Xq/63haSyFaO6LX3BmYthnZJv2RPGIQyOGu2LaxAuNv2GxD6Iyl+YrEE/7Hw3nScwP7U9XXScfVRBqahxpfSRg224bWjfKE97aX2yvctfmCfjGaN3sWHbiy6eCYU8YS6kjDwM95akUN/5g7RHthO70a5NXw2v9MBcEf5U5KZsD9/xtCcxWf4cYO3XtUQS1nobtbxvedEy2qR8ADsD4KJ3PwY1zmxFkCpNB7WUwX1+PpFzQreyFCwSZxQIQafEphxW5MoN/AZWeJP8mTZBOCFyKnR2cHl5ecYgZc4X+s5lAd6X2/FbfTc/Ml2TdZD3pi1EaOGYMiePyPcf5PEtQNYJnB4qgf8CwcIjotvglns62bpG4lSLSEw BhF5dFCb qtwexQF58ToxhLmlRa4qaIPH0069uEsn6g9yhq4zZUcigS09Qkm/wVsNCGvQiQvKPCdpPD7jAph/X+b9CSnt0TPfcIoB2Ax6/DLo9UiqJ69MPbUJ5hrP/A3LOxRuqT1Osw5aQfam5R3E7jYnsgEHcGOjG5dbkpWgKFQEWi9I75QSTYCQ+HNnWyH/fE8sTujlXMNQwyV1jTJQkN272tFzH1VHl0r5fghTtHcUiTl4SPWXjiNMrlMIOMCBDAg== 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: Almost all cases now use the 'next' pointer for the vma following the merged area, and the cases diagram shows it as XXXX. Case 4 is different as it uses 'mid' and NNNN, so change it for consistency. No functional change. Signed-off-by: Vlastimil Babka Reviewed-By: Lorenzo Stoakes --- mm/mmap.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index c33237b283c9..420d6847c94c 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -851,9 +851,9 @@ can_vma_merge_after(struct vm_area_struct *vma, unsigned long vm_flags, * vma, PPPPPP is the prev vma specified, and NNNNNN the next vma after: * * AAAA AAAA AAAA - * PPPPPPNNNNNN PPPPPPNNNNNN PPPPPPNNNNNN + * PPPPPPNNNNNN PPPPPPXXXXXX PPPPPPNNNNNN * cannot merge might become might become - * PPNNNNNNNNNN PPPPPPPPPPNN + * PPXXXXXXXXXX PPPPPPPPPPNN * mmap, brk or case 4 below case 5 below * mremap move: * AAAA AAAA @@ -972,9 +972,9 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, res = next; if (prev && addr < prev->vm_end) { /* case 4 */ vma_end = addr; - adjust = mid; + adjust = next; adj_next = -(prev->vm_end - addr); - err = dup_anon_vma(mid, prev); + err = dup_anon_vma(next, prev); } else { vma = next; /* case 3 */ vma_start = addr;