From patchwork Sun Apr 28 10:06:16 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: alexs@kernel.org X-Patchwork-Id: 13645975 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 01E4EC19F53 for ; Sun, 28 Apr 2024 10:03:12 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1C8A26B0083; Sun, 28 Apr 2024 06:03:12 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 12B8D6B0085; Sun, 28 Apr 2024 06:03:12 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F0D6D6B0087; Sun, 28 Apr 2024 06:03:11 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id D56326B0083 for ; Sun, 28 Apr 2024 06:03:11 -0400 (EDT) Received: from smtpin18.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id 66DC1A12AA for ; Sun, 28 Apr 2024 10:03:11 +0000 (UTC) X-FDA: 82058502582.18.1E87998 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf20.hostedemail.com (Postfix) with ESMTP id 613331C0002 for ; Sun, 28 Apr 2024 10:03:09 +0000 (UTC) Authentication-Results: imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MLSf53Bh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714298589; 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=6mq6ZLUobM1ytrcIEiUZ83Cf6/04X8l2v9REgO6QWHg=; b=CLHNCS0bINEsUJhqFiMsus0g/albQo82E5wPqVE7WiTw7pvCAOjBGVhyb9HIh5Vm5i781W RiVPNVXroKGZPPKx2j+yUFd+zR3whYsuZdCuDK3vUtu0tSeCWXh83GobtP59mkGfoixmlK RZynZeDALJuIJiXswfVJRMXnut9MzJY= ARC-Authentication-Results: i=1; imf20.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=MLSf53Bh; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf20.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714298589; a=rsa-sha256; cv=none; b=6qY7doCgFUVPvvPxj6RU0tJP20RvR2pA11l7iZiuMTWsZFz6EEG5DTDnmvGhmuUBZiYWnD w7XzBf/KwoOowsueIOswkE3oi3qsQ7AVVbM/xIjx7fhrx/3AvWhsIQYgOUNPsgTr3qjiM/ gVjYPuHHoi3SNMMjtPxlZK6UPNya2nU= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id F07E5CE0979; Sun, 28 Apr 2024 10:03:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A7426C4AF17; Sun, 28 Apr 2024 10:03:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714298585; bh=v4+B+wAdJjjC79dafL8cg9PLjD5MqzOi4QWIoVMKNQw=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MLSf53Bhof91jifuFJSJQ6+7g1PdgK+heeu185/hZxBRUagYjsIHNpgdcPM7rl8Gk 4C82ZOkNyq8ixRzlIGypuAkbyNMJrDlPI2zbe9QkEiVQGzOpebN9IBy1OsP8ojhB5R lp3zdHFUoVan4xgllEIsHSHtzU0+R1iAk4KooRPvAeZ+dkoWSIsMwOCNfQe7ZTNhWd JWe5s2HzDziC3lEQ8oCl8qbft/gkdaNBwat7F0naOj8I2n7mkIjjHksMvQiC9mdWzJ P0ZVljS2gxytnk/WdHsOqgCLdyVc87zG+Q5DHpFouev6aJa+YF7TPZI1fTyqDyVSQN qWxmnQsep/wOA== From: alexs@kernel.org To: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, willy@infradead.org, izik.eidus@ravellosystems.com Cc: "Alex Shi (tencent)" , David Hildenbrand Subject: [PATCH 2/4] mm/ksm: rename variable mm_slot to ksm_slot in unmerge_and_remove_all_rmap_items Date: Sun, 28 Apr 2024 18:06:16 +0800 Message-ID: <20240428100619.3332036-2-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240428100619.3332036-1-alexs@kernel.org> References: <20240428100619.3332036-1-alexs@kernel.org> MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Stat-Signature: 41mgeczdrm6449ie9rgk9orpj9gdb7kc X-Rspam-User: X-Rspamd-Queue-Id: 613331C0002 X-HE-Tag: 1714298589-797368 X-HE-Meta: U2FsdGVkX1+wuTle/xhdXSBVj5LuxlDdYS3S1d5h95tNmYF59MEAek7IQVAQ72JldMK2qSIQfMOG6VwGBi9wMpdmMvJewVg6HkXKiu0ascrVKFolrLCqM8cs/TMmhOdonKyDrxemiabn+3i182pFeVZGcIw/ZkPmSNLfF0P7prwjijwwQIZ6TbwbkgzqGjl5rpojFKS9BpNFdgOmv+7Yuy1bVx0Zwm7uOhE3z48U6wrLWz0AjKnY6LLKqJ9Uw0JVcIaz1Fb9FtmMD3uFM9Me26E5IhAM58PgraFF+qNnYajB6WKPM0UFzPd1Cfg+yjg78r5rncdcDoVrlMxIujgm9MWVrpbUzAAD+rjyZxk1OlbATBC2ZEJX8EWgzCpYGoCznI6kfO0bGTXTwmDgXLgIlwkpn3y5h/vYRx2GTmbX7celkZ1rulCixAUekw6mEDdJ79fc+pzaSBexYqQ8ZLhuFBgYhwgVohhnwaFwtNsK7vuTxuGgSRgUbmfb26hcCIkTV/QF/MIIxgVFI/0HFENN2WOnosoZkL7VQfGl4/4X08qJXUa4ox7zGNxTXeHjAak4fCO6KxUHnFGzhJJTuKaMfRp0dsv/omELEZeEQ2RDdOB8FpFvnX7tZ2OfHF+9niQUU0HSsizO5f6X3u94gUgS0/Wpfr5QmCuKZFM22JtVxoFMziyLnNFfYBJxf5vgrYtQg0WoczAPbl/VYzrjq+nfA8bFwsaBiA9flL17ChWWddJrEqoKNOE4bbLV7I5VjvZGCwoS7QTNVPd8viRG4ZYIPPCHWe6a+bC4BD8j3WYVzlrHZ8doXnaCdzHe86QLCLOk3Wx02mtUsyo5h+di8PtV8iYN1zJQJguLuVIXuLL+Va1HZOV+lhfS1ppqgOEFxB3VUMHNqU9aSskk8wkI+b/+Wj9Z/efZSf5rpj8RmA8c/0TK01ixVo43V8cBvL3SNhYk1Q6uuhHstj51EzzO10M 6D0uiVuW exHtm2FfQYnhZ3h4JnrNliG0bzQ2MdEmwwE8crqivctVHkToRswmUHj7TQvzkjywz2PBpCfEc1z4DJX0I2VsP5ILzEVnuUj0nVmzrHjgJflU+buAtcdzN+2qkMG9/TZeJzEfPvI/bL6YHWJqea8iLm8goGZkzITa/38yPi/FZJqlmhrRwLkWzT3kBfJFXbxgge2jWT7QootqzkNDW4LH7kuVpxkcYek5cRg/46yQhGQExxwRO1sJZC/jhI/G6zwzBTpFyJTq4Aef6EAsApPUtvPz5bqAnp404I0H5wbrW6dTEo33I+YnhOdijVA== 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: List-Subscribe: List-Unsubscribe: From: "Alex Shi (tencent)" To distinguish ksm_mm_slot and mm_slot for better code readability, rename ksm_mm_slot variable as ksm_slot in function unmerge_and_remove_all_rmap_items. No function changes. Signed-off-by: Alex Shi (tencent) Cc: David Hildenbrand --- mm/ksm.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index d2c4eb98816d..6efa33c48381 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -1196,7 +1196,7 @@ static int remove_all_stable_nodes(void) static int unmerge_and_remove_all_rmap_items(void) { - struct ksm_mm_slot *mm_slot; + struct ksm_mm_slot *ksm_slot; struct mm_slot *slot; struct mm_struct *mm; struct vm_area_struct *vma; @@ -1208,11 +1208,11 @@ static int unmerge_and_remove_all_rmap_items(void) ksm_scan.ksm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); spin_unlock(&ksm_mmlist_lock); - for (mm_slot = ksm_scan.ksm_slot; mm_slot != &ksm_mm_head; - mm_slot = ksm_scan.ksm_slot) { - VMA_ITERATOR(vmi, mm_slot->slot.mm, 0); + for (ksm_slot = ksm_scan.ksm_slot; ksm_slot != &ksm_mm_head; + ksm_slot = ksm_scan.ksm_slot) { + VMA_ITERATOR(vmi, ksm_slot->slot.mm, 0); - mm = mm_slot->slot.mm; + mm = ksm_slot->slot.mm; mmap_read_lock(mm); /* @@ -1232,19 +1232,19 @@ static int unmerge_and_remove_all_rmap_items(void) } mm_exiting: - remove_trailing_rmap_items(&mm_slot->rmap_list); + remove_trailing_rmap_items(&ksm_slot->rmap_list); mmap_read_unlock(mm); spin_lock(&ksm_mmlist_lock); - slot = list_entry(mm_slot->slot.mm_node.next, + slot = list_entry(ksm_slot->slot.mm_node.next, struct mm_slot, mm_node); ksm_scan.ksm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); if (ksm_test_exit(mm)) { - hash_del(&mm_slot->slot.hash); - list_del(&mm_slot->slot.mm_node); + hash_del(&ksm_slot->slot.hash); + list_del(&ksm_slot->slot.mm_node); spin_unlock(&ksm_mmlist_lock); - mm_slot_free(mm_slot_cache, mm_slot); + mm_slot_free(mm_slot_cache, ksm_slot); clear_bit(MMF_VM_MERGEABLE, &mm->flags); clear_bit(MMF_VM_MERGE_ANY, &mm->flags); mmdrop(mm);