linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: Wei Yang <richard.weiyang@gmail.com>
Cc: akpm@linux-foundation.org, linux-mm@kvack.org,
	Lorenzo Stoakes <lorenzo.stoakes@oracle.com>,
	Rik van Riel <riel@surriel.com>,
	"Liam R . Howlett" <Liam.Howlett@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	Harry Yoo <harry.yoo@oracle.com>
Subject: Re: [PATCH 2/3] selftests/mm: put general ksm operation into vm_util
Date: Thu, 17 Jul 2025 13:56:52 +0200	[thread overview]
Message-ID: <b6f92aca-83eb-470e-8675-b2c79ae6efcd@redhat.com> (raw)
In-Reply-To: <20250717024504.3b4q3i6uuzd4nr2w@master>


> My plan is there are two pairs of helper:
> 
>      ksm_merge()  <->  ksm_unmerge()
>      ksm_start_and_merge() <-> ksm_stop_and_unmerge()
> 
>> Probably we should just use ksm_stop_and_unmerge() and remove ksm_unmerge().
>>
> 
> Looks reasonable, will remove it.
> 
> So how about leave three helpers:
> 
>     ksm_merge()
>     ksm_start()
>     ksm_stop_and_unmerge()
> 
> Would this be better?

Is there utility for separating ksm_start() and ksm_merge() in current 
code and with what you are intending to do?

>>> +
>>> +int ksm_stop_and_unmerge()
>>> +{
>>> +	int ksm_fd;
>>> +	ssize_t ret;
>>> +
>>> +	ksm_fd = open("/sys/kernel/mm/ksm/run", O_RDWR);
>>> +	if (ksm_fd < 0)
>>> +		return -1;
>>> +
>>> +	ret = write(ksm_fd, "2", 1);
>>> +	close(ksm_fd);
>>> +	return ret == 1 ?  0 : ret;
>>
>> double space
>>
> 
> Shame on me :-(

Not the end of the world ;)

-- 
Cheers,

David / dhildenb



  parent reply	other threads:[~2025-07-17 11:57 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-16  8:27 [PATCH 0/3] selftests/mm: assert rmap behave as expected Wei Yang
2025-07-16  8:27 ` [PATCH 1/3] selftests/mm: check a valid fd with negative value Wei Yang
2025-07-16  8:52   ` David Hildenbrand
2025-07-17  1:18     ` Wei Yang
2025-07-17  8:27       ` David Hildenbrand
2025-07-16  8:27 ` [PATCH 2/3] selftests/mm: put general ksm operation into vm_util Wei Yang
2025-07-16  9:20   ` David Hildenbrand
2025-07-17  2:45     ` Wei Yang
2025-07-17  3:30       ` Wei Yang
2025-07-17 11:57         ` David Hildenbrand
2025-07-17 11:56       ` David Hildenbrand [this message]
2025-07-16  8:27 ` [PATCH 3/3] selftests/mm: assert rmap behave as expected Wei Yang
2025-07-16 13:34   ` David Hildenbrand
2025-07-17  3:17     ` Wei Yang
2025-07-25  2:16       ` Wei Yang
2025-07-25 13:34         ` David Hildenbrand

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=b6f92aca-83eb-470e-8675-b2c79ae6efcd@redhat.com \
    --to=david@redhat.com \
    --cc=Liam.Howlett@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=harry.yoo@oracle.com \
    --cc=linux-mm@kvack.org \
    --cc=lorenzo.stoakes@oracle.com \
    --cc=richard.weiyang@gmail.com \
    --cc=riel@surriel.com \
    --cc=vbabka@suse.cz \
    /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;
as well as URLs for NNTP newsgroup(s).