From: Michal Hocko <mhocko@kernel.org>
To: Hoeun Ryu <hoeun.ryu@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
Andrew Morton <akpm@linux-foundation.org>,
Ingo Molnar <mingo@kernel.org>, Andy Lutomirski <luto@kernel.org>,
Kees Cook <keescook@chromium.org>,
"Eric W. Biederman" <ebiederm@xmission.com>,
Mateusz Guzik <mguzik@redhat.com>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
"kernel-hardening@lists.openwall.com"
<kernel-hardening@lists.openwall.com>
Subject: Re: [PATCH 1/3] fork: dynamically allocate cache array for vmapped stacks using cpuhp
Date: Sun, 5 Feb 2017 11:18:45 +0100 [thread overview]
Message-ID: <20170205101844.GE22713@dhcp22.suse.cz> (raw)
In-Reply-To: <CABeRdtqfAR+RSxs+2Lr7LZjhKqLfU3QHVN+RULchSbyrVS1qEQ@mail.gmail.com>
On Sat 04-02-17 11:01:32, Hoeun Ryu wrote:
> On Sat, Feb 4, 2017 at 2:52 AM, Andy Lutomirski <luto@amacapital.net> wrote:
> > On Fri, Feb 3, 2017 at 8:42 AM, Hoeun Ryu <hoeun.ryu@gmail.com> wrote:
> >> On Sat, Feb 4, 2017 at 12:39 AM, Michal Hocko <mhocko@kernel.org> wrote:
> >>> On Sat 04-02-17 00:30:05, Hoeun Ryu wrote:
> >>>> Using virtually mapped stack, kernel stacks are allocated via vmalloc.
> >>>> In the current implementation, two stacks per cpu can be cached when
> >>>> tasks are freed and the cached stacks are used again in task duplications.
> >>>> but the array for the cached stacks is statically allocated by per-cpu api.
> >>>> In this new implementation, the array for the cached stacks are dynamically
> >>>> allocted and freed by cpu hotplug callbacks and the cached stacks are freed
> >>>> when cpu is down. setup for cpu hotplug is established in fork_init().
> >>>
> >>> Why do we want this? I can see that the follow up patch makes the number
> >>> configurable but the changelog doesn't describe the motivation for that.
> >>> Which workload would benefit from a higher value?
> >>>
> >>
> >> The key difference of this implementation, the cached stacks for a cpu
> >> is freed when a cpu is down.
> >> so the cached stacks are no longer wasted.
> >> In the current implementation, the cached stacks for a cpu still
> >> remain on the system when a cpu is down.
> >> I think we could imagine what if a machine has many cpus and someone
> >> wants to have bigger size of stack caches.
> >
> > Then how about just registering a simple hotplug hook to free the
> > stacks without worrying about freeing the tiny array as well?
> >
>
> Michal, What do you think about it. it sounds fair enough.
This is what I've tried to suggest in the other reply.
--
Michal Hocko
SUSE Labs
next prev parent reply other threads:[~2017-02-05 10:18 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-03 15:30 Hoeun Ryu
2017-02-03 15:39 ` Michal Hocko
2017-02-03 16:42 ` Hoeun Ryu
2017-02-03 17:15 ` Michal Hocko
2017-02-03 17:52 ` Andy Lutomirski
2017-02-04 2:01 ` Hoeun Ryu
2017-02-05 10:18 ` Michal Hocko [this message]
2017-02-05 13:23 ` Hoeun Ryu
2017-02-03 16:04 ` kbuild test robot
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=20170205101844.GE22713@dhcp22.suse.cz \
--to=mhocko@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=ebiederm@xmission.com \
--cc=hoeun.ryu@gmail.com \
--cc=keescook@chromium.org \
--cc=kernel-hardening@lists.openwall.com \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=luto@kernel.org \
--cc=mguzik@redhat.com \
--cc=mingo@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
all inboxes | Powered by JetHome®