1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-01-07 21:18:59 +03:00

mem: add extra mem pages for pthread stack

Some archs can use even 64K pages and then lvm2 runs into trouble if
the stack is 'too small' to fit extra page capturing stack overwrite.

So when lvm2 limits stack - add extra mem page - be it 4K or 64K.

Relates to ppc64le bug: https://bugzilla.redhat.com/1387279
This commit is contained in:
Zdenek Kabelac 2017-02-11 18:14:00 +01:00
parent 8296b99a89
commit 2a9eda1229
5 changed files with 5 additions and 3 deletions

View File

@ -1,5 +1,6 @@
Version 2.02.169 -
=====================================
Add extra memory page when limiting pthread stack size in clvmd.
Support striped/raid0* <-> raid10_near conversions
Support shrinking of RaidLvs
Support region size changes on existing RaidLVs

View File

@ -1,5 +1,6 @@
Version 1.02.138 -
=====================================
Add extra memory page when limiting pthread stack size in dmeventd.
Avoids immediate resume when preloaded device is smaller.
Do not suppress kernel key description in dmsetup table output.
Support configurable command executed from dmeventd thin plugin.

View File

@ -517,7 +517,7 @@ int main(int argc, char *argv[])
/* Initialise the LVM thread variables */
dm_list_init(&lvm_cmd_head);
if (pthread_attr_init(&stack_attr) ||
pthread_attr_setstacksize(&stack_attr, STACK_SIZE)) {
pthread_attr_setstacksize(&stack_attr, STACK_SIZE + getpagesize())) {
log_sys_error("pthread_attr_init", "");
exit(1);
}

View File

@ -468,7 +468,7 @@ static int _pthread_create_smallstack(pthread_t *t, void *(*fun)(void *), void *
/*
* We use a smaller stack since it gets preallocated in its entirety
*/
pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE);
pthread_attr_setstacksize(&attr, THREAD_STACK_SIZE + getpagesize());
/*
* If no-one will be waiting, we need to detach.

View File

@ -42,7 +42,7 @@ static int _pthread_create(pthread_t *t, void *(*fun)(void *), void *arg, int st
/*
* We use a smaller stack since it gets preallocated in its entirety
*/
pthread_attr_setstacksize(&attr, stacksize);
pthread_attr_setstacksize(&attr, stacksize + getpagesize());
return pthread_create(t, &attr, fun, arg);
}
#endif