linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Usama Arif <usamaarif642@gmail.com>
To: SeongJae Park <sj@kernel.org>
Cc: David Hildenbrand <david@redhat.com>,
	akpm@linux-foundation.org, damon@lists.linux.dev,
	linux-mm@kvack.org
Subject: Re: [PATCH v3 2/2] mm/damon: introduce DAMOS filter type hugepage
Date: Mon, 20 Jan 2025 20:26:02 +0000	[thread overview]
Message-ID: <db16fc35-58e7-453d-9fbb-318a88a98cd1@gmail.com> (raw)
In-Reply-To: <20250120201214.39533-1-sj@kernel.org>



On 20/01/2025 20:12, SeongJae Park wrote:
> On Mon, 20 Jan 2025 19:58:24 +0000 Usama Arif <usamaarif642@gmail.com> wrote:
> 
>>
>>
>> On 20/01/2025 19:30, SeongJae Park wrote:
>>> On Mon, 20 Jan 2025 20:23:20 +0100 David Hildenbrand <david@redhat.com> wrote:
>>>
>>>> On 20.01.25 20:16, SeongJae Park wrote:
>>>>> On Mon, 20 Jan 2025 19:57:10 +0100 David Hildenbrand <david@redhat.com> wrote:
>>>>>
>>>>>> On 20.01.25 19:19, Usama Arif wrote:
>>> [...]
>>>>>>> +#if defined(CONFIG_PGTABLE_HAS_HUGE_LEAVES)
>>>>>>> +	case DAMOS_FILTER_TYPE_HUGEPAGE:
>>>>>>> +		matched = folio_size(folio) == HPAGE_PMD_SIZE;
>>>>>>
>>>>>>
>>>>>> Can we directly embed in the name and the comments/docs that we are only
>>>>>> talking about PMD size (both, THP and hugetlb)?
>>>>>>
>>>>>> DAMOS_FILTER_TYPE_PMD_HUGEPAGE or sth. like that.
>>>>>
>>>>> Nice suggestion, thank you!  And we might later add more filter types for
>>>>> different size huge pages.  What about extending this to handle more general
>>>>> case, though?  That is, we can let the filter receives a range of the folio
>>>>> size to match, like DAMOS_FILTER_TYPE_ADDR does.  Then, the filter could be
>>>>> used for any size of interest.
>>>>
>>>> That would probably be future proof: either a range or explicitly 
>>>> specified sizes (ranges?).
>>>
>>> DAMON supports installing multiple DAMOS filters.  So multiple DAMOS filters
>>> that each matching single range can be used for the multiple sizes or ranges
>>> use case.
>>>
>>>
>>
>> Does creating something like schemes/<N>/access_pattern/page_size/{min,max}
>> sound good? with the default value being pmd size?
> 
> For user-space ABI, like DAMOS_FILTER_TYPE_ADDR, let's use
> 'schemes/<N>/filters/<F>/' directory.  File names 'min' and 'max' look good to
> me.
> 
> For kernel-space API, again, like DAMOS_FILTER_TYPE_ADDR, let's use the union
> in 'struct damos_filter'.
> 
> If you will do the extension together with this patch, I think the default
> value is not really needed.  It will only add a bit of complexity.  So if you
> will do so, I'd recommend not having the default value.
> 
> Also, if you will revise this patch series for the extension, could you please
> split and post the first patch of this series as a separate one?  I think the
> fix is important and has no reason to be tied with this patch.
> 

Yeah I think it might be best if we get a version with flexible folio sizes merged
from the start, especially as it involves creating user ABI. I will try and send
something tomorrow.

For the first patch, do I need to resend? Or maybe Andrew could merge whats in
this v3 for patch 1, we discard patch 2 and I just send the hugepage
filter implementation separately as a new series..


  reply	other threads:[~2025-01-20 20:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-20 18:19 [PATCH v3 1/2] mm/damon: have damon_get_folio return folio even for tail pages Usama Arif
2025-01-20 18:19 ` [PATCH v3 2/2] mm/damon: introduce DAMOS filter type hugepage Usama Arif
2025-01-20 18:33   ` SeongJae Park
2025-01-20 18:57   ` David Hildenbrand
2025-01-20 19:16     ` SeongJae Park
2025-01-20 19:23       ` David Hildenbrand
2025-01-20 19:30         ` SeongJae Park
2025-01-20 19:58           ` Usama Arif
2025-01-20 20:03             ` David Hildenbrand
2025-01-21 17:52               ` SeongJae Park
2025-01-21 18:39                 ` David Hildenbrand
2025-01-21 20:05                   ` SeongJae Park
2025-01-20 20:12             ` SeongJae Park
2025-01-20 20:26               ` Usama Arif [this message]
2025-01-20 20:48                 ` SeongJae Park
2025-01-20 19:18     ` Usama Arif
2025-01-20 19:25       ` 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=db16fc35-58e7-453d-9fbb-318a88a98cd1@gmail.com \
    --to=usamaarif642@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=damon@lists.linux.dev \
    --cc=david@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=sj@kernel.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