Re: [PATCH v2 4/5] seqlock: seqcount_LOCKNAME_t: Introduce PREEMPT_RT support

2020-09-08 Thread Ahmed S. Darwish
On Tue, Sep 08, 2020 at 01:45:20PM +0200, pet...@infradead.org wrote: > On Fri, Sep 04, 2020 at 05:32:30PM +0200, Ahmed S. Darwish wrote: > > @@ -406,13 +443,20 @@ static inline int read_seqcount_t_retry(const > > seqcount_t *s, unsigned start) > > return __read_seqcount_t_retry(s, start); > >

Re: [PATCH v2 4/5] seqlock: seqcount_LOCKNAME_t: Introduce PREEMPT_RT support

2020-09-08 Thread peterz
On Fri, Sep 04, 2020 at 05:32:30PM +0200, Ahmed S. Darwish wrote: > @@ -406,13 +443,20 @@ static inline int read_seqcount_t_retry(const > seqcount_t *s, unsigned start) > return __read_seqcount_t_retry(s, start); > } > > +/* > + * Enforce non-preemptibility for all seqcount_LOCKNAME_t wri

[PATCH v2 4/5] seqlock: seqcount_LOCKNAME_t: Introduce PREEMPT_RT support

2020-09-04 Thread Ahmed S. Darwish
Preemption must be disabled before entering a sequence counter write side critical section. Otherwise the read side section can preempt the write side section and spin for the entire scheduler tick. If that reader belongs to a real-time scheduling class, it can spin forever and the kernel will li