public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <Bart.VanAssche@wdc.com>
To: Damien Le Moal <Damien.LeMoal@wdc.com>,
	"martin.petersen@oracle.com" <martin.petersen@oracle.com>
Cc: "jejb@linux.vnet.ibm.com" <jejb@linux.vnet.ibm.com>,
	"linux-scsi@vger.kernel.org" <linux-scsi@vger.kernel.org>,
	"hare@suse.com" <hare@suse.com>,
	"jthumshirn@suse.de" <jthumshirn@suse.de>,
	"ptikhomirov@virtuozzo.com" <ptikhomirov@virtuozzo.com>,
	"ncopa@alpinelinux.org" <ncopa@alpinelinux.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH] Avoid that ATA error handling hangs
Date: Thu, 22 Feb 2018 04:39:59 +0000	[thread overview]
Message-ID: <1519274398.3258.8.camel@wdc.com> (raw)
In-Reply-To: <1519274342.3258.7.camel@wdc.com>

On Thu, 2018-02-22 at 04:39 +0000, Bart Van Assche wrote:
> On Thu, 2018-02-22 at 04:19 +0000, Damien Le Moal wrote:
> > It looks OK to me, at least if CONFIG_DEBUG_OBJECTS_RCU_HEAD is turned
> > off since the init_rcu_head() and destroy_rcu_head() functions only care
> > about that.
> > 
> > With rcu head debug turned on, I am not so sure. The object debug code
> > will have references to unused rcu heads left behind for unused scsi
> > cmds, which are indeed dynamically allocated for a device together with
> > requests when the device is initialized, but they are never freed until
> > the device is removed. So "dynamically allocated object", yes, but that
> > does not match the use of the object done in scsi (i.e. alloc before use
> > + free after use).
> 
> Hello Damien,
> 
> Please have a look at the following part of
> Documentation/RCU/Design/Requirements/Requirements.html:
> 
> 	Similarly, statically allocated non-stack <tt>rcu_head</tt>
> 	structures must be initialized with <tt>init_rcu_head()</tt>
> 	and cleaned up with <tt>destroy_rcu_head()</tt>.

And from <linux/rcupdate.h>:

 * rcu_head structures
 * allocated dynamically in the heap or defined statically don't need any
 * initialization.

Bart.

  reply	other threads:[~2018-02-22  4:40 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 17:23 [PATCH] Avoid that ATA error handling hangs Bart Van Assche
2018-02-22  2:23 ` Damien Le Moal
2018-02-22  3:53   ` Bart Van Assche
2018-02-22  4:06     ` Martin K. Petersen
2018-02-22  4:19       ` Damien Le Moal
2018-02-22  4:39         ` Bart Van Assche
2018-02-22  4:39           ` Bart Van Assche [this message]
2018-02-22  4:55             ` Damien Le Moal
2018-02-22 17:15     ` Natanael Copa

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=1519274398.3258.8.camel@wdc.com \
    --to=bart.vanassche@wdc.com \
    --cc=Damien.LeMoal@wdc.com \
    --cc=hare@suse.com \
    --cc=jejb@linux.vnet.ibm.com \
    --cc=jthumshirn@suse.de \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    --cc=ncopa@alpinelinux.org \
    --cc=ptikhomirov@virtuozzo.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