From patchwork Sun Apr 28 10:06:15 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: 13645976 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 E83E9C4345F for ; Sun, 28 Apr 2024 10:03:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 1EFB06B0087; Sun, 28 Apr 2024 06:03:14 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1A1C06B0088; Sun, 28 Apr 2024 06:03:14 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F35B66B0089; Sun, 28 Apr 2024 06:03:13 -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 D45AC6B0087 for ; Sun, 28 Apr 2024 06:03:13 -0400 (EDT) Received: from smtpin17.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay02.hostedemail.com (Postfix) with ESMTP id 6797B120E1E for ; Sun, 28 Apr 2024 10:03:11 +0000 (UTC) X-FDA: 82058502582.17.FEEF1CB Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by imf02.hostedemail.com (Postfix) with ESMTP id 58EDB8000B for ; Sun, 28 Apr 2024 10:03:08 +0000 (UTC) Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=svEjzXYQ; spf=pass (imf02.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714298590; a=rsa-sha256; cv=none; b=PgmF8/csQx6/SL6Uf6Gy3Xk95F3sVGGVC/uzP4meOPvxkpPgC2zloOh4mLlGTBLD+I7lM2 9oFWavpOPBo2ce4sZ39ie+q6eWTRCJ9pq4Y4kzEIZKf2bRFXqjV7V3WZ9DrXSo136u1VKg THcEjF9AAiVaL9taNZ3HP4LzLGte1uw= ARC-Authentication-Results: i=1; imf02.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=svEjzXYQ; spf=pass (imf02.hostedemail.com: domain of alexs@kernel.org designates 145.40.73.55 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714298590; 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=19N+NWSQcEOwgwXo00Qxt0YAxPspAmBgr0IM0ASXgoU=; b=WhEARuDiUhNMkAlHaUp8LFtZMMqWu3WiL0Zlj1B5NgTFswzXFxtGI/dBIihD0/PAxR2PcK azriUInIVwV9HVma1jmCIPwCduyJNWLdZxSC2I65nEqMNuc4rOODkm81qcYTYBKqz3aT23 LawU1CmFwGmV1fVoE0ZslEQEX7fuFQI= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by sin.source.kernel.org (Postfix) with ESMTP id CF865CE0185; Sun, 28 Apr 2024 10:03:04 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A0D9AC113CC; Sun, 28 Apr 2024 10:03:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714298583; bh=HHMumcOA0H9IUBHkmzzjX+ZWQGYMXSboQb1ob6VnGX0=; h=From:To:Cc:Subject:Date:From; b=svEjzXYQEbgXg3LvM1M3DpRi706lXfPWsUc9ig1+xRxOLV/8FiH50xiTLPkEjm/zQ sOrixVduy/1RS3bGAkpgM+rL/3H9zErUBN4f4ndGalpE/VoHe+EACMAKWf6I5q7BZT HQEUg4vEiSZaUxgQn5052xdW3M6qvFmfQywYvFeDaWBf9jIRz+52oi85sN5FiHzSJv XMy8wKI008t/us8P1Om08taBdd7ts4IjF83eA8mPmEqdJlG5CGoZHQi/L+Gapqgcjf Xecu3YuZ/Cbnd+/n5h3AL7XfM9Bph9z7fiFugJDiJm3kDjoD91/IisPbXOODrr53ox aXGkgid45qLPA== 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 1/4] mm/ksm: rename mm_slot members to ksm_slot for better readability. Date: Sun, 28 Apr 2024 18:06:15 +0800 Message-ID: <20240428100619.3332036-1-alexs@kernel.org> X-Mailer: git-send-email 2.43.0 MIME-Version: 1.0 X-Stat-Signature: k7pkdqejp88yz1j4moiu5nbbnbojykqk X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 58EDB8000B X-HE-Tag: 1714298588-532740 X-HE-Meta: U2FsdGVkX1+XQxMqZJP4WdesLbpK4cNy43vgXjySOsel9Apo7eHWwoPqSQ4PRHBWY8ppsf/Y2B5susv/qe0t24M2qIRVgX8jcuxN9jhKvrVMOFtZqc97jZe0t3BWf3tXW558MOGIFCoAV82gUwZGBvTFRTNBTa+ddM+/OSpeyrJAgjlEIJmR72CPeAjePCys+ojU2tXEHmMo4DWfZ5ldPLpemh0EZs95goLYHddFOxRSRaN8pfEoQSjHiN8PP/wMap2oP0BlT8bv4uZYaGDynAo2wH3OSf0AraH1cVoEfINJnJXnLu36IzPOPoCtbn5rEdo2wI4rA7w8ip0q0VSApRz7+aAuBzNKLfNjcIDKjupL9bUjTDsUhO09carsTwu1RHwtuMiEVCR7f2gCg/ifD2gV1fWmw5Qbiz2glVRBKkBRISdVxM6LzjPhkjngskg9M8ff/lqg68Ylxzc5fmgeqcNM4+aqPVQ2gwZLBl7YS17vpUFDu0uJZukZhiWSCIE4dJNmadySsnJbo79J+mHqtXlxDO+4OKkpESzwXMFVSFUZJNiMWgTHIfXMx2CIR8Xku0wgjbCFUMLZCcJcvoSwKDtUoRKbVOjYdnYKJglVdLRr3nEv34eBlKYL5sv05mOjXsPQYFV8uM0k0aWY35sUU86xBP0evIQAOP+szPW0QobfbzRDtbFJd/uOKbyH5Vpz4kU1I2Wid1SIl3ADoQfBb96NaJsNCHBWrZgUEt2asozdWshoFJc2YEcpy09AUR56Xir/bgDSE4M4gNGyd6mWwX/N2F2xvmgwys548bi/HS5iMVvadEni3iAe+ipehQwFvhcShy/z/JITOgvNsopvlRyPUm8CV+uCRjgP4g5NA/nim81SEaPjE0I6EUg/5lsAIZx79LygQEuMHcVHdhA1hIWwzM9buGANGEnQCIWnCb3wfj9tUm9X2Pvq/d41ddT4OKpx8Pj3RGloL4yo19t srNaM8Mv xMDOY 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)" mm_slot is a struct of mm, and ksm_mm_slot is named the same again in ksm_scan struct. Furthermore, the ksm_mm_slot pointer is named as mm_slot again in functions, beside with 'struct mm_slot' variable. That makes code readability pretty worse. struct ksm_mm_slot { struct mm_slot slot; ... }; struct ksm_scan { struct ksm_mm_slot *mm_slot; ... }; int __ksm_enter(struct mm_struct *mm) { struct ksm_mm_slot *mm_slot; struct mm_slot *slot; ... So let's rename the mm_slot member to ksm_slot in ksm_scan, and ksm_slot for ksm_mm_slot* type variables in functions to reduce this confusing. struct ksm_scan { - struct ksm_mm_slot *mm_slot; + struct ksm_mm_slot *ksm_slot; Signed-off-by: Alex Shi (tencent) Cc: David Hildenbrand --- mm/ksm.c | 84 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 486c9974f8e2..d2c4eb98816d 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -131,7 +131,7 @@ struct ksm_mm_slot { /** * struct ksm_scan - cursor for scanning - * @mm_slot: the current mm_slot we are scanning + * @ksm_slot: the current ksm_slot we are scanning * @address: the next address inside that to be scanned * @rmap_list: link to the next rmap to be scanned in the rmap_list * @seqnr: count of completed full scans (needed when removing unstable node) @@ -139,7 +139,7 @@ struct ksm_mm_slot { * There is only the one ksm_scan instance of this cursor structure. */ struct ksm_scan { - struct ksm_mm_slot *mm_slot; + struct ksm_mm_slot *ksm_slot; unsigned long address; struct ksm_rmap_item **rmap_list; unsigned long seqnr; @@ -187,7 +187,7 @@ struct ksm_stable_node { /** * struct ksm_rmap_item - reverse mapping item for virtual addresses - * @rmap_list: next rmap_item in mm_slot's singly-linked rmap_list + * @rmap_list: next rmap_item in ksm_slot's singly-linked rmap_list * @anon_vma: pointer to anon_vma for this mm,address, when in stable tree * @nid: NUMA node id of unstable tree in which linked (may not match page) * @mm: the memory structure this rmap_item is pointing into @@ -242,7 +242,7 @@ static struct ksm_mm_slot ksm_mm_head = { .slot.mm_node = LIST_HEAD_INIT(ksm_mm_head.slot.mm_node), }; static struct ksm_scan ksm_scan = { - .mm_slot = &ksm_mm_head, + .ksm_slot = &ksm_mm_head, }; static struct kmem_cache *rmap_item_cache; @@ -1205,11 +1205,11 @@ static int unmerge_and_remove_all_rmap_items(void) spin_lock(&ksm_mmlist_lock); slot = list_entry(ksm_mm_head.slot.mm_node.next, struct mm_slot, mm_node); - ksm_scan.mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); + ksm_scan.ksm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); spin_unlock(&ksm_mmlist_lock); - for (mm_slot = ksm_scan.mm_slot; mm_slot != &ksm_mm_head; - mm_slot = ksm_scan.mm_slot) { + 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); mm = mm_slot->slot.mm; @@ -1238,7 +1238,7 @@ static int unmerge_and_remove_all_rmap_items(void) spin_lock(&ksm_mmlist_lock); slot = list_entry(mm_slot->slot.mm_node.next, struct mm_slot, mm_node); - ksm_scan.mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); + 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); @@ -1260,7 +1260,7 @@ static int unmerge_and_remove_all_rmap_items(void) error: mmap_read_unlock(mm); spin_lock(&ksm_mmlist_lock); - ksm_scan.mm_slot = &ksm_mm_head; + ksm_scan.ksm_slot = &ksm_mm_head; spin_unlock(&ksm_mmlist_lock); return err; } @@ -2565,7 +2565,7 @@ static bool should_skip_rmap_item(struct page *page, static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) { struct mm_struct *mm; - struct ksm_mm_slot *mm_slot; + struct ksm_mm_slot *ksm_slot; struct mm_slot *slot; struct vm_area_struct *vma; struct ksm_rmap_item *rmap_item; @@ -2575,8 +2575,8 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) if (list_empty(&ksm_mm_head.slot.mm_node)) return NULL; - mm_slot = ksm_scan.mm_slot; - if (mm_slot == &ksm_mm_head) { + ksm_slot = ksm_scan.ksm_slot; + if (ksm_slot == &ksm_mm_head) { advisor_start_scan(); trace_ksm_start_scan(ksm_scan.seqnr, ksm_rmap_items); @@ -2616,23 +2616,23 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) root_unstable_tree[nid] = RB_ROOT; 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); - mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); - ksm_scan.mm_slot = mm_slot; + ksm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); + ksm_scan.ksm_slot = ksm_slot; spin_unlock(&ksm_mmlist_lock); /* * Although we tested list_empty() above, a racing __ksm_exit * of the last mm on the list may have removed it since then. */ - if (mm_slot == &ksm_mm_head) + if (ksm_slot == &ksm_mm_head) return NULL; next_mm: ksm_scan.address = 0; - ksm_scan.rmap_list = &mm_slot->rmap_list; + ksm_scan.rmap_list = &ksm_slot->rmap_list; } - slot = &mm_slot->slot; + slot = &ksm_slot->slot; mm = slot->mm; vma_iter_init(&vmi, mm, ksm_scan.address); @@ -2662,7 +2662,7 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) if (PageAnon(*page)) { flush_anon_page(vma, *page, ksm_scan.address); flush_dcache_page(*page); - rmap_item = get_next_rmap_item(mm_slot, + rmap_item = get_next_rmap_item(ksm_slot, ksm_scan.rmap_list, ksm_scan.address); if (rmap_item) { ksm_scan.rmap_list = @@ -2687,7 +2687,7 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) if (ksm_test_exit(mm)) { no_vmas: ksm_scan.address = 0; - ksm_scan.rmap_list = &mm_slot->rmap_list; + ksm_scan.rmap_list = &ksm_slot->rmap_list; } /* * Nuke all the rmap_items that are above this current rmap: @@ -2696,9 +2696,9 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) remove_trailing_rmap_items(ksm_scan.rmap_list); 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.mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); + ksm_scan.ksm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); if (ksm_scan.address == 0) { /* * We've completed a full scan of all vmas, holding mmap_lock @@ -2709,11 +2709,11 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) * or when all VM_MERGEABLE areas have been unmapped (and * mmap_lock then protects against race with MADV_MERGEABLE). */ - 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); mmap_read_unlock(mm); @@ -2725,14 +2725,14 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) * spin_unlock(&ksm_mmlist_lock) run, the "mm" may * already have been freed under us by __ksm_exit() * because the "mm_slot" is still hashed and - * ksm_scan.mm_slot doesn't point to it anymore. + * ksm_scan.ksm_slot doesn't point to it anymore. */ spin_unlock(&ksm_mmlist_lock); } /* Repeat until we've completed scanning the whole list */ - mm_slot = ksm_scan.mm_slot; - if (mm_slot != &ksm_mm_head) + ksm_slot = ksm_scan.ksm_slot; + if (ksm_slot != &ksm_mm_head) goto next_mm; advisor_stop_scan(); @@ -2968,15 +2968,15 @@ EXPORT_SYMBOL_GPL(ksm_madvise); int __ksm_enter(struct mm_struct *mm) { - struct ksm_mm_slot *mm_slot; + struct ksm_mm_slot *ksm_slot; struct mm_slot *slot; int needs_wakeup; - mm_slot = mm_slot_alloc(mm_slot_cache); - if (!mm_slot) + ksm_slot = mm_slot_alloc(mm_slot_cache); + if (!ksm_slot) return -ENOMEM; - slot = &mm_slot->slot; + slot = &ksm_slot->slot; /* Check ksm_run too? Would need tighter locking */ needs_wakeup = list_empty(&ksm_mm_head.slot.mm_node); @@ -2996,7 +2996,7 @@ int __ksm_enter(struct mm_struct *mm) if (ksm_run & KSM_RUN_UNMERGE) list_add_tail(&slot->mm_node, &ksm_mm_head.slot.mm_node); else - list_add_tail(&slot->mm_node, &ksm_scan.mm_slot->slot.mm_node); + list_add_tail(&slot->mm_node, &ksm_scan.ksm_slot->slot.mm_node); spin_unlock(&ksm_mmlist_lock); set_bit(MMF_VM_MERGEABLE, &mm->flags); @@ -3011,40 +3011,40 @@ int __ksm_enter(struct mm_struct *mm) void __ksm_exit(struct mm_struct *mm) { - struct ksm_mm_slot *mm_slot; + struct ksm_mm_slot *ksm_slot; struct mm_slot *slot; int easy_to_free = 0; /* * This process is exiting: if it's straightforward (as is the - * case when ksmd was never running), free mm_slot immediately. + * case when ksmd was never running), free ksm_slot immediately. * But if it's at the cursor or has rmap_items linked to it, use * mmap_lock to synchronize with any break_cows before pagetables - * are freed, and leave the mm_slot on the list for ksmd to free. + * are freed, and leave the ksm_slot on the list for ksmd to free. * Beware: ksm may already have noticed it exiting and freed the slot. */ spin_lock(&ksm_mmlist_lock); slot = mm_slot_lookup(mm_slots_hash, mm); - mm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); - if (mm_slot && ksm_scan.mm_slot != mm_slot) { - if (!mm_slot->rmap_list) { + ksm_slot = mm_slot_entry(slot, struct ksm_mm_slot, slot); + if (ksm_slot && ksm_scan.ksm_slot != ksm_slot) { + if (!ksm_slot->rmap_list) { hash_del(&slot->hash); list_del(&slot->mm_node); easy_to_free = 1; } else { list_move(&slot->mm_node, - &ksm_scan.mm_slot->slot.mm_node); + &ksm_scan.ksm_slot->slot.mm_node); } } spin_unlock(&ksm_mmlist_lock); if (easy_to_free) { - mm_slot_free(mm_slot_cache, mm_slot); + mm_slot_free(mm_slot_cache, ksm_slot); clear_bit(MMF_VM_MERGE_ANY, &mm->flags); clear_bit(MMF_VM_MERGEABLE, &mm->flags); mmdrop(mm); - } else if (mm_slot) { + } else if (ksm_slot) { mmap_write_lock(mm); mmap_write_unlock(mm); } 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); From patchwork Sun Apr 28 10:06:17 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: 13645974 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 2EAA4C4345F for ; Sun, 28 Apr 2024 10:03:11 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 635216B007B; Sun, 28 Apr 2024 06:03:10 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5E5186B0083; Sun, 28 Apr 2024 06:03:10 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4D3A16B0085; Sun, 28 Apr 2024 06:03:10 -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 30A646B007B for ; Sun, 28 Apr 2024 06:03:10 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C7F55C0DEE for ; Sun, 28 Apr 2024 10:03:09 +0000 (UTC) X-FDA: 82058502498.21.58E80A3 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf13.hostedemail.com (Postfix) with ESMTP id 249AD20020 for ; Sun, 28 Apr 2024 10:03:07 +0000 (UTC) Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qHZpaHQw; spf=pass (imf13.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714298588; 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=L/6asvpQHQObk8gQ+S6dZg1fuwSibuGKhGx5iJPkUOE=; b=e1RQbHwlCYCQQc+BGN8r8TgQ+RXB1QKjzZhYSm17PQ4DyhgsSpIEk9AzbI2fLxjhhPvEIw uE+ZP0sjZiSb4CCt9Ze+Gt2NhR2UgBJUIWL8YjXqr1v8FIsUuTRJ/w8c+yEFN6Ooce5IBQ jmpSfCNHt+xGfh7FoXJo+eqrMDCXUFs= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=qHZpaHQw; spf=pass (imf13.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714298588; a=rsa-sha256; cv=none; b=NTVxNnqpTTjg5aRABu6lXJPKR6RhP2mDJTg/+XhCgPXFHwWv54dyEMOv5+8XrodJ8eBFTL uTjNQ0dHlAxg07xzlUR7sQhJ4kpKO3xqmRkLgN3Uk7gMWTvLdNnYJbfP8ixEeN5rMUqs2V VdCeBgnAIAr6/o/bhXJFYcfCmxMcWS4= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0849560A69; Sun, 28 Apr 2024 10:03:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 853CFC113CC; Sun, 28 Apr 2024 10:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714298586; bh=6NaeJS6g/wwJcO+tv0UtdUMqIwpCmkMz82u9EWAXHVM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qHZpaHQw0NiprNOe28G7se+SVJiyPdlJhU8CWRJ2a4QNmIC/hl3c+5CHxEpr5DPsy IZj2AB4522Pf8x6xc4qTo49zUnsbWUAFKEp/EuP5FLntwsfwt2cNsfuNKHOAW3Bfdy C10rwXQTGeCtu/Y5WTkoo5e5iHLgnmGk5ccK/az25EZQK0Y6lc2eXXOGQivBvfe4Ph fVIP8CvUqtTo/RPZV07iQw08sF+mr471F1fuwmFRwfRGTlojYDAs9KVkK+c7VKc6yX CayzVw1bnbhu9cS0jjTBVL3xT16C1Pm5HrB/yBiGAbL5wXlz9NW5saTbpoTVhGHX9Y doazHpmYqihTQ== 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 3/4] mm/ksm: rename mm_slot_cache to ksm_slot_cache Date: Sun, 28 Apr 2024 18:06:17 +0800 Message-ID: <20240428100619.3332036-3-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-Stat-Signature: dd1fyi1cqn94ceumo68qxc4r8efbtqbz X-Rspamd-Queue-Id: 249AD20020 X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1714298587-165976 X-HE-Meta: U2FsdGVkX18FCdeo2s73TSOdYBSohzSkNvWdZe4/aMbKxOZ+gYgg04w8l8M3ffkNhU1b6Ddturtru1wQFTqBYFLfV8RgFug6p/35SzJPB9gj34j8LkVQpa8wt4wsVZKzIG7WSgJdX5d3yc571lNXqh8mm0b9b3FJJI5+84U7hOliOWrWVOVaYDXUJNZHBwjiB4S6+tJOWAMT4BPf84AGGAiiEbwqWw4iXQbju8/e4mPkP0Sd85509Ut7ar6fpycgiOqP402WxM7rSPbHhHeTcRqFAvv2U26/TMHc3RyPA4eJuVTJZkCv/bON7wuElpJIJjw4/9bRZlWNFtT0KYJQmosGqliMgZdw2aQNqq2qNIqL3vs1NHQ2iD7x0uh/v9zySX/De5HUe98EszfFddsniYbIcXQIQrtFdXuZ891XK8QW/HOzYKzzXt0ZX+9DaRDwG8SbHa7Jc8A8+pf/L1jSFffdJZC2zhsDP2blVl7GQ+S5IkEFYFVhj7ZjhGsuY/9m+3SFDvn1BeXe1yIwh0kfrvPV2zNPmYle9MyJqpP7p/oblT/MY55H1OlsHBNtfiT151+Nli3FnV8t9oC0zZgmC0MqcQCpXQf47i96e1LBXqkJ6gvWJ4WMSJcZMwFIzY4AOAC2Tq/rsnlqfVjIxRvqYRdt4HgO6FvWZpEfB+hYQSK8TQKcrFlK4j/RM1/retvXLfj9+9MoXJmH+kijLqhtkp/5j5kgNtE8ZXLGhKbUKKuQkA0GQnPmkYWxz21ZUnkLAtNKoRVyaFnl+iTCxDDrbw73Sz0uF1Q2GdQzKiGorQmdGKeLGxHZKTzAc20u9SPTajKk9DGkVLSwauWQ2vlE0OWy8OKivIvUbs9QPcIBLlsB3HNQloNplX+uoWMu0dW8IXDtZtbPVUEX0Q5Kq5XP9KgMpZY41NTLrXsoh9gWfvh7G52KBvoEwPx8H3T5Wo8JD/7dN1TGJ+O5u7sUgca TROqbpGM JODXXolv/fVuan6RGHdiwmqItzAT/MpSHK+5lSSKlnsFgCFNzpoetLsLjZELemDysW5xYNZhZBTidXo+q3lOfCc5ltS9gxB7ZZ53G7RgA/VvJO822DiDnHMHmEoufQxNCEkNLw5SXR9zyFrVqhFqecfI6B5/vZt/FvD6GT92Ro0ODqMCk6C3KQJqD/TGGs16a8NJsUwC2miOkc3aM4TaYGVxzlglNhX57rOnT7fe5Zs9E+7Fj6OiD0tNKFQlNK0+D3z6LUQYFrmYAZKBsWxQfFfBVDOFVJ1rHBaBWFFzWHK6cgx2+paimgIcu1Q== 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 mm_slot_cache as ksm_slot_cache. No function change. Signed-off-by: Alex Shi (tencent) Cc: David Hildenbrand --- mm/ksm.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 6efa33c48381..22d2132f83a4 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -247,7 +247,7 @@ static struct ksm_scan ksm_scan = { static struct kmem_cache *rmap_item_cache; static struct kmem_cache *stable_node_cache; -static struct kmem_cache *mm_slot_cache; +static struct kmem_cache *ksm_slot_cache; /* Default number of pages to scan per batch */ #define DEFAULT_PAGES_TO_SCAN 100 @@ -502,8 +502,8 @@ static int __init ksm_slab_init(void) if (!stable_node_cache) goto out_free1; - mm_slot_cache = KSM_KMEM_CACHE(ksm_mm_slot, 0); - if (!mm_slot_cache) + ksm_slot_cache = KSM_KMEM_CACHE(ksm_mm_slot, 0); + if (!ksm_slot_cache) goto out_free2; return 0; @@ -518,10 +518,10 @@ static int __init ksm_slab_init(void) static void __init ksm_slab_free(void) { - kmem_cache_destroy(mm_slot_cache); + kmem_cache_destroy(ksm_slot_cache); kmem_cache_destroy(stable_node_cache); kmem_cache_destroy(rmap_item_cache); - mm_slot_cache = NULL; + ksm_slot_cache = NULL; } static __always_inline bool is_stable_node_chain(struct ksm_stable_node *chain) @@ -1244,7 +1244,7 @@ static int unmerge_and_remove_all_rmap_items(void) list_del(&ksm_slot->slot.mm_node); spin_unlock(&ksm_mmlist_lock); - mm_slot_free(mm_slot_cache, ksm_slot); + mm_slot_free(ksm_slot_cache, ksm_slot); clear_bit(MMF_VM_MERGEABLE, &mm->flags); clear_bit(MMF_VM_MERGE_ANY, &mm->flags); mmdrop(mm); @@ -2713,7 +2713,7 @@ static struct ksm_rmap_item *scan_get_next_rmap_item(struct page **page) list_del(&ksm_slot->slot.mm_node); spin_unlock(&ksm_mmlist_lock); - mm_slot_free(mm_slot_cache, ksm_slot); + mm_slot_free(ksm_slot_cache, ksm_slot); clear_bit(MMF_VM_MERGEABLE, &mm->flags); clear_bit(MMF_VM_MERGE_ANY, &mm->flags); mmap_read_unlock(mm); @@ -2972,7 +2972,7 @@ int __ksm_enter(struct mm_struct *mm) struct mm_slot *slot; int needs_wakeup; - ksm_slot = mm_slot_alloc(mm_slot_cache); + ksm_slot = mm_slot_alloc(ksm_slot_cache); if (!ksm_slot) return -ENOMEM; @@ -3040,7 +3040,7 @@ void __ksm_exit(struct mm_struct *mm) spin_unlock(&ksm_mmlist_lock); if (easy_to_free) { - mm_slot_free(mm_slot_cache, ksm_slot); + mm_slot_free(ksm_slot_cache, ksm_slot); clear_bit(MMF_VM_MERGE_ANY, &mm->flags); clear_bit(MMF_VM_MERGEABLE, &mm->flags); mmdrop(mm); From patchwork Sun Apr 28 10:06:18 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: 13645977 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 CB7BFC4345F for ; Sun, 28 Apr 2024 10:03:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DA446B008A; Sun, 28 Apr 2024 06:03:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 486DA6B008C; Sun, 28 Apr 2024 06:03:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 326FF6B0092; Sun, 28 Apr 2024 06:03:21 -0400 (EDT) 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 135FC6B008A for ; Sun, 28 Apr 2024 06:03:21 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 8665E1602D8 for ; Sun, 28 Apr 2024 10:03:20 +0000 (UTC) X-FDA: 82058502960.05.645CD53 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf10.hostedemail.com (Postfix) with ESMTP id 00005C0018 for ; Sun, 28 Apr 2024 10:03:09 +0000 (UTC) Authentication-Results: imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KO5K1UOv; spf=pass (imf10.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1714298590; 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=JSrxJj62mYg3e7qfKz/0h2H2L9PblZ4aheMBBURYagM=; b=tPP1MbyOSfKI5MO+3wVOR4Y8ovw+bwCBdFXCM9yeTw/Bml2RwI5XJwTLoLr/gv/8WBL2wK B4ORKh3MJjOl6XAggUy+JLJ9MpryiRLlsKEVaMrMnSIieOowTxTsSgKdSHOshhHcjxlxvg h0n7WSS11dxhHEq5+PxwQMDmkGEGqiM= ARC-Authentication-Results: i=1; imf10.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=KO5K1UOv; spf=pass (imf10.hostedemail.com: domain of alexs@kernel.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=alexs@kernel.org; dmarc=pass (policy=none) header.from=kernel.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1714298590; a=rsa-sha256; cv=none; b=RwudX0szuQY+aoVgxcNPEnaKD5Jf5asiqjawvbeX4tltJ21EOumzMfCBMWG4eYf1Bxo2aV x4c4Gv9Gndi5WTxWWpNX76P3i8yKpoX5RVSBbjpkPGVtLI2XVGqg63et4COefsz+BvztKW Sq2Tp1GHkrfFPcDXHdGdq+2UDXxn+cc= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 0F8D960A29; Sun, 28 Apr 2024 10:03:09 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 6276BC113CC; Sun, 28 Apr 2024 10:03:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1714298588; bh=Uzl73+0oYcqvZx1LI81e5vJnRXOSv47I6sL1y4jODW0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=KO5K1UOv2oq/q3c2ouC7bsIp40DeLYo95z/jC2RvcvRtkLvS32NMSVxDRoIH3yH9O Ah9ULQOgyIMFL0Lg7O2uKT7+bUkojFyvyVqS5myzchwzmGedUOQxXhVk2Lo0e4q7YV 3DNhU5ldZhc9OZcfcgcnHJrQZ/LH3dE6fZ2YX6IoF8uPahFswX6BdI+DS3vIk0pnys R65yImyWxmwwxH6kOOw7I9g+tKMB9hJoBJPRYMiX73kJLxz3WdRHLHrejMYJfHwS/u Y7DZOxGAF8OuDNeAw9u0duoiUV4hc8uiKohzWRiYk8s+tnOncrcwyox/MHBnr6voD3 023S30vVPlv4g== 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 4/4] mm/ksm: rename mm_slot for get_next_rmap_item Date: Sun, 28 Apr 2024 18:06:18 +0800 Message-ID: <20240428100619.3332036-4-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-Stat-Signature: q47bqdr5ufqtg6oek44f87h48tjxfpds X-Rspamd-Queue-Id: 00005C0018 X-Rspamd-Server: rspam10 X-Rspam-User: X-HE-Tag: 1714298589-973043 X-HE-Meta: U2FsdGVkX1/fD7m2PLxSZIBF9Hz7CGXLxXHct8lHWWawaYIusOKBBSxJBCxXGDDB8qEwpb1PQsr9SIF6348LmKjtGpQEc5fWECs4xyUAcQTNW08uEw+Y4RsPZpWJnr009c8WgBYSxAnLyELo+xYgRAWgpCF34cyDj2ZkhrXGpJ5QjCLZoI1Ux/HnQcWydSh6ka2WBrTljDPcpUj82+Qcx3sxViOd2yJMIr3ufeivOz6LTnuO3TKTVnkyYxlUeJdOzIJH5RqDZXLcKfgrf7TukOh2rGMZy3hOv5amHbRbnNlKWdd7VeFsuhneK4Z101ZZmSj4HM2x5EbHYo6oQ46v50U794TyUpemQ7iVOXmwJtsjLSw0Q0HJfo/v8O5LirPL14vnRn/ODp+aZf3BE4rn13wlL7DGDYepmuyYZiVyZ/u6Jqr75FeVPSuMbqHz+czCOcfm8/dfiGL9vBELY4MHLM+3aNweDonDgrWzhuasjMzC4ZJ4YEzu6h8wbiid37WgkDHmjl5vV6q6ByLkfWFAWSIvpEHpI+TsB2tY7ZKPIUiqbAwqbZfRb1yR1MQ6PawdT8K5TMfhBjohmH6hbKCJjYfAfebGasWDerXbTf9kbgVLd9K+vPvdbQPaNONdAKVCV71MATrIudsXC8W65WwoT6luoa9VEgcL0A9Py1H7Mvc6UDLkuahypikZh+D7Jll7DRZOZxnRAYsNj1gPi7hAlGYfeJ3GPsyMvzzf50CLI6iaVJFqoIORcN7vvCvVvX6jLdE+On4u3Engf1HWKZjfGTyE07aZHqqUCPugQbkzCMCbrlRm59jK9FfWisqiyx1QnWD7AEcDjEdxmR7UgB2Z195lXF86RUbtyqFlNxbz4ExTwOHFEcSNRuGVUC5UpVdO18KsI6lIrObz7z+5TsbW+EyA3oe74cqy8m0lBScZTMzyjeqkCU7Whp2eB24DiXuhyK2sjI2vmkQorbh86iV VoEyh2re Zf4cZIkIq69e0kje3VRJ+UlV7XasL796ulFR1tD5nCcFfq4ISlIjGqMlsY5aOxg7oeCODb5FoJjCzlSNSNCqHkm79uhpsLSZt0rfcymxuRLzFrbxzbuS0lGb9K0fNohaRPFi9Bjad032vv7hZcisFKpU60iJqTG3uFFvTSoMLRLBfKs7eOJO7i9NFCqVLWzUv0zfRPyDRDUFp6p2MOWsnD9tFSnUTLAKzg8iGOeDvvUvwTW8o5SSMBlunt2KYSu4qGIfiCCWi3HNPvLJufB8phmrgyCRBA5G1IuEkF3g0jeDzfn7F4n7aKPv5Wg== 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 parameter "struct ksm_mm_slot *mm_slot", as "struct ksm_mm_slot *ksm_slot". No function change. Signed-off-by: Alex Shi (tencent) Cc: David Hildenbrand --- mm/ksm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mm/ksm.c b/mm/ksm.c index 22d2132f83a4..2d10f1aef123 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -2465,7 +2465,7 @@ static void cmp_and_merge_page(struct page *page, struct ksm_rmap_item *rmap_ite } } -static struct ksm_rmap_item *get_next_rmap_item(struct ksm_mm_slot *mm_slot, +static struct ksm_rmap_item *get_next_rmap_item(struct ksm_mm_slot *ksm_slot, struct ksm_rmap_item **rmap_list, unsigned long addr) { @@ -2485,7 +2485,7 @@ static struct ksm_rmap_item *get_next_rmap_item(struct ksm_mm_slot *mm_slot, rmap_item = alloc_rmap_item(); if (rmap_item) { /* It has already been zeroed */ - rmap_item->mm = mm_slot->slot.mm; + rmap_item->mm = ksm_slot->slot.mm; rmap_item->mm->ksm_rmap_items++; rmap_item->address = addr; rmap_item->rmap_list = *rmap_list;