Skip to content

Commit

Permalink
Ensure ABT_THREAD_STACKSIZE>=18432 for dcpm storage class
Browse files Browse the repository at this point in the history
dcpm storage class with NDCTL enabled requires at least
18432 stack size for ULT.

PR-repos: pmdk@PR-38:11
Priority: 2
Cancel-prev-build: false

Skip-nlt: false
Skip-unit-tests: false
Skip-func-test-vm: false
Skip-test-rpms: false
Allow-unstable-test: true
Skip-func-hw-test-large: false
Skip-func-hw-test-medium: false
Skip-func-hw-test-medium-verbs-provider: true

Required-githooks: true

Signed-off-by: Tomasz Gromadzki <[email protected]>
  • Loading branch information
grom72 committed Aug 28, 2024
1 parent ee6d615 commit f74f025
Show file tree
Hide file tree
Showing 3 changed files with 37 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/control/cmd/dmg/auto_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -566,6 +566,8 @@ engines:
provider: ofi+verbs
fabric_iface: ib0
fabric_iface_port: 31416
env_vars:
- ABT_THREAD_STACKSIZE=18432
pinned_numa_node: 0
- targets: 6
nr_xs_helpers: 0
Expand All @@ -583,6 +585,8 @@ engines:
provider: ofi+verbs
fabric_iface: ib1
fabric_iface_port: 32416
env_vars:
- ABT_THREAD_STACKSIZE=18432
pinned_numa_node: 1
disable_vfio: false
disable_vmd: false
Expand Down
30 changes: 30 additions & 0 deletions src/control/server/engine/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ package engine
import (
"fmt"
"os"
"strconv"
"strings"

"github.com/pkg/errors"
Expand All @@ -28,6 +29,8 @@ const (
envLogMasks = "D_LOG_MASK"
envLogDbgStreams = "DD_MASK"
envLogSubsystems = "DD_SUBSYS"

MIN_ABT_THREAD_STACKSIZE_FOR_DCPM = 18432
)

// FabricConfig encapsulates networking fabric configuration.
Expand Down Expand Up @@ -343,6 +346,23 @@ func (c *Config) Validate() error {
return errors.Wrap(err, "validate engine log subsystems")
}

// ensure 18KB ABT stack size for an engine with DCPM storage class
if c.Storage.Tiers[0].Class == storage.ClassDcpm {
stacksize_str, err := c.GetEnvVar("ABT_THREAD_STACKSIZE")
if err != nil {
fmt.Printf("env_var ABT_THREAD_STACKSIZE set to %d for `dcpm` storage class\n",
MIN_ABT_THREAD_STACKSIZE_FOR_DCPM)
c.EnvVars = append(c.EnvVars, fmt.Sprintf("ABT_THREAD_STACKSIZE=%d",
MIN_ABT_THREAD_STACKSIZE_FOR_DCPM))
} else {
stacksize_value, err := strconv.Atoi(stacksize_str)
if err != nil || stacksize_value < MIN_ABT_THREAD_STACKSIZE_FOR_DCPM {
return errors.New(fmt.Sprintf("env_var ABT_THREAD_STACKSIZE should be >= %d for `dcpm` storage class",
MIN_ABT_THREAD_STACKSIZE_FOR_DCPM))
}
}
}

return nil
}

Expand Down Expand Up @@ -480,6 +500,10 @@ func (c *Config) WithSystemName(name string) *Config {
func (c *Config) WithStorage(cfgs ...*storage.TierConfig) *Config {
c.Storage.Tiers = storage.TierConfigs{}
c.AppendStorage(cfgs...)
if len(c.Storage.Tiers) > 0 && c.Storage.Tiers[0].IsSCM() &&
c.Storage.Tiers[0].Class == storage.ClassDcpm {
return c.WithStackSizeForDCPM()
}
return c
}

Expand Down Expand Up @@ -690,3 +714,9 @@ func (c *Config) WithStorageIndex(i uint32) *Config {
c.Storage.EngineIdx = uint(i)
return c
}

func (c *Config) WithStackSizeForDCPM() *Config {
c.EnvVars = append(c.EnvVars, fmt.Sprintf("ABT_THREAD_STACKSIZE=%d",
MIN_ABT_THREAD_STACKSIZE_FOR_DCPM))
return c
}
3 changes: 3 additions & 0 deletions src/tests/ftest/util/server_utils_params.py
Original file line number Diff line number Diff line change
Expand Up @@ -537,6 +537,9 @@ def get_params(self, test):

if not self.using_dcpm:
required_env_vars["PMEMOBJ_CONF"] = "sds.at_create=0"
else:
# NDCTL enabling requires bigger ABT default stack size
required_env_vars["ABT_THREAD_STACKSIZE"] = "18432"

# Enable fault injection if configured
if test.fault_injection.fault_file is not None:
Expand Down

0 comments on commit f74f025

Please sign in to comment.