mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@redhat.com>
To: Amir Goldstein <amir73il@gmail.com>
Cc: Waiman Long <longman@redhat.com>, Ingo Molnar <mingo@kernel.org>,
	linux-fsdevel <linux-fsdevel@vger.kernel.org>,
	linux-kernel <linux-kernel@vger.kernel.org>,
	Jan Kara <jack@suse.cz>, Al Viro <viro@zeniv.linux.org.uk>
Subject: Re: DEBUG_RWSEMS warning from thaw_super()
Date: Sun, 13 May 2018 18:04:04 +0200	[thread overview]
Message-ID: <20180513160404.GA19620@redhat.com> (raw)
In-Reply-To: <CAOQ4uxgxP-0OZzT866=RR5rGQZ89EOy-mFF50v_5Y644OrV7tA@mail.gmail.com>

On 05/13, Amir Goldstein wrote:
>
> Since kernel v4.17-rc1 and DEBUG_RWSEMS, I see the
> warning below after filesystem freeze/thaw.
>
> This is a case where one process acquires a bunch of rwsem
> and another process releases them.
>
> To convey this use case to lockdep, freeze_super() calls
> lockdep_sb_freeze_release() on exit and thaw_super()
> calls lockdep_sb_freeze_acquire() on entry.

This was already discussed, but I forgot the result...

So once again, why we can't simply update percpu_rwsem_acquire() ?
Or we can check CONFIG_RWSEM_SPIN_ON_OWNER to match percpu_rwsem_release(),
but CONFIG_DEBUG_RWSEMS explains the purpose better.

Oleg.

--- x/include/linux/percpu-rwsem.h
+++ x/include/linux/percpu-rwsem.h
@@ -141,6 +141,10 @@ static inline void percpu_rwsem_acquire(
 					bool read, unsigned long ip)
 {
 	lock_acquire(&sem->rw_sem.dep_map, 0, 1, read, 1, NULL, ip);
+#ifdef CONFIG_DEBUG_RWSEMS
+	if (!read)
+		sem->rw_sem.owner = current;
+#endif
 }
 
 #endif

  reply	other threads:[~2018-05-13 16:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-13 14:02 Amir Goldstein
2018-05-13 16:04 ` Oleg Nesterov [this message]
2018-05-14  9:50   ` Jan Kara
2018-05-14 11:32     ` Amir Goldstein
2018-05-14 11:51       ` Oleg Nesterov
2018-05-14 12:16         ` Amir Goldstein

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=20180513160404.GA19620@redhat.com \
    --to=oleg@redhat.com \
    --cc=amir73il@gmail.com \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@kernel.org \
    --cc=viro@zeniv.linux.org.uk \
    /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

all inboxes | Powered by JetHome®