-
Notifications
You must be signed in to change notification settings - Fork 297
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DAOS-14408 common: enable NDCTL for DCPM #14371
base: master
Are you sure you want to change the base?
Changes from 5 commits
ee6d615
f74f025
ceccaca
12bed56
44c0346
9598f9a
fc2c933
1f3f723
a9a4a5c
8f6e286
884f96d
5ec658a
2ca8e35
4528923
648d374
0976c04
dfb9bf0
c1dba55
d6fd878
a9a12d5
118ad26
a33e5c0
f8c108b
bcdced7
193f4e6
560d9de
3212708
f2a865e
5d4aaf2
9815445
8bd6325
cc7000b
e80ae21
1ace438
05efd1e
6e07425
dbb626b
6dd7d34
16c0519
ec653de
b0842ed
cf26dd1
8297d37
da701b4
23f52e6
83123e2
88d5087
913b030
ac3193a
4c5ed9d
eea85fb
ee99bf5
bd9100f
48f6285
4f90e7a
f4c187d
8f8d846
c9f0c11
e701bb8
e52972b
e433d4c
9175174
82e9e92
bc08b29
0565522
c6f4853
817c616
e444b1f
8d7da45
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,6 +9,7 @@ package engine | |
import ( | ||
"fmt" | ||
"os" | ||
"strconv" | ||
"strings" | ||
|
||
"github.com/pkg/errors" | ||
|
@@ -28,6 +29,8 @@ const ( | |
envLogMasks = "D_LOG_MASK" | ||
envLogDbgStreams = "DD_MASK" | ||
envLogSubsystems = "DD_SUBSYS" | ||
|
||
MIN_ABT_THREAD_STACKSIZE_FOR_DCPM = 18432 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. go variable names, even Constants should be of the form minAbtThreadStackSizeDcpm or minABTThreadStackSizeDCPM There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done |
||
) | ||
|
||
// FabricConfig encapsulates networking fabric configuration. | ||
|
@@ -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 { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would be great to have new unit test cases for this new block of logic. I see a few cases here:
It may be easiest to test by breaking the if-block out into a helper function and writing tests for that, rather than updating an existing unit test to check whether the Config was updated. Either way would be acceptable. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So far all existing tests have been updated. |
||
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 | ||
} | ||
|
||
|
@@ -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 | ||
} | ||
|
||
|
@@ -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 | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
#!/usr/bin/env python3 | ||
""" | ||
(C) Copyright 2020-2023 Intel Corporation. | ||
(C) Copyright 2020-2024 Intel Corporation. | ||
|
||
SPDX-License-Identifier: BSD-2-Clause-Patent | ||
""" | ||
|
@@ -51,6 +51,12 @@ def generate_server_config(args): | |
config.engine_params[0].storage.storage_tiers[0].storage_class.value = "ram" | ||
config.engine_params[0].storage.storage_tiers[0].scm_mount.value = "/mnt/daos" | ||
config.engine_params[0].storage.storage_tiers[0].scm_size.value = 0 | ||
|
||
# Disable shutdown state (SDS) (part of RAS) for RAM-based simulated SCM. | ||
# RAM doesn't support this feature and trying to use it will fail the create/open operations. | ||
# PMEMOBJ expects the shutdown state support by default when built with NDCTL. | ||
config.engine_params[0].env_vars.update("PMEMOBJ_CONF=sds.at_create=0", append=True) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is this an env var that everyone who uses DAOS with ramdisk will need? If so, we need to consider populating it automatically, too. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Done. Every time both PMDK-related env variables are generated before engine is started. |
||
|
||
# Update the configuration file access points | ||
config.other_params.access_points.value = args.node_list.split(",") | ||
return create_config(args, config) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We probably should not be including this in the output of config gen considering we handle it automatically on reading back the config.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We compare raw
expOut
not config structure.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I prefer to have
- ABT_THREAD_STACKSIZE=18432
explicitly listed rather than making some tricks with reverting changes that are common for all configurations.