|
@@ -18,11 +18,30 @@ Index: LVM2.2.02.119/lib/mm/memlock.c
|
18
|
18
|
inf = mallinfo();
|
19
|
19
|
|
20
|
20
|
if (hblks < inf.hblks) {
|
21
|
|
-@@ -179,6 +182,7 @@ static void _allocate_memory(void)
|
|
21
|
+@@ -176,9 +179,12 @@ static void _allocate_memory(void)
|
|
22
|
+ free(areas[area]);
|
|
23
|
+ _size_malloc_tmp /= 2;
|
|
24
|
+ } else {
|
|
25
|
++#endif
|
22
|
26
|
++ area;
|
23
|
27
|
missing -= _size_malloc_tmp;
|
|
28
|
++#ifdef __GLIBC__
|
24
|
29
|
}
|
25
|
30
|
+#endif
|
26
|
31
|
|
27
|
32
|
if (area == max_areas && missing > 0) {
|
28
|
33
|
/* Too bad. Warn the user and proceed, as things are
|
|
34
|
+@@ -467,8 +473,13 @@ static void _lock_mem(struct cmd_context
|
|
35
|
+ * will not block memory locked thread
|
|
36
|
+ * Note: assuming _memlock_count_daemon is updated before _memlock_count
|
|
37
|
+ */
|
|
38
|
++#ifdef __GLIBC__
|
|
39
|
+ _use_mlockall = _memlock_count_daemon ? 1 :
|
|
40
|
+ find_config_tree_bool(cmd, activation_use_mlockall_CFG, NULL);
|
|
41
|
++#else
|
|
42
|
++ /* always use mlockall on musl */
|
|
43
|
++ _use_mlockall = 1;
|
|
44
|
++#endif
|
|
45
|
+
|
|
46
|
+ if (!_use_mlockall) {
|
|
47
|
+ if (!*_procselfmaps &&
|