mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: alexs@kernel.org, Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	willy@infradead.org, izik.eidus@ravellosystems.com
Subject: Re: [PATCH 1/4] mm/ksm: rename mm_slot members to ksm_slot for better readability.
Date: Tue, 30 Apr 2024 14:53:48 +0200	[thread overview]
Message-ID: <24688466-6815-4aac-a8b9-4373a534727f@redhat.com> (raw)
In-Reply-To: <20240428100619.3332036-1-alexs@kernel.org>

On 28.04.24 12:06, alexs@kernel.org wrote:
> From: "Alex Shi (tencent)" <alexs@kernel.org>
> 
> 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) <alexs@kernel.org>
> Cc: David Hildenbrand <david@redhat.com>

[...]

>   	}
>   	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);

And at this point I am not sure this is the right decision. You made 
that line more confusing.

Quite some churn for little (no?) benefit.


-- 
Cheers,

David / dhildenb


      parent reply	other threads:[~2024-04-30 12:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-28 10:06 alexs
2024-04-28 10:06 ` [PATCH 2/4] mm/ksm: rename variable mm_slot to ksm_slot in unmerge_and_remove_all_rmap_items alexs
2024-04-28 10:06 ` [PATCH 3/4] mm/ksm: rename mm_slot_cache to ksm_slot_cache alexs
2024-04-30 12:57   ` David Hildenbrand
2024-05-16 12:15     ` Alex Shi
2024-05-22 11:49       ` David Hildenbrand
2024-04-28 10:06 ` [PATCH 4/4] mm/ksm: rename mm_slot for get_next_rmap_item alexs
2024-04-30 12:53 ` David Hildenbrand [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=24688466-6815-4aac-a8b9-4373a534727f@redhat.com \
    --to=david@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=alexs@kernel.org \
    --cc=izik.eidus@ravellosystems.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®