[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK1f24=2YE+BCYiizkqc8rmN8NaFv_Q6ZtE+4DiFK0PpcefOrQ@mail.gmail.com>
Date: Tue, 30 Jan 2024 11:08:10 +0800
From: Lance Yang <ioworker0@...il.com>
To: Michal Hocko <mhocko@...e.com>
Cc: akpm@...ux-foundation.org, zokeefe@...gle.com, david@...hat.com,
songmuchun@...edance.com, shy828301@...il.com, peterx@...hat.com,
minchan@...nel.org, linux-mm@...ck.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] mm/khugepaged: bypassing unnecessary scans with
MMF_DISABLE_THP check
On Tue, Jan 30, 2024 at 10:12 AM Lance Yang <ioworker0@...il.com> wrote:
>
> Hey Michal,
>
> Thanks for taking time to review!
>
> On some servers within our company, we deploy a
> daemon responsible for monitoring and updating
> local applications. Some applications prefer not to
> use THP, so the daemon calls prctl to disable THP
> before fork/exec. Conversely, for other applications,
> the daemon calls prctl to enable THP before fork/exec.
>
> Ideally, the daemon should invoke prctl after the fork,
> but its current implementation follows the described
> approach.
In the Go standard library, there is no direct encapsulation
of the fork system call. Instead, fork and execve are
combined into one through syscall.ForkExec.
>
> BR,
> Lance
>
> On Tue, Jan 30, 2024 at 12:28 AM Michal Hocko <mhocko@...e.com> wrote:
> >
> > On Mon 29-01-24 13:45:51, Lance Yang wrote:
> > > khugepaged scans the entire address space in the
> > > background for each given mm, looking for
> > > opportunities to merge sequences of basic pages
> > > into huge pages. However, when an mm is inserted
> > > to the mm_slots list, and the MMF_DISABLE_THP flag
> > > is set later, this scanning process becomes
> > > unnecessary for that mm and can be skipped to avoid
> > > redundant operations, especially in scenarios with
> > > a large address space.
> >
> > Is this a real problem? I thought that the prctl is called
> > on the parent before fork/exec. Or are you aware of any
> > applications which do call prctl late enough that the race
> > would be actually observable?
> > --
> > Michal Hocko
> > SUSE Labs
Powered by blists - more mailing lists