From: Martin KaFai Lau <martin.lau@linux.dev>
To: Hou Tao <houtao1@huawei.com>
Cc: Alexei Starovoitov <ast@kernel.org>,
Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Ian Rogers <irogers@google.com>,
Adrian Hunter <adrian.hunter@intel.com>,
linux-perf-users@vger.kernel.org, Song Liu <song@kernel.org>,
bpf@vger.kernel.org, Blake Jones <blakejones@google.com>,
Chris Li <chriscli@google.com>,
Arnaldo Carvalho de Melo <acme@kernel.org>,
Jiri Olsa <jolsa@kernel.org>, Namhyung Kim <namhyung@kernel.org>
Subject: Re: [PATCH] perf lock contention: Do not use BPF task local storage
Date: Mon, 9 Jan 2023 22:29:11 -0800 [thread overview]
Message-ID: <5e8cc542-763b-9db2-55e4-fb59920bc145@linux.dev> (raw)
In-Reply-To: <6e4ec7a4-9ac9-417c-c11a-de59e72a6e42@huawei.com>
On 1/9/23 7:29 PM, Hou Tao wrote:
> Hi Martin,
>
> On 1/10/2023 5:22 AM, Martin KaFai Lau wrote:
>> On 1/9/23 12:56 PM, Namhyung Kim wrote:
>>> Hello,
>>>
>>> On Mon, Nov 21, 2022 at 9:33 AM Martin KaFai Lau <martin.lau@linux.dev> wrote:
>>>>
>>>> On 11/18/22 11:01 AM, Namhyung Kim wrote:
>>>>> We could fix the task local storage to use the safe BPF allocator,
>>>>> but it takes time so let's change this until it happens actually.
>>>>
>>>> I also got another report on the kfree_rcu path. I am also looking into this
>>>> direction on using the BPF allocator.
>>>
>>> Any progress on this? Are there any concerns about the change?
>>
>> Yep, I am working on it. It is not a direct replacement from kzalloc to
>> bpf_mem_cache_alloc. eg. Some changes in the bpf mem allocator is needed to
>> ensure the free list cannot be reused before the rcu grace period. There is a
>> similar RFC patchset going into this direction that I am trying with.
>>
>> .
> Do you mean "[RFC PATCH bpf-next 0/6] bpf: Handle reuse in bpf memory alloc"
> [0], right ?
Yes, that is the RFC patch I was referring :). I was planning to comment after
looking at the patch in details. I have shared some of my quick thoughts in that
thread for the local storage usages.
> The main concern [1] for the proposal is the possibility of OOM
> will increase when RCU tasks trace grace period is slow, because the immediate
> reuse is disabled and the reuse is only possible after one RCU tasks trace grace
> period. Using a memory cgroup and setting a hard-limit on the cgroup may reduce
> the influence of the OOM problem, but it is not good enough. So do you have
> other ways to mitigate the potential OOM problem ?
>
> [0]: https://lore.kernel.org/bpf/20221230041151.1231169-1-houtao@huaweicloud.com/
> [1]:
> https://lore.kernel.org/bpf/CAADnVQ+z-Y6Yv2i-icAUy=Uyh9yiN4S1AOrLd=K8mu32TXORkw@mail.gmail.com/
prev parent reply other threads:[~2023-01-10 6:29 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-18 19:01 [PATCH] perf lock contention: Do not use BPF task local storage Namhyung Kim
2022-11-21 17:32 ` Martin KaFai Lau
2022-11-23 13:49 ` Arnaldo Carvalho de Melo
2023-01-09 20:56 ` Namhyung Kim
2023-01-09 21:22 ` Martin KaFai Lau
2023-01-09 22:25 ` Namhyung Kim
2023-01-10 3:29 ` Hou Tao
2023-01-10 6:29 ` Martin KaFai Lau [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=5e8cc542-763b-9db2-55e4-fb59920bc145@linux.dev \
--to=martin.lau@linux.dev \
--cc=acme@kernel.org \
--cc=adrian.hunter@intel.com \
--cc=ast@kernel.org \
--cc=blakejones@google.com \
--cc=bpf@vger.kernel.org \
--cc=chriscli@google.com \
--cc=houtao1@huawei.com \
--cc=irogers@google.com \
--cc=jolsa@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-perf-users@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=namhyung@kernel.org \
--cc=peterz@infradead.org \
--cc=song@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.