All of lore.kernel.org
 help / color / mirror / Atom feed
From: Satya Durga Srinivasu Prabhala <quic_satyap@quicinc.com>
To: 'Alexei Starovoitov' <alexei.starovoitov@gmail.com>
Cc: "'Yonghong Song'" <yhs@fb.com>,
	"'Toke Høiland-Jørgensen'" <toke@redhat.com>,
	'bpf' <bpf@vger.kernel.org>,
	"'Alexei Starovoitov'" <ast@kernel.org>,
	"'Andrii Nakryiko'" <andrii@kernel.org>,
	"'Daniel Borkmann'" <daniel@iogearbox.net>,
	"'Joanne Koong'" <joannelkoong@gmail.com>,
	"'Jesper Dangaard Brouer'" <brouer@redhat.com>
Subject: Re: [PATCH] bpf: fix rq lock recursion issue
Date: Mon, 13 Jun 2022 18:10:02 -0700	[thread overview]
Message-ID: <009d01d87f8b$79f83140$6de893c0$@quicinc.com> (raw)
In-Reply-To: <CAADnVQKq-e1TT1Y2uhgCaRY4CUP37dq0HuSyTdgtxkNfv8DQUg@mail.gmail.com>


On 6/13/22 2:49 PM, Alexei Starovoitov wrote:
> On Mon, Jun 13, 2022 at 2:35 PM Satya Durga Srinivasu Prabhala
> <quic_satyap@quicinc.com> wrote:
>>
>> On 6/13/22 2:01 PM, Alexei Starovoitov wrote:
>>> is doesn't solve anything.
>>> Please provide a reproducer.
>> I'm trying to find an easy way to repro the issue, so far, unsuccessful.
>>
>>> iirc the task's affinity change can race even with preemption disabled
>>> on this cpu. Why would s/migrate/preemption/ address the deadlock ?
>> I don't think task's affinity change races with preemption disabled/enabled.
>>
>> Switching to preemption disable/enable calls helps as it's just simple
>> counter increment and decrement with a barrier, but with migrate
>> disable/enable when task's affinity changes, we run into recursive bug
>> due to rq lock.
> As Yonghong already explained, replacing migrate_disable
> with preempt_disable around bpf prog invocation is not an option.

If I understand correctly, Yonghong mentioned that replacing migrate_
with preempt_ won't work for RT Kernels and migrate_ APIs were introduced
for RT Kernels is what he was pointing to. I went back and cross checked
on 5.10 LTS Kernel, I see that the migrate_ calls end up just calling into
preemt_ calls [1]. So far non-RT kernels, sticking to preemt_ calls should
still work. Please let me know if I missed anything.

[1]
https://android.googlesource.com/kernel/common/+/refs/heads/android12-5.10/include/linux/preempt.h#335


  reply	other threads:[~2022-06-14  1:10 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-06-13  2:52 [PATCH] bpf: fix rq lock recursion issue Satya Durga Srinivasu Prabhala
2022-06-13  9:22 ` Toke Høiland-Jørgensen
2022-06-13 16:17   ` Satya Durga Srinivasu Prabhala
2022-06-13 16:35   ` Yonghong Song
2022-06-13 17:47     ` Satya Durga Srinivasu Prabhala
2022-06-13 21:01       ` Alexei Starovoitov
2022-06-13 21:35         ` Satya Durga Srinivasu Prabhala
2022-06-13 21:49           ` Alexei Starovoitov
2022-06-14  1:10             ` Satya Durga Srinivasu Prabhala [this message]
2022-06-14  6:09               ` Yonghong Song
2022-06-24  6:56                 ` Satya Durga Srinivasu Prabhala
2022-06-24 16:46                   ` Alexei Starovoitov

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='009d01d87f8b$79f83140$6de893c0$@quicinc.com' \
    --to=quic_satyap@quicinc.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=andrii@kernel.org \
    --cc=ast@kernel.org \
    --cc=bpf@vger.kernel.org \
    --cc=brouer@redhat.com \
    --cc=daniel@iogearbox.net \
    --cc=joannelkoong@gmail.com \
    --cc=toke@redhat.com \
    --cc=yhs@fb.com \
    /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.