From patchwork Fri Feb 24 10:00:19 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13151077 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 C61DDC61DA3 for ; Fri, 24 Feb 2023 10:00:59 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 747F36B007E; Fri, 24 Feb 2023 05:00:46 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 68C8B6B0083; Fri, 24 Feb 2023 05:00:46 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E9C8A6B0080; Fri, 24 Feb 2023 05:00:45 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id B09A66B0073 for ; Fri, 24 Feb 2023 05:00:45 -0500 (EST) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 84EA41417FC for ; Fri, 24 Feb 2023 10:00:45 +0000 (UTC) X-FDA: 80501741250.18.B47263A Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf04.hostedemail.com (Postfix) with ESMTP id 6103E4000A for ; Fri, 24 Feb 2023 10:00:43 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=voy2FpNW; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=wTXXBZ45; spf=pass (imf04.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=1677232843; 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=mjxA/DFoKz/EDUMQDrlO5jdAE8nM57iTZhngVmIGq8k=; b=UdW+AmzxAj0riNlE5GUeBe/wFowUMMzKjRF43BOAlr6/QcZxKfotZQ13AG+QrgfpYIVGzu c6zDqa7fMTYd+m8Vdcz71EqsBJZ34t6qlsM2P/vc0KxoFRNoxuFw4b8pP6/4N0JXfCzQO1 0cUtMnaTE2rYa8KethSdTgaJnk4Ua1s= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=voy2FpNW; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b=wTXXBZ45; spf=pass (imf04.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=1677232843; a=rsa-sha256; cv=none; b=xr/G8q7bAocjj1fSR5yzBBqKsio82VC6TKdHYcx/1e0WuY1VXQgZrbbd/qLSKQEqgSRMwT BKVl94R1PjvvzkbTJIAhuxkL5TtYZMkPqbxnJmufqZnr9TL+Z6TvE7vOS9fpZt9W/SH5FQ 0cNc5JfZe/8XvORl0KM5+YNmdkCM3nw= 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 359F33420D; Fri, 24 Feb 2023 10:00:42 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1677232842; 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=mjxA/DFoKz/EDUMQDrlO5jdAE8nM57iTZhngVmIGq8k=; b=voy2FpNWabIiH32uIJf9u8966WAPWARBQoSUWNaUlSJD5l5+O5hmhYUqZhVmi07hhk6s0/ QLjdt3iolSQV+mpR3WeJqGuiOkjbuUv6B7Zwt/itYCDF50XaIe8OTqsdNxDI9p68X+RXXn ursGsbz3JWzs21fSIoWdJI/c4bMeL3g= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1677232842; 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=mjxA/DFoKz/EDUMQDrlO5jdAE8nM57iTZhngVmIGq8k=; b=wTXXBZ459/RZm1yILTfwpYiekgGlxCytcn5n4YtZd3HoOv3XHAqdByYTpcoq+ghkbGZ34m H3YkwoOhjIE8XpAA== 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 1C92D13246; Fri, 24 Feb 2023 10:00:42 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id KChtBsqK+GPeTgAAMHmgww (envelope-from ); Fri, 24 Feb 2023 10:00:42 +0000 From: Vlastimil Babka To: linux-mm@kvack.org, "Liam R. Howlett" Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, maple-tree@lists.infradead.org, Vlastimil Babka Subject: [RFC 08/11] mm/mmap/vma_merge: rename adj_next to adj_start Date: Fri, 24 Feb 2023 11:00:19 +0100 Message-Id: <20230224100022.11268-9-vbabka@suse.cz> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230224100022.11268-1-vbabka@suse.cz> References: <20230224100022.11268-1-vbabka@suse.cz> MIME-Version: 1.0 X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: 6103E4000A X-Rspam-User: X-Stat-Signature: 43oko3t4bx9k97t1thqkb14zeuijbact X-HE-Tag: 1677232843-293534 X-HE-Meta: U2FsdGVkX1/krnYf8oa0CGkQpbN+DxvAqwurUd3fLX30bOPdmlqiso7ecP2Lty4Rswo2/AJX7o7GzdcB8TUV30B39rcQMAwYzWdVvsI1/M3YAu/rzBVfEbNZGNnSAii3+EjvoiUM+fTyAlOmO0kUVjLa1BdI2nRCEo76BCLl6Uq3+8dCpC/vGbWTBDIuKZNzWd+EfKRvx9S5x2OM2vLBXlZCSQA5c8FNEG0kYfXDx/6I3jpzjkRu6aWQyygaN/ZmaO+4mJ1yK/zBFjQwXp2rDhfM/4t6df1KgEJ1uoqnEZail05cMWTuGgwYsvvxMyJkilsEvtlNPujfR78rwUD8PfQwez5OV7n6o5yjymlaceKRVYbVwVHwW4RASZE1JEmlAMuprW26SlwD78i6G1q97rOTkYMRaN5ZceOxc5AgRnc7jbbjiss5cL9mnKT3iqOYg0RX/B2lA2Z6WFsW9NQRU7yc686VWa9DRp7iZSH5mIPwzm9pbV/fOjlmXccgP76IE54p3f9As+NUjUgEk/Uo21lxqE7AJPkB5LKQ2XQMxtDcSA5yYRVZwrIC6c7Sgj+CApu6w/ch+HOs7qNbQgjBSMKGGPrU34Ijrpc1h0VVITB8DVzzSC8eP/UF086dsNFB25hJYBfGXR1Q+7Fx1MfskajmcXRFk8mvc6n3GyQWDOT9eJxlH82f+FNYVuYNcglHgIl6H4/lfZnkJlOOTE6j2SDuQ9mPS9lp0ot336g+wFSrtwByFWXNvBg8UAlYT9q3dtzB6z8L30ngGsKAExfdBTNVmkduCOxpBWbq7+PTD3Uj8kfMrU1917MHdJyCHXVFx2pl+spLDkgK9JXdKJG3AwW0dHRvYR5NDo9lZLBNtUfLrbhesEmhTq01iMTV9vTBoVuGxFQ5VtTSqgScpNuPx9OZzP/1tuGAr+VtUT3BTdBNF9Z9UnTIdSbvai0ljmp//Z8oG6sDNf4rO+IOt0J 8VMsV3Qo hr2Ln2VkRWayuBDT2MQccYPOeudyHLuJtHEA43hLWctRN/hwbaX8y+6oz6wTLfjn5q0cC28fEen4a3RPeylV82QOeiCxQ1OcEGWoC8c20SEkywUJ9+gh/Y6nnobtGRULbcbSiM4wGjAlxhJzhWN41B7wRkM1SLwkASmT1KM0AOEXyeFzW5LxcbGsiKnGhZ3giz41mOy6um1Zn7Y/2vZM3Wi2YOTaSOR0NlhUW/rR6o2CsaLSdfljJnnCSTQ== 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: The variable 'adj_next' holds the value by which we adjust vm_start of a vma in variable 'adjust', that's either 'next' or 'mid', so the current name is inaccurate. Rename it to 'adj_start'. Signed-off-by: Vlastimil Babka --- mm/mmap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index e05bbcaf7b61..8c2bdf9e3f94 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -903,7 +903,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, bool vma_expanded = false; struct vma_prepare vp; unsigned long vma_end = end; - long adj_next = 0; + long adj_start = 0; unsigned long vma_start = addr; validate_mm(mm); @@ -971,7 +971,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, remove = mid; } else { /* case 5 */ adjust = mid; - adj_next = (end - mid->vm_start); + adj_start = (end - mid->vm_start); } } } else if (merge_next) { @@ -979,7 +979,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, if (prev && addr < prev->vm_end) { /* case 4 */ vma_end = addr; adjust = next; - adj_next = -(prev->vm_end - addr); + adj_start = -(prev->vm_end - addr); err = dup_anon_vma(next, prev); } else { vma = next; /* case 3 */ @@ -1002,7 +1002,7 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, if (vma_iter_prealloc(vmi)) return NULL; - vma_adjust_trans_huge(vma, vma_start, vma_end, adj_next); + vma_adjust_trans_huge(vma, vma_start, vma_end, adj_start); init_multi_vma_prep(&vp, vma, adjust, remove, remove2); VM_WARN_ON(vp.anon_vma && adjust && adjust->anon_vma && vp.anon_vma != adjust->anon_vma); @@ -1018,10 +1018,10 @@ struct vm_area_struct *vma_merge(struct vma_iterator *vmi, struct mm_struct *mm, if (vma_expanded) vma_iter_store(vmi, vma); - if (adj_next) { - adjust->vm_start += adj_next; - adjust->vm_pgoff += adj_next >> PAGE_SHIFT; - if (adj_next < 0) { + if (adj_start) { + adjust->vm_start += adj_start; + adjust->vm_pgoff += adj_start >> PAGE_SHIFT; + if (adj_start < 0) { WARN_ON(vma_expanded); vma_iter_store(vmi, next); }