From: Yang Shi <shy828301@gmail.com>
To: Zi Yan <ziy@nvidia.com>
Cc: Linux MM <linux-mm@kvack.org>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
linux-kselftest@vger.kernel.org,
"Kirill A . Shutemov" <kirill.shutemov@linux.intel.com>,
Andrew Morton <akpm@linux-foundation.org>,
Shuah Khan <shuah@kernel.org>,
John Hubbard <jhubbard@nvidia.com>,
Sandipan Das <sandipan@linux.ibm.com>,
David Hildenbrand <david@redhat.com>,
Mika Penttila <mika.penttila@nextfour.com>
Subject: Re: [PATCH v2] mm: huge_memory: a new debugfs interface for splitting THP tests.
Date: Thu, 11 Mar 2021 14:37:21 -0800 [thread overview]
Message-ID: <CAHbLzkpLhMkHW5JYu2K2XTgoGBjUcvR6u0iTT5UYyYHU3YDz_A@mail.gmail.com> (raw)
In-Reply-To: <A3A1CBF3-B5D2-4CF2-97D6-9BC12E82BEAE@nvidia.com>
On Thu, Mar 11, 2021 at 7:52 AM Zi Yan <ziy@nvidia.com> wrote:
>
> On 10 Mar 2021, at 20:12, Yang Shi wrote:
>
> > On Wed, Mar 10, 2021 at 7:36 AM Zi Yan <zi.yan@sent.com> wrote:
> >>
> >> From: Zi Yan <ziy@nvidia.com>
> >>
> >> We do not have a direct user interface of splitting the compound page
> >> backing a THP and there is no need unless we want to expose the THP
> >> implementation details to users. Adding an interface for debugging.
> >>
> >> By writing "<pid>,<vaddr_start>,<vaddr_end>" to
> >> <debugfs>/split_huge_pages_in_range_pid, THPs within the given virtual
> >
> > Can we reuse the existing split_huge_page knob instead of creating a new one?
> >
> > Two knobs for splitting huge pages on debugging purpose seem
> > overkilling to me IMHO. I'm wondering if we could check if a special
> > value (e.g. 1 or -1) is written then split all THPs as split_huge_page
> > knob does?
> >
> > I don't think this interface is used widely so the risk should be very
> > low for breaking userspace.
>
> Thanks for the suggestion.
>
> I prefer a separate interface to keep input handling simpler. I am also
> planning to enhance this interface later to enable splitting huge pages
> to any lower order when Matthew Wilcox’s large page in page cache gets in,
> so it is better to keep it separate from existing split_huge_pages.
The input handling seems not that hard, you might be able to try to do:
ret = sscanf(input_buf, "%d,0x%lx,0x%lx,%d", &pid, &vaddr_start,
&vaddr_end, order);
switch(ret) {
case ret == 1:
split_all_thps
case ret == 3:
split_thp_for_pid
case ret == 4:
split_thp_for_pid_to_order
default:
return -EINVAL
}
Will it work for you?
>
> —
> Best Regards,
> Yan Zi
prev parent reply other threads:[~2021-03-11 22:37 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-03-10 15:35 Zi Yan
2021-03-11 1:12 ` Yang Shi
2021-03-11 15:52 ` Zi Yan
2021-03-11 22:37 ` Yang Shi [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=CAHbLzkpLhMkHW5JYu2K2XTgoGBjUcvR6u0iTT5UYyYHU3YDz_A@mail.gmail.com \
--to=shy828301@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=david@redhat.com \
--cc=jhubbard@nvidia.com \
--cc=kirill.shutemov@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mika.penttila@nextfour.com \
--cc=sandipan@linux.ibm.com \
--cc=shuah@kernel.org \
--cc=ziy@nvidia.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