All of lore.kernel.org
 help / color / mirror / Atom feed
* [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock
@ 2010-12-08 12:34 Wengang Wang
  2010-12-08 18:07 ` Joel Becker
  2010-12-16  8:52 ` Joel Becker
  0 siblings, 2 replies; 6+ messages in thread
From: Wengang Wang @ 2010-12-08 12:34 UTC (permalink / raw)
  To: ocfs2-devel

Make existing convertion precedent over new lock. It makes o2dlm locking more
like fair locking.

Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
---
 fs/ocfs2/dlm/dlmlock.c |    3 +++
 1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
index 69cf369..7009292 100644
--- a/fs/ocfs2/dlm/dlmlock.c
+++ b/fs/ocfs2/dlm/dlmlock.c
@@ -106,6 +106,9 @@ static int dlm_can_grant_new_lock(struct dlm_lock_resource *res,
 
 		if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type))
 			return 0;
+		if (!dlm_lock_compatible(tmplock->ml.convert_type,
+					 lock->ml.type))
+			return 0;
 	}
 
 	return 1;
-- 
1.7.2.3

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock
  2010-12-08 12:34 [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock Wengang Wang
@ 2010-12-08 18:07 ` Joel Becker
  2010-12-08 18:12   ` Joel Becker
  2010-12-16  8:52 ` Joel Becker
  1 sibling, 1 reply; 6+ messages in thread
From: Joel Becker @ 2010-12-08 18:07 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Dec 08, 2010 at 08:34:39PM +0800, Wengang Wang wrote:
> Make existing convertion precedent over new lock. It makes o2dlm locking more
> like fair locking.

	Is this a problem you were solving, or just something you
thought about while reading the code?  If it was a problem you ran
into, can you give the details?

Joel

> 
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>
> ---
>  fs/ocfs2/dlm/dlmlock.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
> index 69cf369..7009292 100644
> --- a/fs/ocfs2/dlm/dlmlock.c
> +++ b/fs/ocfs2/dlm/dlmlock.c
> @@ -106,6 +106,9 @@ static int dlm_can_grant_new_lock(struct dlm_lock_resource *res,
>  
>  		if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type))
>  			return 0;
> +		if (!dlm_lock_compatible(tmplock->ml.convert_type,
> +					 lock->ml.type))
> +			return 0;
>  	}
>  
>  	return 1;
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

-- 

Life's Little Instruction Book #207

	"Swing for the fence."

Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock
  2010-12-08 18:07 ` Joel Becker
@ 2010-12-08 18:12   ` Joel Becker
  2010-12-08 18:30     ` Sunil Mushran
  0 siblings, 1 reply; 6+ messages in thread
From: Joel Becker @ 2010-12-08 18:12 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Dec 08, 2010 at 10:07:57AM -0800, Joel Becker wrote:
> On Wed, Dec 08, 2010 at 08:34:39PM +0800, Wengang Wang wrote:
> > Make existing convertion precedent over new lock. It makes o2dlm locking more
> > like fair locking.
> 
> 	Is this a problem you were solving, or just something you
> thought about while reading the code?  If it was a problem you ran
> into, can you give the details?

	It looks like you're just emulating the logic from
__dlmconvert_master().  That makes sense.

Joel

-- 

Life's Little Instruction Book #274

	"Leave everything a little better than you found it."

Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock
  2010-12-08 18:12   ` Joel Becker
@ 2010-12-08 18:30     ` Sunil Mushran
  2010-12-09  1:33       ` Wengang Wang
  0 siblings, 1 reply; 6+ messages in thread
From: Sunil Mushran @ 2010-12-08 18:30 UTC (permalink / raw)
  To: ocfs2-devel

On 12/08/2010 10:12 AM, Joel Becker wrote:
> On Wed, Dec 08, 2010 at 10:07:57AM -0800, Joel Becker wrote:
>> On Wed, Dec 08, 2010 at 08:34:39PM +0800, Wengang Wang wrote:
>>> Make existing convertion precedent over new lock. It makes o2dlm locking more
>>> like fair locking.
>> 	Is this a problem you were solving, or just something you
>> thought about while reading the code?  If it was a problem you ran
>> into, can you give the details?
> 	It looks like you're just emulating the logic from
> __dlmconvert_master().  That makes sense.

This fix is an offshoot of the conversation in his thread.
http://oss.oracle.com/pipermail/ocfs2-devel/2010-November/007524.html

The fix looks ok. But I would rather that we confirm this problem and the
fix before we push it upstream.

Wengang, Have you attempted to reproduce the problem and/or test the fix?

Sunil

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock
  2010-12-08 18:30     ` Sunil Mushran
@ 2010-12-09  1:33       ` Wengang Wang
  0 siblings, 0 replies; 6+ messages in thread
From: Wengang Wang @ 2010-12-09  1:33 UTC (permalink / raw)
  To: ocfs2-devel

Hi Sunil/Joel,

On 10-12-08 10:30, Sunil Mushran wrote:
> On 12/08/2010 10:12 AM, Joel Becker wrote:
> >On Wed, Dec 08, 2010 at 10:07:57AM -0800, Joel Becker wrote:
> >>On Wed, Dec 08, 2010 at 08:34:39PM +0800, Wengang Wang wrote:
> >>>Make existing convertion precedent over new lock. It makes o2dlm locking more
> >>>like fair locking.
> >>	Is this a problem you were solving, or just something you
> >>thought about while reading the code?  If it was a problem you ran
> >>into, can you give the details?
> >	It looks like you're just emulating the logic from
> >__dlmconvert_master().  That makes sense.
> 
> This fix is an offshoot of the conversation in his thread.
> http://oss.oracle.com/pipermail/ocfs2-devel/2010-November/007524.html

Yes. The patch tries to fix that problem.
 
> The fix looks ok. But I would rather that we confirm this problem and the
> fix before we push it upstream.

Yes, understand. 
> Wengang, Have you attempted to reproduce the problem and/or test the fix?

I didn't let ct to test the patch yet. I can't reproduce it in house.
What I tested is very common test cases, such as parallel listing and
parallel kernel compiling.

I will let ct test with the patch. But since it's not a frequently
hit problem, not easy to say if the patch works....

What's the idea for such cases?

regards,
wengang.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock
  2010-12-08 12:34 [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock Wengang Wang
  2010-12-08 18:07 ` Joel Becker
@ 2010-12-16  8:52 ` Joel Becker
  1 sibling, 0 replies; 6+ messages in thread
From: Joel Becker @ 2010-12-16  8:52 UTC (permalink / raw)
  To: ocfs2-devel

On Wed, Dec 08, 2010 at 08:34:39PM +0800, Wengang Wang wrote:
> Make existing convertion precedent over new lock. It makes o2dlm locking more
> like fair locking.
> 
> Signed-off-by: Wengang Wang <wen.gang.wang@oracle.com>

This is now in the merge-window branch of ocfs2.git.

Joel

> ---
>  fs/ocfs2/dlm/dlmlock.c |    3 +++
>  1 files changed, 3 insertions(+), 0 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmlock.c b/fs/ocfs2/dlm/dlmlock.c
> index 69cf369..7009292 100644
> --- a/fs/ocfs2/dlm/dlmlock.c
> +++ b/fs/ocfs2/dlm/dlmlock.c
> @@ -106,6 +106,9 @@ static int dlm_can_grant_new_lock(struct dlm_lock_resource *res,
>  
>  		if (!dlm_lock_compatible(tmplock->ml.type, lock->ml.type))
>  			return 0;
> +		if (!dlm_lock_compatible(tmplock->ml.convert_type,
> +					 lock->ml.type))
> +			return 0;
>  	}
>  
>  	return 1;
> -- 
> 1.7.2.3
> 
> 
> _______________________________________________
> Ocfs2-devel mailing list
> Ocfs2-devel at oss.oracle.com
> http://oss.oracle.com/mailman/listinfo/ocfs2-devel

-- 

You can use a screwdriver to screw in screws or to clean your ears,
however, the latter needs real skill, determination and a lack of fear
of injuring yourself.  It is much the same with JavaScript.
	- Chris Heilmann

Joel Becker
Senior Development Manager
Oracle
E-mail: joel.becker at oracle.com
Phone: (650) 506-8127

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2010-12-16  8:52 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-12-08 12:34 [Ocfs2-devel] [PATCH] ocfs2/dlm: make existing convertion precedent over new lock Wengang Wang
2010-12-08 18:07 ` Joel Becker
2010-12-08 18:12   ` Joel Becker
2010-12-08 18:30     ` Sunil Mushran
2010-12-09  1:33       ` Wengang Wang
2010-12-16  8:52 ` Joel Becker

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.