From: David Hildenbrand <david@redhat.com>
To: Lance Yang <ioworker0@gmail.com>, akpm@linux-foundation.org
Cc: ryan.roberts@arm.com, 21cnbao@gmail.com, mhocko@suse.com,
fengwei.yin@intel.com, zokeefe@google.com, shy828301@gmail.com,
xiehuan09@gmail.com, wangkefeng.wang@huawei.com,
songmuchun@bytedance.com, peterx@redhat.com, minchan@kernel.org,
linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v9 3/4] mm/memory: add any_dirty optional pointer to folio_pte_batch()
Date: Thu, 18 Apr 2024 13:59:58 +0200 [thread overview]
Message-ID: <c73423cb-3288-47aa-b389-22566e883db7@redhat.com> (raw)
In-Reply-To: <20240418105750.98866-4-ioworker0@gmail.com>
On 18.04.24 12:57, Lance Yang wrote:
> This commit adds the any_dirty pointer as an optional parameter to
> folio_pte_batch() function. By using both the any_young and any_dirty pointers,
> madvise_free can make smarter decisions about whether to clear the PTEs when
> marking large folios as lazyfree.
>
> Suggested-by: David Hildenbrand <david@redhat.com>
> Signed-off-by: Lance Yang <ioworker0@gmail.com>
> ---
> mm/internal.h | 12 ++++++++++--
> mm/madvise.c | 19 ++++++++++++++-----
> mm/memory.c | 4 ++--
> 3 files changed, 26 insertions(+), 9 deletions(-)
>
> diff --git a/mm/internal.h b/mm/internal.h
> index c6483f73ec13..daa59cef85d7 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -134,6 +134,8 @@ static inline pte_t __pte_batch_clear_ignored(pte_t pte, fpb_t flags)
> * first one is writable.
> * @any_young: Optional pointer to indicate whether any entry except the
> * first one is young.
> + * @any_dirty: Optional pointer to indicate whether any entry except the
> + * first one is dirty.
> *
I was also wondering if we should make that function return a
pte+nr_pages, instead of only nr_pages, and then simply have the
function, based on new flags, merge data into the original PTE.
But let's do that separately.
Acked-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
next prev parent reply other threads:[~2024-04-18 12:00 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-04-18 10:57 [PATCH v9 0/4] mm/madvise: enhance lazyfreeing with mTHP in madvise_free Lance Yang
2024-04-18 10:57 ` [PATCH v9 1/4] mm/madvise: introduce clear_young_dirty_ptes() batch helper Lance Yang
2024-04-18 10:57 ` [PATCH v9 2/4] mm/arm64: override " Lance Yang
2024-04-18 10:57 ` [PATCH v9 3/4] mm/memory: add any_dirty optional pointer to folio_pte_batch() Lance Yang
2024-04-18 11:59 ` David Hildenbrand [this message]
2024-04-18 12:09 ` Lance Yang
2024-04-18 10:57 ` [PATCH v9 4/4] mm/madvise: optimize lazyfreeing with mTHP in madvise_free Lance Yang
2024-04-18 12:03 ` David Hildenbrand
2024-04-18 12:16 ` Lance Yang
2024-04-18 12:33 ` Lance Yang
2024-04-18 12:44 ` David Hildenbrand
2024-04-18 12:48 ` Lance Yang
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=c73423cb-3288-47aa-b389-22566e883db7@redhat.com \
--to=david@redhat.com \
--cc=21cnbao@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=fengwei.yin@intel.com \
--cc=ioworker0@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.com \
--cc=minchan@kernel.org \
--cc=peterx@redhat.com \
--cc=ryan.roberts@arm.com \
--cc=shy828301@gmail.com \
--cc=songmuchun@bytedance.com \
--cc=wangkefeng.wang@huawei.com \
--cc=xiehuan09@gmail.com \
--cc=zokeefe@google.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