All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bart.vanassche@sandisk.com>
To: Hannes Reinecke <hare@suse.de>,
	"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: Christoph Hellwig <hch@lst.de>, Ewan Milne <emilne@redhat.com>,
	James Bottomley <james.bottomley@hansenpartnership.com>,
	linux-scsi@vger.kernel.orgEwan Milne <emilne@redhat.com>
Subject: Re: [PATCH] libfc: replace 'rp_mutex' with 'rp_lock'
Date: Tue, 10 May 2016 11:33:07 -0700	[thread overview]
Message-ID: <57322963.7040507@sandisk.com> (raw)
In-Reply-To: <1461571293-953-1-git-send-email-hare@suse.de>

On 04/25/2016 01:01 AM, Hannes Reinecke wrote:
> We cannot use an embedded mutex in a structure with reference
> counting, as mutex unlock might be delayed, and the waiters
> might then access an already freed memory area.
> So convert it to a spinlock.
 >
 > For details cf https://lkml.org/lkml/2015/2/11/245

Hello Hannes,

Is what you describe a theoretical concern or have you observed any 
issues that could have been caused by the rport mutex? I'm asking this 
because my interpretation of the thread you refer to is different. My 
conclusion is that it is safe to embed a mutex in a structure that uses 
reference counting but that the mutex_unlock() call may trigger a 
spurious wakeup. I think that the conclusion of that thread was that 
glibc and kernel code should tolerate such spurious wakeups.

Bart.

  parent reply	other threads:[~2016-05-10 18:33 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25  8:01 [PATCH] libfc: replace 'rp_mutex' with 'rp_lock' Hannes Reinecke
2016-04-25 20:26 ` Ewan D. Milne
2016-05-09 12:29 ` Johannes Thumshirn
2016-05-10 18:33 ` Bart Van Assche [this message]
2016-05-11  1:48   ` Martin K. Petersen
2016-05-11  5:49   ` Hannes Reinecke
2016-05-11  6:07     ` Hannes Reinecke
2016-05-11 14:44       ` Bart Van Assche
2016-05-17  6:46         ` Hannes Reinecke
2016-05-17 18:04           ` Bart Van Assche

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=57322963.7040507@sandisk.com \
    --to=bart.vanassche@sandisk.com \
    --cc=emilne@redhat.com \
    --cc=hare@suse.de \
    --cc=hch@lst.de \
    --cc=james.bottomley@hansenpartnership.com \
    --cc=linux-scsi@vger.kernel.orgEwan \
    --cc=martin.petersen@oracle.com \
    /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.