From patchwork Thu Mar 9 11:12:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vlastimil Babka X-Patchwork-Id: 13167260 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 05633C64EC4 for ; Thu, 9 Mar 2023 11:13:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1D7A76B007B; Thu, 9 Mar 2023 06:13:16 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id E2B7B280001; Thu, 9 Mar 2023 06:13:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B26A1280003; Thu, 9 Mar 2023 06:13:15 -0500 (EST) 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 5B4FF6B007E for ; Thu, 9 Mar 2023 06:13:15 -0500 (EST) Received: from smtpin16.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 24E4680784 for ; Thu, 9 Mar 2023 11:13:15 +0000 (UTC) X-FDA: 80549098350.16.290F6C9 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by imf04.hostedemail.com (Postfix) with ESMTP id 2991E40011 for ; Thu, 9 Mar 2023 11:13:12 +0000 (UTC) Authentication-Results: imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="B/CM6zj2"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="oNHa/N2c"; spf=pass (imf04.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 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=1678360393; 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=H5Xl+u0fh2FgM3W17DN3PSvRbLMjIOp4J+v3PnRSZIo=; b=amtTpUb1Ba7oXTk7tqV4BiX2fzxgYENRFbkq6N5Zb0p/1VKNZcS0k+BT4MpNEy2pQsVudA 481MYBWiznJtsXswWHu/vhuyJbuB0T7lanq+tJyy5qNKf1coiCr0Hx18rOvkdtT2AgAbFa 4De1xlVXCutsWN9Ewwf55a+g6FQQOZQ= ARC-Authentication-Results: i=1; imf04.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b="B/CM6zj2"; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="oNHa/N2c"; spf=pass (imf04.hostedemail.com: domain of vbabka@suse.cz designates 195.135.220.29 as permitted sender) smtp.mailfrom=vbabka@suse.cz; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1678360393; a=rsa-sha256; cv=none; b=nLSblx7Jbe42q8b6h6sSbCnQzXEqsFuBEUaDtAcV01A+zrQ/chyavuzWZEYABFkcKJ0+DA swkpSeAuPHziVBKZnq0nCvrtk7bqv3LwNCzpEbEUD/iau3QmOq474V2PNsMhFBpfi5EudA 4x3WkUQJtq2YNYrMJEPzLCOTNfUnK18= 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-out2.suse.de (Postfix) with ESMTPS id DD1FE20039; 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=H5Xl+u0fh2FgM3W17DN3PSvRbLMjIOp4J+v3PnRSZIo=; b=B/CM6zj2HePtuxZyWrSBOI+UpLPmAYIkevuMn8C1gakrbEx7dx4iWnWdEWCjgvFUYVVUZy k7q5PeFsmR6+U94AH7pmEh964kEjclVSO7u6kyj/hU04saF+BWM8C0OR9Ec46vrX2itxVX nosl3jQgoKjWKudlG81Kp3fkVEQczgc= 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=H5Xl+u0fh2FgM3W17DN3PSvRbLMjIOp4J+v3PnRSZIo=; b=oNHa/N2cnuMf0OOPPR/beI9/RMdRl/JNf5JcX8V2U8tICXzM5KqpPDQQXmiUIn/6euVKKV y9QumAAEW80pDOBw== 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 BC57113A73; 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 eL1bLUe/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 07/10] mm/mmap/vma_merge: rename adj_next to adj_start Date: Thu, 9 Mar 2023 12:12:55 +0100 Message-Id: <20230309111258.24079-8-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-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 2991E40011 X-Stat-Signature: bsbkxtnm3ag65ffenc4mfd78bawdtcuu X-HE-Tag: 1678360392-256688 X-HE-Meta: U2FsdGVkX18V9GEEahY2iClBe01MokYEM+rrEzY81KCid6EZbhIWynhsDJJKkiAZGu6BHPZ5ZEgmcIv8WHXDKXteh7nEdaGofJY88psCZAFVXpE+l0ELTnwE+9Pai2dVETiEGsAk+vSUe+PIoknB5cGFUAK2MlrvsZwMmxHHeLRZ08pejo8YmtCYVc5eLQlK/Ex+Khlo0U7CPPn3BaMk5Jt/OAsSM2/cnfDfyzrVZ9dv75QHywxNviDpQU9YlrJ/lSkzrnjtk6DChqYYuA5K8uNPcNlQ2h5wqawejlLvIHmbhmZWC+SmjoPldVMzvI4aJ2sScW0S9CCoOLpWYvGlgUmF2GAJBK7uWhWK+7KpesINcJPaYQqzqD7fHy6PjUjYlnA3wXNJFhqnxodQbFPVIqyFHU5EJ2XsrnMiVsnOtxB03hL0sMXhtdRLGOr/payMidZtOjQW5WLdgghDEzUQ4BB4vQ/6CJIRkkd+osCcoQCR4UOM69kAMHHuIuOIpjPGUhcZYUcjbScPdYriGk73be/lHkrUgoh1G2oMCU6DzoLVWVlgDAiTnGj5KPk50DQErKoIICcTS2X5/RbsW2u+0v+fRaJwH+0ajtFkJVZFqN1Wymq59Fj2O9LTpvRr0q7fO8dxI6a6xFZpff6EHP1jFxWvstITNArLNJa6Lvj+IeLHp4RG2pzTH7bL9ZveyTAi6kKxdQH4uMUItsR7+NUtQv/EEXU9brI0BxjC5qodF7RucmpAujpJCz2jdNEuiRl07xKDvjrze//M8x290OuyOE4Hab+rilBDf+DFPwbr+s83w9EbepLeCis7Bzu760pMr/nuh1cRebth4e7Rg3Ri2hvzcOJ/hfdaPWxQl+uFZYmi8POX/n8+Wj/snrJwz4cwy9QtCX67jOXgRE3gceoOiC6yDOD7XQNEgTHGCLaukg0QHA+yXWiP/b/JhRXZx1L7E5Bn0j6f5CJPYmTBAlq QxuhEvJo J8/VRAQj7F5TfDFs9Lm96Vj0NxLedn4Tb/fB/1/jByrgJLRqTxFE7c9JalLP8XRYKVVpoEOBisHRFDe7z+7EM2++ysRqlE2G1qd9tt2GWuel7ekHsID6JsH1bOhnkglSnfyvLC8wCngxyBizQ4WwLYjJ1CDmhxyKDzRCTn78jK4/kM5w3D3ttoEDW996oDkCmDx64kxvD8EZnJhhMaOUIZ/ll0VOPViiri9YYKlnM8EnppxIKzfUh+fQNVozbqaznUVgv 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 Reviewed-By: Lorenzo Stoakes --- mm/mmap.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index 3396c9b13f1c..c51d69592e4e 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); }