Linux-rt-users Archive on lore.kernel.org
 help / color / Atom feed
From: John Mathew <john.mathew@unikie.com>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: linux-rt-users@vger.kernel.org, lukas.bulwahn@gmail.com
Subject: Re: complete_all() with x waiters in swake_up_all_locked
Date: Fri, 13 Dec 2019 11:08:35 +0200
Message-ID: <CAJz2qXnPquUZSeO9SWSmvLKcdhnT96KnD66F-oatdnotYkxS+A@mail.gmail.com> (raw)
In-Reply-To: <20191212171230.ygveclhr5xqurys7@linutronix.de>

On Thu, Dec 12, 2019 at 7:12 PM Sebastian Andrzej Siewior
<bigeasy@linutronix.de> wrote:
>
> On 2019-12-11 09:17:49 [+0200], John Mathew wrote:
> > Hi,
> Hi,
>
> > We are seeing the waring still appearing in the v5.0.3-rt1 tag of the
> > rt linux kernel.
>
> I didn't managed to reproduce it at the time. Now you say it works with
> 5.0-RT. I will try to give it a spin with the latest RT sometime next
> week.
>
> >
> > Has there been any further investigation in to this warning following
> > the previous discussion?
>
> Thanks for report. I didn't manage to reproduce it so no. The actual
> problem is that we are trying to figure out what a sane limit for
> complete_all() might be. Most users of complete_all() have one two
> waiters. Based on that report your max was 8 and that occurred a few
> times.

I was able to reproduce the warning on v5.2.21-rt14 which is the
latest tag on the rt-devel branch.
Here is my analysis.
What I see is that in crypto/algboss.c there is a probe being
scheduled when a notification arrives.
The probe will run a thread: cryptomgr_probe and wait for its completion.
The issue arises because a similar module is also issues a wait for
completion on the exactly same completion object (larval->completion).
The similar module is:  crypto_larval_wait in linux-rt-devel/crypto/api.c
It is casting a crypto_larval struct pointer from a crypto_alg struct
pointer which doesn't seem to have/init a completion object.
So it is actually the cryptomgr_probe thread that actually completes
both its own and the crypto_larval_wait waits and so the number of
completions exceeds the limit of 2.

This looks like an error to me.
So I created patch in the following email.
I don't think the issue is with the limit, rather a wrong usage of the
completion object.

>
> > -John
>
> Sebastian

  reply index

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-11  7:17 John Mathew
2019-12-12 17:12 ` Sebastian Andrzej Siewior
2019-12-13  9:08   ` John Mathew [this message]
2019-12-18 16:53     ` Sebastian Andrzej Siewior
2019-12-31 10:00       ` [PATCH] crypto: only wait for completion once John Mathew
2020-01-14 12:47         ` Sebastian Andrzej Siewior
2020-02-11 11:48           ` John Mathew
2020-02-11 12:04             ` Sebastian Andrzej Siewior
2020-02-11 15:52               ` John Mathew
2020-02-11 15:59                 ` Sebastian Andrzej Siewior
2020-02-12 12:55                   ` John Mathew
2020-02-12 17:02                     ` Sebastian Andrzej Siewior
2020-02-13  6:58                       ` John Mathew
2020-02-13  8:31                         ` Sebastian Andrzej Siewior
2020-02-18  7:18                           ` [PATCH] swait: Increase number of waiters for warning John Mathew
2020-03-20 16:54                             ` [PATCH RT] swait: Remove the warning with more than two waiters Sebastian Andrzej Siewior

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=CAJz2qXnPquUZSeO9SWSmvLKcdhnT96KnD66F-oatdnotYkxS+A@mail.gmail.com \
    --to=john.mathew@unikie.com \
    --cc=bigeasy@linutronix.de \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=lukas.bulwahn@gmail.com \
    /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

Linux-rt-users Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-rt-users/0 linux-rt-users/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-rt-users linux-rt-users/ https://lore.kernel.org/linux-rt-users \
		linux-rt-users@vger.kernel.org
	public-inbox-index linux-rt-users

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.vger.linux-rt-users


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git