All of lore.kernel.org
 help / color / mirror / Atom feed
From: Waiman Long <longman@redhat.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	Peter Zijlstra <peterz@infradead.org>
Cc: Dmitry Vyukov <dvyukov@google.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	Linux-MM <linux-mm@kvack.org>, Ingo Molnar <mingo@redhat.com>,
	Will Deacon <will.deacon@arm.com>
Subject: Re: [PATCH] lockdep: Add debug printk() for downgrade_write() warning.
Date: Wed, 9 Jan 2019 13:22:52 -0500	[thread overview]
Message-ID: <2102acfa-72c1-6540-a434-90eea26aa732@redhat.com> (raw)
In-Reply-To: <162036ee-81f1-36b1-7658-15a5f98c7d29@i-love.sakura.ne.jp>

On 01/09/2019 06:47 AM, Tetsuo Handa wrote:
> Hello, Peter.
>
> We got two reports. Neither RWSEM_READER_OWNED nor RWSEM_ANONYMOUSLY_OWNED is set, and
> (presumably) sem->owner == current is true, but count is -1. What does this mean?
>
> https://syzkaller.appspot.com/text?tag=CrashLog&x=169dbb9b400000
>
> [ 2580.337550][ T3645] mmap_sem: hlock->read=1 count=-4294967295 current=ffff888050e04140, owner=ffff888050e04140
> [ 2580.353526][ T3645] ------------[ cut here ]------------
> [ 2580.367859][ T3645] downgrading a read lock
> [ 2580.367935][ T3645] WARNING: CPU: 1 PID: 3645 at kernel/locking/lockdep.c:3572 lock_downgrade+0x35d/0xbe0
> [ 2580.382206][ T3645] Kernel panic - not syncing: panic_on_warn set ...
>
> https://syzkaller.appspot.com/text?tag=CrashLog&x=1542da4f400000
>
> [  386.342585][T16698] mmap_sem: hlock->read=1 count=-4294967295 current=ffff8880512ae180, owner=ffff8880512ae180
> [  386.348586][T16698] ------------[ cut here ]------------
> [  386.357203][T16698] downgrading a read lock
> [  386.357294][T16698] WARNING: CPU: 1 PID: 16698 at kernel/locking/lockdep.c:3572 lock_downgrade+0x35d/0xbe0
> [  386.372148][T16698] Kernel panic - not syncing: panic_on_warn set ...
>
>
A call to up_read() while the count was previously 0 will cause the
count to become -1. I would suggest adding some debug code in up_read()
to catch the offending caller.

Cheers,
Longman

  reply	other threads:[~2019-01-09 18:22 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1546771139-9349-1-git-send-email-penguin-kernel@I-love.SAKURA.ne.jp>
     [not found] ` <e1a38e21-d5fe-dee3-7081-bc1a12965a68@i-love.sakura.ne.jp>
2019-01-07  4:19   ` Andrew Morton
2019-01-07  5:58     ` Dmitry Vyukov
2019-01-07  5:58       ` Dmitry Vyukov
2019-01-09 11:47       ` Tetsuo Handa
2019-01-09 18:22         ` Waiman Long [this message]
2019-01-10 10:12       ` Tetsuo Handa

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=2102acfa-72c1-6540-a434-90eea26aa732@redhat.com \
    --to=longman@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=dvyukov@google.com \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=peterz@infradead.org \
    --cc=will.deacon@arm.com \
    --subject='Re: [PATCH] lockdep: Add debug printk() for downgrade_write() warning.' \
    /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

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.