linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Honggyu Kim <honggyu.kim@sk.com>
To: SeongJae Park <sj@kernel.org>
Cc: kernel_team@skhynix.com, damon@lists.linux.dev,
	Andrew Morton <akpm@linux-foundation.org>,
	linux-mm@kvack.org, Yunjeong Mun <yunjeong.mun@sk.com>
Subject: Re: [PATCH 1/3] mm/damon: do not allow creating zero size region
Date: Fri, 27 Jun 2025 20:29:18 +0900	[thread overview]
Message-ID: <c1b4b514-1629-40f5-88db-00353606ea22@sk.com> (raw)
In-Reply-To: <20250626152713.333339-1-sj@kernel.org>

Hi SeongJae,

On 6/27/2025 12:27 AM, SeongJae Park wrote:
> On Thu, 26 Jun 2025 07:24:14 +0900 Honggyu Kim <honggyu.kim@sk.com> wrote:
> 
>> Hi SeongJae,
>>
>> Sorry for the late response.
> 
> No worry!
> 
>> On 6/24/2025 3:03 AM, SeongJae Park wrote:
>>> On Mon, 23 Jun 2025 11:58:53 +0900 Honggyu Kim <honggyu.kim@sk.com> wrote:
> [...]
>>> I mean, something like below.
>>>
>>> @@ -1449,6 +1449,7 @@ static unsigned long damon_get_intervals_score(struct damon_ctx *c)
>>>                   }
>>>           }
>>>           target_access_events = max_access_events * goal_bp / 10000;
>>> +       target_access_events = target_access_events ? : 1;
>>>           return access_events * 10000 / target_access_events;
>>>    }
>>
>> I actually didn't mean the code, but just wondered if setting
>> "target_access_events" to 1 makes sense in this context.
>>
>> I now think that it doesn't make any difference because applying DAMOS actions
>> to zero size regions as it's just no-ops.  So I can take your change.
> 
> Thank you for clarifying, looking forward to your fix! :)

Will send it within a few days.  Thanks for your patience.

> 
> [...]
>>> I still prefer fixing the found bug on the spot.  I don't think having zero or
>>> negative size regions is really somewhat we always prohibit.
>>
>> I can split "target_access_events" change patch from this regardless of this
>> with "Fixes" tag.
>>
>> But I don't get why you think zero size region is acceptable.  Do you see any
>> benefits or have special reasons allowing zero size regions?
> 
> In short, I don't anticipate special benefits of allowing zero size region.
> But that's smae to this change.
> 
> I even have small concern about this change.
> 
> This change might make people assume any damon_region would have non-zero
> positive size.  I think that's wrong assumption.  Any DAMON core and API caller
> code can set the start and the end addresses with arbitrary values.
> 
> I think making the assumption true could be beneficial since it will help
> writing code with less corner cases.  But to make the assumption true, we
> should first check if any existing code is violating it, and if any existing
> code that written with current assumption (region size can be zero) can be
> broken.  After that, we should also prevent future code violating it.
> 
> And if the assumption becomes truth, we get one more rule.  I, at least, prefer
> having as less rules as possible.  My taste may be weird, but this is my humble
> feeling and opinion.

I see.  You don't want to make breaking changes even in this case, then I can
leave it as is.  Thanks for the explanation!

Thanks,
Honggyu

> 
> 
> Thanks,
> SJ
> 
> [...]
> 



  reply	other threads:[~2025-06-27 11:29 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-22 12:09 [PATCH 0/3] mm/damon: Enhance damon and its samples Honggyu Kim
2025-06-22 12:09 ` [PATCH 1/3] mm/damon: do not allow creating zero size region Honggyu Kim
2025-06-22 16:04   ` SeongJae Park
2025-06-23  2:58     ` Honggyu Kim
2025-06-23 18:03       ` SeongJae Park
2025-06-25 22:24         ` Honggyu Kim
2025-06-26 15:27           ` SeongJae Park
2025-06-27 11:29             ` Honggyu Kim [this message]
2025-06-22 12:09 ` [PATCH 2/3] samples/damon: change enable parameters to enabled Honggyu Kim
2025-06-22 16:14   ` SeongJae Park
2025-06-23  3:04     ` Honggyu Kim
2025-06-22 12:09 ` [PATCH 3/3] samples/damon: fix bugs for damon sample for start failures Honggyu Kim
2025-06-22 16:29   ` SeongJae Park
2025-06-23  3:16     ` Honggyu Kim
2025-06-23 18:11       ` SeongJae Park
2025-06-25 22:27         ` Honggyu Kim
2025-06-26 15:28           ` SeongJae Park

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=c1b4b514-1629-40f5-88db-00353606ea22@sk.com \
    --to=honggyu.kim@sk.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=kernel_team@skhynix.com \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.org \
    --cc=yunjeong.mun@sk.com \
    /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