mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Guilherme G. Piccoli" <gpiccoli@igalia.com>
To: Maksim Davydov <davydov-max@yandex-team.ru>
Cc: den-plotnikov@yandex-team.ru, linux-kernel@vger.kernel.org,
	x86@kernel.org, dave.hansen@linux.intel.com, tglx@linutronix.de,
	mingo@redhat.com, bp@alien8.de
Subject: Re: [PATCH RESEND v3] x86/split_lock: fix delayed detection enabling
Date: Wed, 20 Nov 2024 16:16:47 -0300	[thread overview]
Message-ID: <afccb8f2-a376-266f-5477-493bbc5fb7d3@igalia.com> (raw)
In-Reply-To: <20241113142301.704057-1-davydov-max@yandex-team.ru>

On 13/11/2024 11:23, Maksim Davydov wrote:
> If the warn mode with disabled mitigation mode is used, then on each
> CPU where the split lock occurred detection will be disabled in order to
> make progress and delayed work will be scheduled, which then will enable
> detection back. Now it turns out that all CPUs use one global delayed
> work structure. This leads to the fact that if a split lock occurs on
> several CPUs at the same time (within 2 jiffies), only one CPU will
> schedule delayed work, but the rest will not. The return value of
> schedule_delayed_work_on() would have shown this, but it is not checked
> in the code.
> 
> A diagram that can help to understand the bug reproduction:
> https://lore.kernel.org/all/2cd54041-253b-4e78-b8ea-dbe9b884ff9b@yandex-team.ru/
> 
> In order to fix the warn mode with disabled mitigation mode, delayed work
> has to be a per-CPU.
> 
> v3 -> v2:
> * place and time of the per-CPU structure initialization were changed.
>   initcall doesn't seem to be a good place for it, so deferred
>   initialization is used.
> 
> Fixes: 727209376f49 ("x86/split_lock: Add sysctl to control the misery mode")
> Signed-off-by: Maksim Davydov <davydov-max@yandex-team.ru>
> ---
>  arch/x86/kernel/cpu/intel.c | 20 ++++++++++++++++----
>  1 file changed, 16 insertions(+), 4 deletions(-)


Hi Maksim, thanks for resubmitting again. I think that is indeed a valid
fix, but what I've also noticed is that recently (as in this week) the
code changed from the intel.c file to a more generic one, since AMD is
enabling split lock detection in their CPUs apparently [0].

So, I'd suggest you to rebase against 6.13-rc, that would likely
increase the chances of a merge. Once you do that, I can try to test it
as well, though I don't personally have an Intel CPU with that feature
(but some friends have it).

Cheers,


Guilherme


[0] https://lore.kernel.org/r/ZzuBNj4JImJGUNJc@gmail.com/

  reply	other threads:[~2024-11-20 19:16 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-11-13 14:23 Maksim Davydov
2024-11-20 19:16 ` Guilherme G. Piccoli [this message]
2024-11-25 22:20   ` Maksim Davydov

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=afccb8f2-a376-266f-5477-493bbc5fb7d3@igalia.com \
    --to=gpiccoli@igalia.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=davydov-max@yandex-team.ru \
    --cc=den-plotnikov@yandex-team.ru \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=x86@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®