public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Fox Chen <foxhlchen@gmail.com>
Cc: gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] kernfs: replace the mutex in kernfs_iop_permission with a rwlock
Date: Wed, 2 Dec 2020 13:34:10 -0500	[thread overview]
Message-ID: <X8feIjdsi6xlGLv6@mtj.duckdns.org> (raw)
In-Reply-To: <20201202145837.48040-2-foxhlchen@gmail.com>

Hello,

On Wed, Dec 02, 2020 at 10:58:36PM +0800, Fox Chen wrote:
> @@ -121,7 +121,7 @@ int kernfs_iop_setattr(struct dentry *dentry, struct iattr *iattr)
>  	if (!kn)
>  		return -EINVAL;
>  
> -	mutex_lock(&kernfs_mutex);
> +	write_lock(&kn->iattr_rwlock);
>  	error = setattr_prepare(dentry, iattr);
>  	if (error)
>  		goto out;
> @@ -134,7 +134,7 @@ int kernfs_iop_setattr(struct dentry *dentry, struct iattr *iattr)
>  	setattr_copy(inode, iattr);
>  
>  out:
> -	mutex_unlock(&kernfs_mutex);
> +	write_unlock(&kn->iattr_rwlock);
>  	return error;
>  }

This is putting GFP_KERNEL allocation inside a rwlock. Can you please test
with debug options including LOCKDEP and DEBUG_ATOMIC_SLEEP turned on?

Thanks.

-- 
tejun

  parent reply	other threads:[~2020-12-02 18:35 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-02 14:58 [PATCH 0/2] kernfs: speed up concurrency performance Fox Chen
2020-12-02 14:58 ` [PATCH 1/2] kernfs: replace the mutex in kernfs_iop_permission with a rwlock Fox Chen
2020-12-02 18:27   ` Greg KH
2020-12-02 18:34   ` Tejun Heo [this message]
2020-12-02 18:37   ` Tejun Heo
2020-12-03  6:34     ` Fox Chen
2020-12-03  7:19   ` [kernfs] d680236464: BUG:sleeping_function_called_from_invalid_context_at_kernel/locking/mutex.c kernel test robot
2020-12-02 14:58 ` [PATCH 2/2] kernfs: remove mutex in kernfs_dop_revalidate Fox Chen
2020-12-02 18:27   ` Greg KH
2020-12-03  6:35     ` Fox Chen
2020-12-02 18:46   ` Tejun Heo
2020-12-03  6:44     ` Fox Chen
2020-12-02 18:29 ` [PATCH 0/2] kernfs: speed up concurrency performance Greg KH
2020-12-03  6:38   ` Fox Chen

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=X8feIjdsi6xlGLv6@mtj.duckdns.org \
    --to=tj@kernel.org \
    --cc=foxhlchen@gmail.com \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.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