1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-02 01:18:26 +03:00

Only use built-in stack size in clvmd - ignore lvm.conf.

This commit is contained in:
Alasdair Kergon 2011-12-08 21:24:08 +00:00
parent 585aaa922f
commit 594753751a
8 changed files with 15 additions and 10 deletions

View File

@ -47,7 +47,7 @@ Version 2.02.89 -
Fix lv_info open_count test for disabled verify_udev_operations (2.02.86).
Simplify code for lvm worker thread in clvmd.
Use pthread_barrier to synchronize clvmd threads at startup.
Limit clvmd's thread size to 128KiB.
Limit clvmd's thread size to 128KiB and ignore activation/reserved_stack.
Reduce default preallocated stack size to 64KiB.
Add check for access through NULL pointer when refresh_filter() fails.
Use pthread condition for SINGLENODE lock implementation.

View File

@ -880,7 +880,7 @@ int init_clvm(struct dm_hash_table *excl_uuid)
if (!get_initial_state(excl_uuid))
log_error("Cannot load initial lock states.");
if (!(cmd = create_toolcontext(1, NULL, 0))) {
if (!(cmd = create_toolcontext(1, NULL, 0, 1))) {
log_error("Failed to allocate command context");
return 0;
}

View File

@ -108,7 +108,7 @@ int main(int argc, char **argv) {
if (argc > 1) {
int i;
struct cmd_context *cmd = create_toolcontext(0, NULL, 0);
struct cmd_context *cmd = create_toolcontext(0, NULL, 0, 0);
for (i = 1; i < argc; ++i) {
const char *uuid = NULL;
scan(h, argv[i]);

View File

@ -1224,7 +1224,8 @@ static void _init_globals(struct cmd_context *cmd)
/* Entry point */
struct cmd_context *create_toolcontext(unsigned is_long_lived,
const char *system_dir,
unsigned set_buffering)
unsigned set_buffering,
unsigned threaded)
{
struct cmd_context *cmd;
@ -1246,6 +1247,7 @@ struct cmd_context *create_toolcontext(unsigned is_long_lived,
return NULL;
}
cmd->is_long_lived = is_long_lived;
cmd->threaded = threaded ? 1 : 0;
cmd->handles_missing_pvs = 0;
cmd->handles_unknown_segments = 0;
cmd->independent_metadata_areas = 0;

View File

@ -85,6 +85,7 @@ struct cmd_context {
unsigned partial_activation:1;
unsigned si_unit_consistency:1;
unsigned metadata_read_only:1;
unsigned threaded:1; /* Set if running within a thread e.g. clvmd */
unsigned independent_metadata_areas:1; /* Active formats have MDAs outside PVs */
@ -117,7 +118,8 @@ struct cmd_context {
*/
struct cmd_context *create_toolcontext(unsigned is_long_lived,
const char *system_dir,
unsigned set_buffering);
unsigned set_buffering,
unsigned threaded);
void destroy_toolcontext(struct cmd_context *cmd);
int refresh_toolcontext(struct cmd_context *cmd);
int refresh_filters(struct cmd_context *cmd);

View File

@ -445,9 +445,10 @@ void memlock_dec_daemon(struct cmd_context *cmd)
void memlock_init(struct cmd_context *cmd)
{
_size_stack = find_config_tree_int(cmd,
"activation/reserved_stack",
DEFAULT_RESERVED_STACK) * 1024;
/* When threaded, caller already limited stack size so just use the default. */
_size_stack = 1024 * (cmd->threaded ? DEFAULT_RESERVED_STACK :
find_config_tree_int(cmd, "activation/reserved_stack",
DEFAULT_RESERVED_STACK));
_size_malloc_tmp = find_config_tree_int(cmd,
"activation/reserved_memory",
DEFAULT_RESERVED_MEMORY) * 1024;

View File

@ -37,7 +37,7 @@ lvm_t lvm_init(const char *system_dir)
/* create context */
/* FIXME: split create_toolcontext */
/* FIXME: make all globals configurable */
cmd = create_toolcontext(0, system_dir, 1);
cmd = create_toolcontext(0, system_dir, 1, 0);
if (!cmd)
return NULL;

View File

@ -1237,7 +1237,7 @@ struct cmd_context *init_lvm(void)
if (!udev_init_library_context())
stack;
if (!(cmd = create_toolcontext(0, NULL, 1)))
if (!(cmd = create_toolcontext(0, NULL, 1, 0)))
return_NULL;
_cmdline.arg_props = &_arg_props[0];