Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1708126

Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions

From Byungchul Park <byungchul.park@lge.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions
Date 2017-08-10 03:30 +0200
Message-ID <ucKsp-768-7@gated-at.bofh.it> (permalink)
References <ubKut-59V-3@gated-at.bofh.it> <ubKuv-59V-37@gated-at.bofh.it> <ucvWr-5qB-15@gated-at.bofh.it> <ucwpr-5Qr-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, Aug 09, 2017 at 12:24:39PM +0200, Peter Zijlstra wrote:
> On Wed, Aug 09, 2017 at 11:51:07AM +0200, Peter Zijlstra wrote:
> > On Mon, Aug 07, 2017 at 04:12:56PM +0900, Byungchul Park wrote:
> > > +static inline void wait_for_completion(struct completion *x)
> > > +{
> > > +	complete_acquire(x);
> > > +	__wait_for_completion(x);
> > > +	complete_release(x);
> > > +}
> > > +
> > > +static inline void wait_for_completion_io(struct completion *x)
> > > +{
> > > +	complete_acquire(x);
> > > +	__wait_for_completion_io(x);
> > > +	complete_release(x);
> > > +}
> > > +
> > > +static inline int wait_for_completion_interruptible(struct completion *x)
> > > +{
> > > +	int ret;
> > > +	complete_acquire(x);
> > > +	ret = __wait_for_completion_interruptible(x);
> > > +	complete_release(x);
> > > +	return ret;
> > > +}
> > > +
> > > +static inline int wait_for_completion_killable(struct completion *x)
> > > +{
> > > +	int ret;
> > > +	complete_acquire(x);
> > > +	ret = __wait_for_completion_killable(x);
> > > +	complete_release(x);
> > > +	return ret;
> > > +}
> > 
> > I don't understand, why not change __wait_for_common() ?
> 
> That is what is wrong with the below?
> 
> Yes, it adds acquire/release to the timeout variants too, but I don't

Yes, I didn't want to involve them in lockdep play which reports _deadlock_
warning since it's not a dependency causing a deadlock.

> see why we should exclude those, and even if we'd want to do that, it
> would be trivial:
> 
> 	bool timo = (timeout == MAX_SCHEDULE_TIMEOUT);
> 
> 	if (!timo)
> 		complete_acquire(x);
> 
> 	/* ... */
> 
> 	if (!timo)
> 		complete_release(x);

Yes, frankly I wanted to use this.. but skip it.

> But like said, I think we very much want to annotate waits with timeouts
> too. Hitting the max timo doesn't necessarily mean we'll make fwd
> progress, we could be stuck in a loop doing something else again before
> returning to wait.

In that case, it should be detected by other dependencies which makes
problems, not the dependency by wait_for_complete().

> Also, even if we'd make fwd progress, hitting that max timo is still not
> desirable.

It's not desirable but it's not a dependency causing a deadlock, so I did
not want to _deadlock_ warning in that cases.. I didn't want to abuse
lockdep reports..

However, it's OK if you think it's worth warning even in that cases.

Thank you very much,
Byungchul

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH v8 00/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
  [PATCH v8 08/14] lockdep: Make print_circular_bug() aware of crossrelease Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    [tip:locking/core] locking/lockdep: Make print_circular_bug() aware  of crossrelease tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200
  [PATCH v8 05/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    Re: [PATCH v8 05/14] lockdep: Implement crossrelease feature Peter Zijlstra <peterz@infradead.org> - 2017-08-09 16:10 +0200
      Re: [PATCH v8 05/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-10 03:40 +0200
        Re: [PATCH v8 05/14] lockdep: Implement crossrelease feature Peter Zijlstra <peterz@infradead.org> - 2017-08-10 11:30 +0200
    [tip:locking/core] locking/lockdep: Implement the 'crossrelease'  feature tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200
  [PATCH v8 11/14] lockdep: Apply crossrelease to PG_locked locks Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    Re: [PATCH v8 11/14] lockdep: Apply crossrelease to PG_locked locks Byungchul Park <byungchul.park@lge.com> - 2017-08-10 03:40 +0200
      Re: [PATCH v8 11/14] lockdep: Apply crossrelease to PG_locked locks Peter Zijlstra <peterz@infradead.org> - 2017-08-10 11:30 +0200
  [PATCH v8 10/14] pagemap.h: Remove trailing white space Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
  [PATCH v8 07/14] lockdep: Handle non(or multi)-acquisition of a crosslock Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    [tip:locking/core] locking/lockdep: Handle non(or  multi)-acquisition of a crosslock tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200
  [PATCH v8 12/14] lockdep: Apply lock_acquire(release) on __Set(__Clear)PageLocked Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
  [PATCH v8 14/14] lockdep: Crossrelease feature documentation Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    [tip:locking/core] locking/lockdep: Add 'crossrelease' feature  documentation tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200
  [PATCH v8 09/14] lockdep: Apply crossrelease to completions Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Peter Zijlstra <peterz@infradead.org> - 2017-08-09 12:00 +0200
      Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Peter Zijlstra <peterz@infradead.org> - 2017-08-09 12:30 +0200
        Re: [PATCH v8 09/14] lockdep: Apply crossrelease to completions Byungchul Park <byungchul.park@lge.com> - 2017-08-10 03:30 +0200
    [tip:locking/core] locking/lockdep: Apply crossrelease to  completions tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200
  [PATCH v8 04/14] lockdep: Make check_prev_add() able to handle external stack_trace Byungchul Park <byungchul.park@lge.com> - 2017-08-07 09:20 +0200
    [tip:locking/core] locking/lockdep: Make check_prev_add() able to  handle external stack_trace tip-bot for Byungchul Park <tipbot@zytor.com> - 2017-08-10 14:30 +0200
  Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Peter Zijlstra <peterz@infradead.org> - 2017-08-09 18:00 +0200
    Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-10 03:00 +0200
      Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-10 05:50 +0200
      Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-10 13:00 +0200
    Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-10 11:40 +0200
      Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Peter Zijlstra <peterz@infradead.org> - 2017-08-10 13:00 +0200
  Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Ingo Molnar <mingo@kernel.org> - 2017-08-10 13:20 +0200
    Re: [PATCH v8 00/14] lockdep: Implement crossrelease feature Byungchul Park <byungchul.park@lge.com> - 2017-08-10 13:50 +0200

csiph-web