linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Xiongwei Song <sxwjean@gmail.com>
To: Xiongwei Song <sxwjean@me.com>
Cc: peterz@infradead.org, mingo@redhat.com, will@kernel.org,
	longman@redhat.com, Boqun Feng <boqun.feng@gmail.com>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] locking/lockdep: print possible warning after counting deps
Date: Thu, 17 Jun 2021 10:22:30 +0800	[thread overview]
Message-ID: <CAEVVKH8n5ntPVOP=X9bPGoK4xdE-Z-XHKSFsoGOaLpke+uZoqg@mail.gmail.com> (raw)
In-Reply-To: <20210616144210.278662-2-sxwjean@me.com>

Please ignore this patch. I will resend as  Longman's suggestions.
Please see https://lkml.org/lkml/2021/6/16/949.

Regards,
Xiongwei


On Wed, Jun 16, 2021 at 10:42 PM Xiongwei Song <sxwjean@me.com> wrote:
>
> From: Xiongwei Song <sxwjean@gmail.com>
>
> The graph walk might hit error when counting dependencies. Once the
> return value is negative, print a warning to reminder users.
>
> Signed-off-by: Xiongwei Song <sxwjean@gmail.com>
> ---
>  kernel/locking/lockdep.c | 12 ++++++++++--
>  1 file changed, 10 insertions(+), 2 deletions(-)
>
> diff --git a/kernel/locking/lockdep.c b/kernel/locking/lockdep.c
> index 7641bd407239..074fd6418c20 100644
> --- a/kernel/locking/lockdep.c
> +++ b/kernel/locking/lockdep.c
> @@ -2028,8 +2028,12 @@ static unsigned long __lockdep_count_forward_deps(struct lock_list *this)
>  {
>         unsigned long  count = 0;
>         struct lock_list *target_entry;
> +       enum bfs_result ret;
> +
> +       ret = __bfs_forwards(this, (void *)&count, noop_count, NULL, &target_entry);
>
> -       __bfs_forwards(this, (void *)&count, noop_count, NULL, &target_entry);
> +       if (unlikely(bfs_error(ret)))
> +               print_bfs_bug(ret);
>
>         return count;
>  }
> @@ -2053,8 +2057,12 @@ static unsigned long __lockdep_count_backward_deps(struct lock_list *this)
>  {
>         unsigned long  count = 0;
>         struct lock_list *target_entry;
> +       enum bfs_result ret;
> +
> +       ret = __bfs_backwards(this, (void *)&count, noop_count, NULL, &target_entry);
>
> -       __bfs_backwards(this, (void *)&count, noop_count, NULL, &target_entry);
> +       if (unlikely(bfs_error(ret)))
> +               print_bfs_bug(ret);
>
>         return count;
>  }
> --
> 2.30.2
>

  reply	other threads:[~2021-06-17  2:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-16 14:42 [PATCH] locking/lockdep: unlikely bfs error check Xiongwei Song
2021-06-16 14:42 ` [PATCH] locking/lockdep: print possible warning after counting deps Xiongwei Song
2021-06-17  2:22   ` Xiongwei Song [this message]
2021-06-16 14:48 ` [PATCH] locking/lockdep: unlikely bfs error check Waiman Long
2021-06-16 14:59   ` Xiongwei Song
2021-06-16 15:11     ` Waiman Long
2021-06-17  2:14       ` Xiongwei Song

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='CAEVVKH8n5ntPVOP=X9bPGoK4xdE-Z-XHKSFsoGOaLpke+uZoqg@mail.gmail.com' \
    --to=sxwjean@gmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=sxwjean@me.com \
    --cc=will@kernel.org \
    /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 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).