From: Leon Romanovsky <leon@kernel.org>
To: ira.weiny@intel.com
Cc: dledford@redhat.com, linux-rdma@vger.kernel.org,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
stable@vger.kernel.org
Subject: Re: [PATCH V2] IB/hfi1,IB/qib: Fix qp_stats sleep with rcu read lock held
Date: Sun, 14 Aug 2016 11:55:11 +0300 [thread overview]
Message-ID: <20160814085511.GB21270@leon.nu> (raw)
In-Reply-To: <1471015057-9886-1-git-send-email-ira.weiny@intel.com>
[-- Attachment #1: Type: text/plain, Size: 1384 bytes --]
On Fri, Aug 12, 2016 at 11:17:37AM -0400, ira.weiny@intel.com wrote:
> From: Mike Marciniszyn <mike.marciniszyn@intel.com>
>
> The qp init function does a kzalloc() while holding the RCU
> lock that encounters the following warning with a debug kernel
> when a cat of the qp_stats is done:
>
> [ 231.723948] rcu_scheduler_active = 1, debug_locks = 0
> [ 231.731939] 3 locks held by cat/11355:
> [ 231.736492] #0: (debugfs_srcu){......}, at: [<ffffffff813001a5>] debugfs_use_file_start+0x5/0x90
> [ 231.746955] #1: (&p->lock){+.+.+.}, at: [<ffffffff81289a6c>] seq_read+0x4c/0x3c0
> [ 231.755873] #2: (rcu_read_lock){......}, at: [<ffffffffa0a0c535>] _qp_stats_seq_start+0x5/0xd0 [hfi1]
> [ 231.766862]
>
> The init functions do an implicit next which requires the rcu read lock
> before the kzalloc().
>
> Fix for both drivers is to change the scope of the init function to only
> do the allocation and the initialization of the just allocated iter.
>
> The implict next is moved back into the respective start functions to fix
> the issue.
>
> Signed-off-by: Ira Weiny <ira.weiny@intel.com>
> Signed-off-by: Mike Marciniszyn <mike.marciniszyn@intel.com>
> CC: <stable@vger.kernel.org> # 4.6.x-
>
> ---
> Changes from V1:
> use do.. while loop to execute first iter call.
Thanks,
Reviewed-by: Leon Romanovsky <leonro@mellanox.com>
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2016-08-14 8:55 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-12 15:17 [PATCH V2] IB/hfi1,IB/qib: Fix qp_stats sleep with rcu read lock held ira.weiny
2016-08-14 8:55 ` Leon Romanovsky [this message]
2016-08-22 18:32 ` Doug Ledford
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=20160814085511.GB21270@leon.nu \
--to=leon@kernel.org \
--cc=dledford@redhat.com \
--cc=ira.weiny@intel.com \
--cc=linux-rdma@vger.kernel.org \
--cc=mike.marciniszyn@intel.com \
--cc=stable@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