[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210705085901.20f97a48c37fdc533d554dc6@kernel.org>
Date: Mon, 5 Jul 2021 08:59:01 +0900
From: Masami Hiramatsu <mhiramat@...nel.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: "wuqiang.matt" <wuqiang.matt@...edance.com>,
naveen.n.rao@...ux.ibm.com, anil.s.keshavamurthy@...el.com,
davem@...emloft.net, mhiramat@...nel.org, mingo@...nel.org,
peterz@...radead.org, linux-kernel@...r.kernel.org, mattwu@....com
Subject: Re: [PATCH] kretprobe scalability improvement
On Sun, 4 Jul 2021 10:16:47 +0100
Christoph Hellwig <hch@...radead.org> wrote:
> Would it make sense to just reuse kernel/bpf/percpu_freelist.c for
> kretprobes?
Hmm, I don't think so.
It seems that what Wuqiang proposed is more efficient than the
percpu_freelist, and it will be less efficient from the viewpoint
of memory usage because kretprobe freelist manages instance pool
among all CPUs (which can be unbalanced, sometimes 95% used by one
core, sometimes used evenly).
Actually, the best solution is to have per-task fixed-size instance
pool which is shared by all kretprobes (e.g. 4kb/task), because
the instance makes a "shadow stack" for each task. This may consume
more memory but is not increased by adding kretprobes, and should be
scalable.
Thank you,
--
Masami Hiramatsu <mhiramat@...nel.org>
Powered by blists - more mailing lists