From: Jun'ichi Nomura <j-nomura@ce.jp.nec.com>
To: lvm-devel@redhat.com
Subject: [PATCH LVM2] (0/12) LVM2 allocation rewrites
Date: Fri, 13 Oct 2006 16:54:19 -0400 [thread overview]
Message-ID: <452FFCFB.6090805@ce.jp.nec.com> (raw)
Hi,
This series of patches fix the following things:
- allocate mirror log on the same PV with mimage (--alloc anywhere)
- allocate from any available space (--alloc anywhere)
- correct allocation for converting linear LV to mirror LV
to avoid existing LV
- correct allocation for extending mirror LV to avoid
existing log LV
- generalize allocation logic to cover more complex allocation requests
Patches are applicable to 2.02.11.
Patches should be applied in this order.
Compilation test is done for all patches.
Simple tests of combination of lvcreate/lvextend/lvconvert and
linear/stripe/mirror/snapshot are done for the set of the patches.
What's changed
==============
01.for_each_pv.patch
- _for_each_pv() is extended to maintain global index of
flattened lv_segment
- _for_each_pv() accepts the range of indices to which
call back function is executed
02.alloc_requests.patch
- added struct allocation_requests and eliminate log device specific
elements from struct alloc_handle
- corresponding changes in several functions
03.remove_ix_offset.patch
- shrink the size of temporal array of areas
04.separate_constraints.patch
- move constraints checker out from _find_parallel_space()
05.prefer_small.patch
- allowing preference of small area (e.g. for log device)
06.add_pvs.patch
- move _add_pvs()
07.update_parallel.patch
- updating parallel_areas according to the on-going allocation
(_update_parallel_areas and other utility functions)
08.anywhere.patch
- added relax_allocation_requests() to split the allocation request
to cover anywhere policy
09.lvconvert.patch
- changed lvconvert to use build_parallel_areas_from_lv()
10.calcfree.patch
- calculate free pe count before trying allocation
11.log_coverage.patch
- reflect the fact that log pv constraints other areas regardless of
its range
12.sort_requests.patch
- sort allocation requests to pick up log area first
Background of these changes
===========================
Allow mirror log on the same device as mirror image
---------------------------------------------------
Current code takes the allocation request like this:
<n> areas with size <x> which are either striped or mirrored,
plus 1 area with size 1 for mirror log device
Then it tries to allocate <n> + 1 areas from different PVs.
The log device is handled as special case various places.
If you would like to allow log on the same device with others
but the others are on different PVs each other, you have to
add another special case handling of the log device.
Like the one posted here last month:
https://www.redhat.com/archives/linux-lvm/2006-September/msg00108.html
In 02.alloc_requests.patch, the allocation request is generalized
by struct allocation_request. The allocator will process <x> * <n>
request and then 1 * 1 request.
To allocate log device first, 12.sort_requests.patch sorts the
allocation requests.
Real 'anywhere' policy implementation
-------------------------------------
Since the current logic picks up the best areas from each PV
and matches them with allocation request, it doesn't work well
if the number of PVs is smaller than the requested areas.
This is acceptable restriction for normal case: it's not good to
allocate mirrors or stripes from same PV.
But for special case like 'anywhere' policy, this restriction
should be removed.
As the area list in the PV is sorted by size, it's easy to
pick up largest one for each PV.
However, it's takes cost to pick up <n> largest areas from <m>
PVs where <m> is smaller than <n>.
Rather than that, in 08.anywhere.patch, it splits the allocation
request into the smaller unit where <n> is smaller than <m>.
Allocation constraints
----------------------
The allocation code takes "parallel_areas" list as a constraint.
It avoids (a part of) PVs in the list.
However, the list was built only before starting the allocation.
So it cannot avoid parallel areas just being allocated.
For example, if you do 'lvcreate -m1', newly allocated mirror
images should avoid mirror log, or vise versa, but it can't.
07.update_parallel.patch updates the list after every allocation
to cope with this situation.
The other problem is that if you do 'lvextend' the mirror LV,
newly allocated extents should avoid mirror log.
But it can't because it can't distinguish mirror log in parallel_areas
list.
11.log_coverage.patch adds mirror log to the list to cover whole range
so that future mirror image allocation can avoid it.
--
Jun'ichi Nomura, NEC Corporation of America
next reply other threads:[~2006-10-13 20:54 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-10-13 20:54 Jun'ichi Nomura [this message]
2006-10-13 20:55 ` [PATCH LVM2] (1/12) add flattened index to _for_each_pv() Jun'ichi Nomura
2006-10-13 20:55 ` [PATCH LVM2] (2/12) rewrite with struct allocation request Jun'ichi Nomura
2006-10-13 20:57 ` [PATCH LVM2] (3/12) remove ix_offset from _find_parallel_space() Jun'ichi Nomura
2006-10-13 20:58 ` [PATCH LVM2] (4/12) separate constraints checker " Jun'ichi Nomura
2006-10-13 20:59 ` [PATCH LVM2] (5/12) allow preference to small area Jun'ichi Nomura
2006-10-13 21:00 ` [PATCH LVM2] (6/12) move _add_pvs() to the earlier part of the file Jun'ichi Nomura
2006-10-13 21:00 ` [PATCH LVM2] (7/12) update parallel_areas for on-going allocation Jun'ichi Nomura
2006-10-13 21:01 ` [PATCH LVM2] (8/12) 'anywhere' policy implementation Jun'ichi Nomura
2006-10-13 21:13 ` [PATCH LVM2] (9/12) lvconvert to use build_parallel_areas_from_lv() Jun'ichi Nomura
2006-10-13 21:14 ` [PATCH LVM2] (10/12) calculate free pe counts before allocation attempt Jun'ichi Nomura
2006-10-13 21:14 ` [PATCH LVM2] (11/12) extending parallel_area to cover log device Jun'ichi Nomura
2006-10-13 21:14 ` [PATCH LVM2] (12/12) sort the allocation requests Jun'ichi Nomura
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=452FFCFB.6090805@ce.jp.nec.com \
--to=j-nomura@ce.jp.nec.com \
--cc=lvm-devel@redhat.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.