Skip to content

Commit

Permalink
DAOS-16160 control: Update pool create --size % opt for MD-on-SSD p2
Browse files Browse the repository at this point in the history
Features: pool control
Required-githooks: true

Signed-off-by: Tom Nabarro <tom.nabarro@intel.com>
  • Loading branch information
tanabarr committed Sep 25, 2024
1 parent b7c83cf commit 0b46a05
Show file tree
Hide file tree
Showing 8 changed files with 701 additions and 898 deletions.
4 changes: 2 additions & 2 deletions src/bio/bio_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -613,14 +613,14 @@ __bio_ioctxt_open(struct bio_io_context **pctxt, struct bio_xs_context *xs_ctxt,
/*
* Calculate a reasonable WAL size based on following assumptions:
* - Single target update IOPS can be up to 65k;
* - Each TX consumes 2 WAL blocks in average;
* - Each TX consumes 2 WAL blocks on average;
* - Checkpointing interval is 5 seconds, and the WAL should have at least
* half free space before next checkpoint;
*/
uint64_t
default_wal_sz(uint64_t meta_sz)
{
uint64_t wal_sz = (6ULL << 30); /* 6GB */
uint64_t wal_sz = (6ULL << 30); /* 6GiB */

/* The WAL size could be larger than meta size for tiny pool */
if ((meta_sz * 2) <= wal_sz)
Expand Down
31 changes: 18 additions & 13 deletions src/control/cmd/dmg/pretty/storage_nvme.go
Original file line number Diff line number Diff line change
Expand Up @@ -213,6 +213,22 @@ func printNvmeFormatResults(inCtrlrs storage.NvmeControllers, out io.Writer, opt
return nil
}

func rolesRankFromSmd(ctrlr *storage.NvmeController) (string, string) {
rolesStr := "NA"
roles := ctrlr.Roles()
if !roles.IsEmpty() {
rolesStr = roles.String()
}

rankStr := "None"
rank := ctrlr.Rank()
if rank != ranklist.NilRank {
rankStr = rank.String()
}

return rolesStr, rankStr
}

// PrintNvmeControllers displays controller details in a verbose table.
func PrintNvmeControllers(controllers storage.NvmeControllers, out io.Writer, opts ...PrintConfigOption) error {
w := txtfmt.NewErrWriter(out)
Expand Down Expand Up @@ -245,18 +261,7 @@ func PrintNvmeControllers(controllers storage.NvmeControllers, out io.Writer, op
row[fwTitle] = ctrlr.FwRev
row[socketTitle] = fmt.Sprint(ctrlr.SocketID)
row[capacityTitle] = humanize.Bytes(ctrlr.Capacity())
roles := "NA"
rank := "None"
// Assumes that all SMD devices on a controller have the same roles and rank.
if len(ctrlr.SmdDevices) > 0 {
sd := ctrlr.SmdDevices[0]
roles = sd.Roles.String()
if sd.Rank != ranklist.NilRank {
rank = sd.Rank.String()
}
}
row[rolesTitle] = roles
row[rankTitle] = rank
row[rolesTitle], row[rankTitle] = rolesRankFromSmd(ctrlr)

table = append(table, row)
}
Expand All @@ -276,7 +281,7 @@ func PrintNvmeHealthMap(hsm control.HostStorageMap, out io.Writer, opts ...Print
lineBreak := strings.Repeat("-", len(hosts))
fmt.Fprintf(out, "%s\n%s\n%s\n", lineBreak, hosts, lineBreak)

if len(hss.HostStorage.NvmeDevices) == 0 {
if hss.HostStorage.NvmeDevices.Len() == 0 {
fmt.Fprintln(out, " No NVMe devices detected")
continue
}
Expand Down
Loading

0 comments on commit 0b46a05

Please sign in to comment.