All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
To: Pavel Machek <pavel@ucw.cz>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	johannes.berg@intel.com, linux-leds@vger.kernel.org
Subject: Re: [PATCH] leds: trigger: Disable CPU trigger on PREEMPT_RT
Date: Mon, 27 Sep 2021 21:34:24 +0200	[thread overview]
Message-ID: <20210927193424.glrddglskpohbosn@linutronix.de> (raw)
In-Reply-To: <20210927190650.GA13992@duo.ucw.cz>

On 2021-09-27 21:06:50 [+0200], Pavel Machek wrote:
> Hi!
Hi,

> What makes the CPU trigger special with RT? Other triggers will be
> called from interesting places, too... Johanes pointed out other
> problems with that rwlock, and we are getting rid of the rwlock.

There seem to be a few misunderstandings. Let me clear them up for you:
- A non sleeping lock is spinlock_t and rwlock_t as you point out but
  only on !PREEMPT_RT. In context of PREEMPT_RT both of them are
  sleeping locks.

- An interrupt handler on PREEMPT_RT is always threaded. From threaded
  context sleeping is possible and therefore a spinlock_t can be
  acquired by regular request_irq().

- The timer callback (timer_list or hrtimer) is *usually* invoked from
  softirq context which is preemptible on PREEMPT_RT. Therefore sleeping
  is possible in order to acquire a spinlock_t. The exceptional
  callbacks (which are not invoked from softirq thus the term usually
  previously) must not acquire spinlock_t and are specially marked.

- The idle loop (x86 or ARM makes no difference) is always invoked with
  disabled interrupts and so sleeping is a no no on PREEMPT_RT. So a
  spinlock_t can not be acquired in this context.

You mention "interesting places" above. Either this is not the case or
nobody reported it yet.

> Best regards,
> 								Pavel

Sebastian

  reply	other threads:[~2021-09-27 19:34 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-24 11:15 [PATCH] leds: trigger: Disable CPU trigger on PREEMPT_RT Sebastian Andrzej Siewior
2021-09-27 14:23 ` Pavel Machek
2021-09-27 15:35   ` Thomas Gleixner
2021-09-27 15:44     ` Pavel Machek
2021-09-27 17:18       ` Sebastian Andrzej Siewior
2021-09-27 17:36         ` Johannes Berg
2021-09-27 19:06         ` Pavel Machek
2021-09-27 19:34           ` Sebastian Andrzej Siewior [this message]
2021-10-13  8:08             ` Pavel Machek
2021-10-13  8:39               ` Sebastian Andrzej Siewior
2021-10-13  8:42                 ` Pavel Machek
2021-10-13  9:08                   ` Sebastian Andrzej Siewior
2021-10-13  9:37                   ` [PATCH v2] " Sebastian Andrzej Siewior
2021-10-13 18:08                     ` Pavel Machek
2021-09-28  0:14           ` [PATCH] " Thomas Gleixner
2021-09-27 18:48       ` Thomas Gleixner

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=20210927193424.glrddglskpohbosn@linutronix.de \
    --to=bigeasy@linutronix.de \
    --cc=johannes.berg@intel.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=pavel@ucw.cz \
    --cc=tglx@linutronix.de \
    /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.