From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751284AbdBXQ7A (ORCPT ); Fri, 24 Feb 2017 11:59:00 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:35838 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751169AbdBXQ6y (ORCPT ); Fri, 24 Feb 2017 11:58:54 -0500 Date: Fri, 24 Feb 2017 17:58:29 +0100 From: Greg Kroah-Hartman To: James Simmons Cc: devel@driverdev.osuosl.org, Andreas Dilger , Oleg Drokin , wang di , Linux Kernel Mailing List , Lustre Development List Subject: Re: [PATCH 12/14] staging: lustre: llog: change lgh_hdr_lock to mutex Message-ID: <20170224165829.GA9990@kroah.com> References: <1487454435-4895-1-git-send-email-jsimmons@infradead.org> <1487454435-4895-13-git-send-email-jsimmons@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1487454435-4895-13-git-send-email-jsimmons@infradead.org> User-Agent: Mutt/1.7.2 (2016-11-26) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Feb 18, 2017 at 04:47:13PM -0500, James Simmons wrote: > From: wang di > > 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 > Intel-bug-id: https://jira.hpdd.intel.com/browse/LU-6602 > Reviewed-on: http://review.whamcloud.com/15274 > Reviewed-by: James Simmons > Reviewed-by: Lai Siyao > Reviewed-by: Oleg Drokin > Signed-off-by: James Simmons > --- > 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