linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Kara <jack@suse.cz>
To: Oleg Nesterov <oleg@redhat.com>
Cc: Amir Goldstein <amir73il@gmail.com>,
	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: Mon, 14 May 2018 11:50:22 +0200	[thread overview]
Message-ID: <20180514095022.nfp7vuepz4kfshni@quack2.suse.cz> (raw)
In-Reply-To: <20180513160404.GA19620@redhat.com>

On Sun 13-05-18 18:04:04, Oleg Nesterov wrote:
> 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.

Yeah, what you suggests seems reasonable to me. So feel free to add:

Acked-by: Jan Kara <jack@suse.cz>
	
								Honza

> --- 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
> 
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR

  reply	other threads:[~2018-05-14  9:50 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-13 14:02 DEBUG_RWSEMS warning from thaw_super() Amir Goldstein
2018-05-13 16:04 ` Oleg Nesterov
2018-05-14  9:50   ` Jan Kara [this message]
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=20180514095022.nfp7vuepz4kfshni@quack2.suse.cz \
    --to=jack@suse.cz \
    --cc=amir73il@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longman@redhat.com \
    --cc=mingo@kernel.org \
    --cc=oleg@redhat.com \
    --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;
as well as URLs for NNTP newsgroup(s).