Skip to content

Commit

Permalink
Version 6.2.0.273
Browse files Browse the repository at this point in the history
Note: This is a pre-release version, future versions of VDO may not support
VDO devices created with this version.
- Fixed more error path memory leaks in the uds and kvdo modules.
- Fixed module loading issues with the spec file on Fedora.
- Removed the read cache.
- Fixed error handling in preresume.
- Converted table line parsing to use existing DM functions.
- Fixed a bug which prevented parsing of version 0 table lines.
- In order to properly handle version 0 table lines, made no-op physical
  growth not an error.
- Limited the number of logical zones to 60.
- Converted to use the kernel's bio zeroing method instead of a VDO
  specific one.
- Added a missing call to flush_cache_page() after writing pages which may
  be owned by the page cache or a user as required by the kernel.
- Added a version 2 table line which uses DM-style optional parameters.
- Fixed a bug in the statistics tracking partial I/Os.
- Added a maximum discard size table line parameter and removed the
  corresponding sysfs parameter which applied to all VDO devices.
  • Loading branch information
corwin committed Nov 16, 2018
1 parent 45b1455 commit 2f1ca50
Show file tree
Hide file tree
Showing 30 changed files with 501 additions and 1,580 deletions.
3 changes: 2 additions & 1 deletion CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ The Red Hat VDO Team:
Other Contributors:
Ji-Hyeon Gim <[email protected]>:
Updates for FC26/Kernel 4.13

Vojtech Trefny <[email protected]>
Getting correct size of partitions

VDO was originally created at Permabit Technology Corporation, and was
subsequently acquired and open-sourced by Red Hat.
Expand Down
6 changes: 3 additions & 3 deletions kvdo.spec
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
%define spec_release 1
%define kmod_name kvdo
%define kmod_driver_version 6.2.0.239
%define kmod_driver_version 6.2.0.273
%define kmod_rpm_release %{spec_release}
%define kmod_kernel_version 3.10.0-693.el7

Expand Down Expand Up @@ -85,5 +85,5 @@ rm -rf $RPM_BUILD_ROOT
%{_usr}/src/%{kmod_name}-%{version}-%{kmod_driver_version}/*

%changelog
* Fri Oct 05 2018 - J. corwin Coburn <[email protected]> - 6.2.0.239-1
HASH(0x1b8ead8)
* Thu Nov 15 2018 - J. corwin Coburn <[email protected]> - 6.2.0.273-1
HASH(0x1d75b98)
2 changes: 1 addition & 1 deletion uds/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
UDS_VERSION = 6.2.0.72
UDS_VERSION = 6.2.0.74

SOURCES = $(notdir $(wildcard $(src)/*.c)) murmur/MurmurHash3.c
SOURCES += $(addprefix util/,$(notdir $(wildcard $(src)/util/*.c)))
Expand Down
2 changes: 1 addition & 1 deletion vdo/Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VDO_VERSION = 6.2.0.239
VDO_VERSION = 6.2.0.273

VDO_VERSION_MAJOR = $(word 1,$(subst ., ,$(VDO_VERSION)))
VDO_VERSION_MINOR = $(word 2,$(subst ., ,$(VDO_VERSION)))
Expand Down
5 changes: 4 additions & 1 deletion vdo/base/constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/constants.h#1 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/constants.h#2 $
*/

#ifndef CONSTANTS_H
Expand Down Expand Up @@ -54,6 +54,9 @@ enum {
**/
LOCK_MAP_CAPACITY = 10000,

/** The maximum number of logical zones */
MAX_LOGICAL_ZONES = 60,

/** The maximum number of physical zones */
MAX_PHYSICAL_ZONES = 16,

Expand Down
6 changes: 5 additions & 1 deletion vdo/base/extent.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/extent.c#2 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/extent.c#3 $
*/

#include "extent.h"
Expand Down Expand Up @@ -54,6 +54,10 @@ int createExtent(PhysicalLayer *layer,

result = initializeEnqueueableCompletion(&extent->completion,
VDO_EXTENT_COMPLETION, layer);
if (result != VDO_SUCCESS) {
FREE(extent);
return result;
}

for (; extent->count < blockCount; extent->count++) {
result = layer->createMetadataVIO(layer, vioType, priority, extent, data,
Expand Down
21 changes: 16 additions & 5 deletions vdo/base/forest.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/forest.c#4 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/forest.c#5 $
*/

#include "forest.h"
Expand Down Expand Up @@ -543,8 +543,19 @@ void traverseForest(BlockMap *map,
BlockCount computeForestSize(BlockCount logicalBlocks, RootCount rootCount)
{
Boundary newSizes;
BlockCount approximateNonLeaves = computeNewPages(rootCount, 0, NULL,
logicalBlocks, &newSizes);
return (approximateNonLeaves
+ computeBlockMapPageCount(logicalBlocks - approximateNonLeaves));
BlockCount approximateNonLeaves
= computeNewPages(rootCount, 0, NULL, logicalBlocks, &newSizes);

// Exclude the tree roots since those aren't allocated from slabs,
// and also exclude the super-roots, which only exist in memory.
approximateNonLeaves
-= rootCount * (newSizes.levels[BLOCK_MAP_TREE_HEIGHT - 2]
+ newSizes.levels[BLOCK_MAP_TREE_HEIGHT - 1]);

BlockCount approximateLeaves
= computeBlockMapPageCount(logicalBlocks - approximateNonLeaves);

// This can be a slight over-estimate since the tree will never have to
// address these blocks, so it might be a tiny bit smaller.
return (approximateNonLeaves + approximateLeaves);
}
2 changes: 1 addition & 1 deletion vdo/base/statistics.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
#include "types.h"

enum {
STATISTICS_VERSION = 29,
STATISTICS_VERSION = 30,
};

typedef struct {
Expand Down
9 changes: 8 additions & 1 deletion vdo/base/threadConfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/threadConfig.c#1 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/threadConfig.c#2 $
*/

#include "threadConfig.h"
Expand Down Expand Up @@ -99,6 +99,13 @@ int makeThreadConfig(ZoneCount logicalZoneCount,
physicalZoneCount, MAX_PHYSICAL_ZONES);
}

if (logicalZoneCount > MAX_LOGICAL_ZONES) {
return logErrorWithStringError(VDO_BAD_CONFIGURATION,
"Logical zone count %u exceeds maximum "
"(%u)",
logicalZoneCount, MAX_LOGICAL_ZONES);
}

ThreadConfig *config;
ThreadCount total = logicalZoneCount + physicalZoneCount + hashZoneCount + 2;
int result = allocateThreadConfig(logicalZoneCount, physicalZoneCount,
Expand Down
8 changes: 7 additions & 1 deletion vdo/base/vdoResize.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/vdoResize.c#5 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/base/vdoResize.c#6 $
*/

#include "vdoResize.h"
Expand Down Expand Up @@ -216,6 +216,12 @@ static void growPhysicalCallback(VDOCompletion *completion)
int performGrowPhysical(VDO *vdo, BlockCount newPhysicalBlocks)
{
BlockCount oldPhysicalBlocks = vdo->config.physicalBlocks;

// Skip any noop grows.
if (oldPhysicalBlocks == newPhysicalBlocks) {
return VDO_SUCCESS;
}

if (newPhysicalBlocks != getNextVDOLayoutSize(vdo->layout)) {
/*
* Either the VDO isn't prepared to grow, or it was prepared to grow
Expand Down
26 changes: 4 additions & 22 deletions vdo/kernel/bio.c
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
* 02110-1301, USA.
*
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/bio.c#3 $
* $Id: //eng/vdo-releases/aluminum/src/c++/vdo/kernel/bio.c#5 $
*/

#include "bio.h"
Expand All @@ -29,7 +29,7 @@
#include "recoveryJournal.h"

#include "bioIterator.h"
#include "readCache.h"
#include "ioSubmitter.h"

/**
* Gets the raw buffer from a biovec.
Expand Down Expand Up @@ -63,6 +63,7 @@ void bioCopyDataOut(BIO *bio, char *dataPtr)
(biovec = getNextBiovec(&iter)) != NULL;
advanceBioIterator(&iter)) {
memcpy(getBufferForBiovec(biovec), dataPtr, biovec->bv_len);
flush_dcache_page(biovec->bv_page);
dataPtr += biovec->bv_len;
}
}
Expand Down Expand Up @@ -199,26 +200,7 @@ bool bioIsZeroData(BIO *bio)
/**********************************************************************/
void bioZeroData(BIO *bio)
{
/*
* There's a routine zero_fill_bio exported from the kernel, but
* this is a little faster.
*
* Taking apart what zero_fill_bio does: The HIGHMEM stuff isn't an
* issue for x86_64, so bvec_k{,un}map_irq does no more than we do
* here. On x86 flush_dcache_page doesn't do anything. And the
* memset call there seems to be expanded inline by the compiler as
* a "rep stosb" loop which is slower than the kernel-exported
* memset.
*
* So we're functionally the same, and a little bit faster, this
* way.
*/
struct bio_vec *biovec;
for (BioIterator iter = createBioIterator(bio);
(biovec = getNextBiovec(&iter)) != NULL;
advanceBioIterator(&iter)) {
memset(getBufferForBiovec(biovec), 0, biovec->bv_len);
}
zero_fill_bio(bio);
}

/**********************************************************************/
Expand Down
Loading

0 comments on commit 2f1ca50

Please sign in to comment.