From: yangwenfang <vicky.yangwenfang@huawei.com>
To: ocfs2-devel@oss.oracle.com
Subject: [Ocfs2-devel] [RFC] ocfs2/dlm: support range lock
Date: Thu, 29 Jan 2015 15:47:52 +0800 [thread overview]
Message-ID: <54C9E5A8.8060804@huawei.com> (raw)
In-Reply-To: <54C9794B.9000708@suse.de>
On 2015/1/29 8:05, Goldwyn Rodrigues wrote:
>
> Hi Yangwenfang,
>
> I appreciate the effort in this regard.
>
> On 01/26/2015 06:28 AM, yangwenfang wrote:
>> What:
>> Byte range lock is applied to lock a region of a file to accelerate
>> reading/writing concurrently.
>> Each lock resource deploys an interval tree to manage the range, which
>> supports basic operations like add, delete, insert, find, split and merge.
>> The most important issue is to determine the existance of conflicts
>> among the ranges. Conflict-free ranges of the same file can be accessed
>> concurrently. In the contrary, nodes must wait for the release of a
>> conflicted lock before accessing the range of file.
>>
>> Byte range lock supports split and merge rules: for same level, larger
>> scope; different level, write > read(If a node keeps EX lock with
>> range(start,end), then it has PR range lock(start,end)).
>> For example:
>> (1) merge: N1 keeps range lock (0,9)PR and (5,19)PR, the lock is merged into
>> (0,19) PR;
>> (2) merge: N1 keeps range lock (0,9)PR and (5,19)EX, the merged lock should
>> become(0,19) PR, (5,19)EX;
>> (3) split: N1 keeps range lock (0,9)PR, N2 tries to lock(0,5) PR, N1 should
>> split the lock and keep (6,9)PR.
>
> What is the purpose of doing this kind of merge/split? I assume this will be required in case of multiple processes from the same node read/write to the file. Would it not be simpler to not merge or split and keep separate instances in lock resources? This way you would have to do relatively lesser book keeping with respect to comparisons.
>
Hi,
Realization of this kind of merge/split is for cache of range lock to support unlock-delay.
For example(the granularity is block size)
1.Node 1 writes to 0-9, it will keep the range lock(0,9,EX) if no other node write the same range of file.
2.Node 1 writes to 10-19, then the range lock will be merged into (0,19,EX). if not, the number of locks will be more and more.
3.Node 1 writes to 5-10, then no need to dlmlock from master.
3.Node 2 writes to 5-10, conflict with Node 1, so Node 1 will drop (5,10), the range lock is splitted into (0,4) and (11,19).
> Are these numbers in your pseudocode byte ranges? If yes, how do you propose multiple writes which lie within a block_size/cluster_size range?
>
No, the granularity of these numbers is block size or PAGE_SIZE. The granularity is smaller, the conflict is more. Actually, we use 1M in our test.
thanks,
yangwenfang
next prev parent reply other threads:[~2015-01-29 7:47 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-26 12:28 [Ocfs2-devel] [RFC] ocfs2/dlm: support range lock yangwenfang
2015-01-27 7:08 ` Srinivas Eeda
2015-01-29 6:42 ` yangwenfang
2015-01-29 11:04 ` Goldwyn Rodrigues
2015-01-30 2:59 ` Xue jiufei
2015-01-30 12:37 ` Goldwyn Rodrigues
2015-01-31 4:15 ` yangwenfang
2015-01-29 11:07 ` Goldwyn Rodrigues
2015-01-29 0:05 ` Goldwyn Rodrigues
2015-01-29 3:21 ` Wengang Wang
2015-01-29 7:47 ` yangwenfang [this message]
2015-01-29 8:06 ` Wengang Wang
2015-01-30 3:54 ` yangwenfang
2015-01-30 6:02 ` Wengang Wang
2015-01-30 7:46 ` yangwenfang
-- strict thread matches above, loose matches on Subject: below --
2015-01-28 8:43 David Weber
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=54C9E5A8.8060804@huawei.com \
--to=vicky.yangwenfang@huawei.com \
--cc=ocfs2-devel@oss.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.