Skip to content

Commit

Permalink
DAOS-16445 client: Try cycling different method
Browse files Browse the repository at this point in the history
We've noticed that with 8GB files we fill space pretty quickly.

Just trying another method to see if it works any better.

Required-githooks: true

Signed-off-by: Jeff Olivier <jeffolivier@google.com>
  • Loading branch information
jolivier23 committed Aug 24, 2024
1 parent b5edb7d commit 1c032dd
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions src/client/dfs/dfs_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,15 @@
/** MAX value for the HI OID */
#define MAX_OID_HI ((1UL << 32) - 1)

/** Use a large prime for cycling through all oids */
#define OID_INC (10009729)

static inline void
oid_inc(daos_obj_id_t *oid)
{
oid->hi = (oid->hi + OID_INC) & MAX_OID_HI;
}

typedef uint64_t dfs_magic_t;
typedef uint16_t dfs_sb_ver_t;
typedef uint16_t dfs_layout_ver_t;
Expand Down Expand Up @@ -337,20 +346,21 @@ oid_gen(dfs_t *dfs, daos_oclass_id_t oclass, bool file, daos_obj_id_t *oid)

D_MUTEX_LOCK(&dfs->lock);
/** If we ran out of local OIDs, alloc one from the container */
if (dfs->oid.hi >= MAX_OID_HI) {
if (dfs->oid.hi == 0) {
/** Allocate an OID for the namespace */
rc = daos_cont_alloc_oids(dfs->coh, 1, &dfs->oid.lo, NULL);
if (rc) {
D_ERROR("daos_cont_alloc_oids() Failed (%d)\n", rc);
D_MUTEX_UNLOCK(&dfs->lock);
return daos_der2errno(rc);
}
dfs->oid.hi = 0;
/** Start with OID_INC so final value will be 0 */
dfs->oid.hi = OID_INC;
}

/** set oid and lo, bump the current hi value */
oid->lo = dfs->oid.lo;
oid->hi = dfs->oid.hi++;
oid_inc(&oid);
D_MUTEX_UNLOCK(&dfs->lock);

/** if a regular file, use UINT64 typed dkeys for the array object */
Expand Down

0 comments on commit 1c032dd

Please sign in to comment.