Skip to content

Commit

Permalink
DAOS-14491: Retain support for phase-1 DAV heap
Browse files Browse the repository at this point in the history
The phase-2 DAV allocator is placed under the subdirectory
src/common/dav_v2. This allocator is built as a standalone shared
library and linked to the libdaos_common_pmem library.
The umem will now support one more mode DAOS_MD_BMEM_V2. Setting
this mode in umem instance will result in using phase-2 DAV allocator
interfaces.

Signed-off-by: Sherin T George <sherin-t.george@hpe.com>
  • Loading branch information
sherintg committed Oct 16, 2023
1 parent 4951549 commit 4a0bede
Show file tree
Hide file tree
Showing 72 changed files with 16,468 additions and 598 deletions.
7 changes: 7 additions & 0 deletions debian/changelog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
daos (2.5.100-10) unstable; urgency=medium

[ Sherin T George ]
* Add DAV v2 lib

-- Sherin T George <sherin-t.george@hpe.com> Mon, 16 Oct 2023 11:54:00 +0530

daos (2.5.100-9) unstable; urgency=medium

[ Brian J. Murrell ]
Expand Down
1 change: 1 addition & 0 deletions debian/daos-server.install
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ usr/lib64/daos_srv/libbio.so
usr/lib64/daos_srv/libplacement.so
usr/lib64/daos_srv/libpipeline.so
usr/lib64/libdaos_common_pmem.so
usr/lib64/libdav_v2.so
usr/share/daos/control/setup_spdk.sh
usr/lib/systemd/system/daos_server.service
usr/lib/sysctl.d/10-daos_server.conf
Expand Down
3 changes: 2 additions & 1 deletion src/common/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ def build_daos_common(denv, client):
'dav/ravl_interval.c', 'dav/recycler.c', 'dav/stats.c', 'dav/tx.c', 'dav/ulog.c',
'dav/util.c', 'dav/wal_tx.c']
ad_mem_files = ['ad_mem.c', 'ad_tx.c']
common_libs.extend(['pmemobj', 'abt'])
common_libs.extend(['pmemobj', 'abt', 'dav_v2'])
benv.AppendUnique(RPATH_FULL=['$PREFIX/lib64/daos_srv'])
benv.Append(CPPDEFINES=['-DDAOS_PMEM_BUILD'])
benv.Append(OBJPREFIX="v_")
Expand All @@ -53,6 +53,7 @@ def scons():
"""Execute build"""
Import('env', 'base_env', 'prereqs')

SConscript('dav_v2/SConscript')
env.AppendUnique(LIBPATH=[Dir('.')])
base_env.AppendUnique(LIBPATH=[Dir('.')])
base_env.d_add_build_rpath()
Expand Down
25 changes: 10 additions & 15 deletions src/common/dav/bucket.c
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2015-2023, Intel Corporation */
/* Copyright 2015-2022, Intel Corporation */

/*
* bucket.c -- bucket implementation
Expand All @@ -23,13 +23,15 @@

struct bucket {
/* this struct is both the lock guard and the locked state */
struct bucket_locked *locked;
struct alloc_class *aclass;
struct block_container *container;
struct bucket_locked *locked;

struct alloc_class *aclass;

struct block_container *container;
const struct block_container_ops *c_ops;
struct memory_block_reserved *active_memory_block;
struct zoneset *zset;
int is_active;

struct memory_block_reserved *active_memory_block;
int is_active;
};

struct bucket_locked {
Expand Down Expand Up @@ -75,7 +77,7 @@ bucket_fini(struct bucket *b)
* bucket_locked_new -- creates a new locked bucket instance
*/
struct bucket_locked *
bucket_locked_new(struct block_container *c, struct alloc_class *aclass, struct zoneset *zset)
bucket_locked_new(struct block_container *c, struct alloc_class *aclass)
{
ASSERTne(c, NULL);

Expand All @@ -90,7 +92,6 @@ bucket_locked_new(struct block_container *c, struct alloc_class *aclass, struct

util_mutex_init(&b->lock);
b->bucket.locked = b;
b->bucket.zset = zset;

return b;

Expand Down Expand Up @@ -267,9 +268,3 @@ bucket_active_block(struct bucket *b)
{
return b->is_active ? b->active_memory_block : NULL;
}

struct zoneset *
bucket_get_zoneset(struct bucket *b)
{
return b->zset;
}
8 changes: 3 additions & 5 deletions src/common/dav/bucket.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* SPDX-License-Identifier: BSD-3-Clause */
/* Copyright 2015-2023, Intel Corporation */
/* Copyright 2015-2021, Intel Corporation */

/*
* bucket.h -- internal definitions for bucket
Expand All @@ -21,8 +21,8 @@
struct bucket_locked;
struct bucket;

struct bucket_locked *
bucket_locked_new(struct block_container *c, struct alloc_class *aclass, struct zoneset *zset);
struct bucket_locked *bucket_locked_new(struct block_container *c,
struct alloc_class *aclass);

struct bucket *bucket_acquire(struct bucket_locked *b);
void bucket_release(struct bucket *b);
Expand All @@ -41,7 +41,5 @@ int bucket_detach_run(struct bucket *b,
struct memory_block_reserved *bucket_active_block(struct bucket *b);

void bucket_locked_delete(struct bucket_locked *b);
struct zoneset *
bucket_get_zoneset(struct bucket *b);

#endif /* __DAOS_COMMON_BUCKET_H */
Loading

0 comments on commit 4a0bede

Please sign in to comment.