Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1584011 > unrolled thread

[PATCH 12/14] staging: lustre: llog: change lgh_hdr_lock to mutex

Started byJames Simmons <jsimmons@infradead.org>
First post2017-02-18 23:00 +0100
Last post2017-02-24 18:00 +0100
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  [PATCH 12/14] staging: lustre: llog: change lgh_hdr_lock to mutex James Simmons <jsimmons@infradead.org> - 2017-02-18 23:00 +0100
    Re: [PATCH 12/14] staging: lustre: llog: change lgh_hdr_lock to mutex Greg Kroah-Hartman <gregkh@linuxfoundation.org> - 2017-02-24 18:00 +0100

#1584011 — [PATCH 12/14] staging: lustre: llog: change lgh_hdr_lock to mutex

FromJames Simmons <jsimmons@infradead.org>
Date2017-02-18 23:00 +0100
Subject[PATCH 12/14] staging: lustre: llog: change lgh_hdr_lock to mutex
Message-ID<tclcS-7hi-13@gated-at.bofh.it>
From: wang di <di.wang@intel.com>

Change lgh_hdr_lock from spinlock to mutex because if
the llog object is a remote object it can be stalled
while being fetched.

Signed-off-by: wang di <di.wang@intel.com>
Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6602
Reviewed-on: http://review.whamcloud.com/15274
Reviewed-by: James Simmons <uja.ornl@yahoo.com>
Reviewed-by: Lai Siyao <lai.siyao@intel.com>
Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
Signed-off-by: James Simmons <jsimmons@infradead.org>
---
 drivers/staging/lustre/lustre/include/lustre_log.h | 2 +-
 drivers/staging/lustre/lustre/obdclass/llog.c      | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h
index 35e37eb..33f56ff 100644
--- a/drivers/staging/lustre/lustre/include/lustre_log.h
+++ b/drivers/staging/lustre/lustre/include/lustre_log.h
@@ -211,7 +211,7 @@ struct llog_operations {
 /* In-memory descriptor for a log object or log catalog */
 struct llog_handle {
 	struct rw_semaphore	 lgh_lock;
-	spinlock_t		 lgh_hdr_lock; /* protect lgh_hdr data */
+	struct mutex		 lgh_hdr_mutex; /* protect lgh_hdr data */
 	struct llog_logid	 lgh_id; /* id of this log */
 	struct llog_log_hdr	*lgh_hdr;
 	size_t			 lgh_hdr_size;
diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c
index 736ea10..83c5b62 100644
--- a/drivers/staging/lustre/lustre/obdclass/llog.c
+++ b/drivers/staging/lustre/lustre/obdclass/llog.c
@@ -61,7 +61,7 @@ static struct llog_handle *llog_alloc_handle(void)
 		return NULL;
 
 	init_rwsem(&loghandle->lgh_lock);
-	spin_lock_init(&loghandle->lgh_hdr_lock);
+	mutex_init(&loghandle->lgh_hdr_mutex);
 	INIT_LIST_HEAD(&loghandle->u.phd.phd_entry);
 	atomic_set(&loghandle->lgh_refcount, 1);
 
-- 
1.8.3.1

[toc] | [next] | [standalone]


#1587797

FromGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Date2017-02-24 18:00 +0100
Message-ID<ternP-2WZ-7@gated-at.bofh.it>
In reply to#1584011
On Sat, Feb 18, 2017 at 04:47:13PM -0500, James Simmons wrote:
> From: wang di <di.wang@intel.com>
> 
> Change lgh_hdr_lock from spinlock to mutex because if
> the llog object is a remote object it can be stalled
> while being fetched.

but this lock is never even used!  Why have it at all?

> 
> Signed-off-by: wang di <di.wang@intel.com>
> Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6602
> Reviewed-on: http://review.whamcloud.com/15274
> Reviewed-by: James Simmons <uja.ornl@yahoo.com>
> Reviewed-by: Lai Siyao <lai.siyao@intel.com>
> Reviewed-by: Oleg Drokin <oleg.drokin@intel.com>
> Signed-off-by: James Simmons <jsimmons@infradead.org>
> ---
>  drivers/staging/lustre/lustre/include/lustre_log.h | 2 +-
>  drivers/staging/lustre/lustre/obdclass/llog.c      | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/staging/lustre/lustre/include/lustre_log.h b/drivers/staging/lustre/lustre/include/lustre_log.h
> index 35e37eb..33f56ff 100644
> --- a/drivers/staging/lustre/lustre/include/lustre_log.h
> +++ b/drivers/staging/lustre/lustre/include/lustre_log.h
> @@ -211,7 +211,7 @@ struct llog_operations {
>  /* In-memory descriptor for a log object or log catalog */
>  struct llog_handle {
>  	struct rw_semaphore	 lgh_lock;
> -	spinlock_t		 lgh_hdr_lock; /* protect lgh_hdr data */
> +	struct mutex		 lgh_hdr_mutex; /* protect lgh_hdr data */
>  	struct llog_logid	 lgh_id; /* id of this log */
>  	struct llog_log_hdr	*lgh_hdr;
>  	size_t			 lgh_hdr_size;
> diff --git a/drivers/staging/lustre/lustre/obdclass/llog.c b/drivers/staging/lustre/lustre/obdclass/llog.c
> index 736ea10..83c5b62 100644
> --- a/drivers/staging/lustre/lustre/obdclass/llog.c
> +++ b/drivers/staging/lustre/lustre/obdclass/llog.c
> @@ -61,7 +61,7 @@ static struct llog_handle *llog_alloc_handle(void)
>  		return NULL;
>  
>  	init_rwsem(&loghandle->lgh_lock);
> -	spin_lock_init(&loghandle->lgh_hdr_lock);
> +	mutex_init(&loghandle->lgh_hdr_mutex);

Can't we delete it?

thanks,

greg k-h

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web