All of lore.kernel.org
 help / color / mirror / Atom feed
From: Doug Ledford <dledford@redhat.com>
To: Leon Romanovsky <leon@kernel.org>, ira.weiny@intel.com
Cc: 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: Mon, 22 Aug 2016 14:32:23 -0400	[thread overview]
Message-ID: <c67f0026-691c-b13a-eae7-109a5ebc4016@redhat.com> (raw)
In-Reply-To: <20160814085511.GB21270@leon.nu>


[-- Attachment #1.1: Type: text/plain, Size: 1596 bytes --]

On 8/14/2016 4:55 AM, Leon Romanovsky wrote:
> 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>
> 

Sorry, responded to v1 email, but I applied the v2 patch.

-- 
Doug Ledford <dledford@redhat.com>
    GPG Key ID: 0E572FDD


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 884 bytes --]

      reply	other threads:[~2016-08-22 18:32 UTC|newest]

Thread overview: 4+ 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-12 15:17 ` ira.weiny
2016-08-14  8:55 ` Leon Romanovsky
2016-08-22 18:32   ` Doug Ledford [this message]

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=c67f0026-691c-b13a-eae7-109a5ebc4016@redhat.com \
    --to=dledford@redhat.com \
    --cc=ira.weiny@intel.com \
    --cc=leon@kernel.org \
    --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 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.