archive mirror
 help / color / mirror / Atom feed
From: "Ahmed S. Darwish" <>
To: Davidlohr Bueso <>
	Davidlohr Bueso <>
Subject: Re: [PATCH] seqlock,lockdep: Only check for preemption_disabled in non-rt
Date: Wed, 12 May 2021 11:47:13 +0200	[thread overview]
Message-ID: <YJukIUXFVdp1Fr7t@lx-t490> (raw)
In-Reply-To: <>

On Fri, May 07, 2021, Davidlohr Bueso wrote:
> This silences the writer hitting this nonsensical warning on PREEMPT_RT.
> Reported-by: Shung-Hsi Yu <>
> Signed-off-by: Davidlohr Bueso <>
> ---
>  include/linux/seqlock.h | 2 ++
>  1 file changed, 2 insertions(+)
> diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
> index f61e34fbaaea..c8f9253f1a2f 100644
> --- a/include/linux/seqlock.h
> +++ b/include/linux/seqlock.h
> @@ -268,7 +268,9 @@ static inline bool __seqprop_preemptible(const seqcount_t *s)
>  static inline void __seqprop_assert(const seqcount_t *s)
>  {
>  	lockdep_assert_preemption_disabled();
> +#endif
>  }

Nope, it is more complicated than that.

In general, for RT, seqcount_LOCKNAME_t variants should be used instead
of plain seqcount_t, as they can be safely used while preemption is
enabled on the write side.

For plain seqcount_t (which __seqprop_assert() is about), preemption
must be disabled, even for PREEMPT_RT. So the patch above is invalid.

Now, there are still some call sites in the kernel which needs
conversion obviously. I have a large patch series in queue which convert
a number of remaining networking call sites (the changes are locking
algorithm changes, not just direct substitution).

Good luck,

Ahmed S. Darwish
Linutronix GmbH

      parent reply	other threads:[~2021-05-12  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 23:39 [PATCH] seqlock,lockdep: Only check for preemption_disabled in non-rt Davidlohr Bueso
2021-05-07 23:47 ` [PATCH v2] " Davidlohr Bueso
2021-05-12  8:44   ` Peter Zijlstra
2021-05-13 19:53     ` Davidlohr Bueso
2021-05-14  4:55       ` Ahmed S. Darwish
2021-05-12  9:47 ` Ahmed S. Darwish [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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJukIUXFVdp1Fr7t@lx-t490 \ \ \ \ \ \ \ \ \

* 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;
as well as URLs for NNTP newsgroup(s).