[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHbLzkpLhMkHW5JYu2K2XTgoGBjUcvR6u0iTT5UYyYHU3YDz_A@mail.gmail.com>
Date: Thu, 11 Mar 2021 14:37:21 -0800
From: Yang Shi <shy828301@...il.com>
To: Zi Yan <ziy@...dia.com>
Cc: Linux MM <linux-mm@...ck.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
linux-kselftest@...r.kernel.org,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Shuah Khan <shuah@...nel.org>,
John Hubbard <jhubbard@...dia.com>,
Sandipan Das <sandipan@...ux.ibm.com>,
David Hildenbrand <david@...hat.com>,
Mika Penttila <mika.penttila@...tfour.com>
Subject: Re: [PATCH v2] mm: huge_memory: a new debugfs interface for splitting
THP tests.
On Thu, Mar 11, 2021 at 7:52 AM Zi Yan <ziy@...dia.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@...t.com> wrote:
> >>
> >> From: Zi Yan <ziy@...dia.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
Powered by blists - more mailing lists