Compare commits

...

6 Commits

Author SHA1 Message Date
Thomas Schoebel-Theuer ca86fbb024 all: release mars0.1astable175 2024-03-25 08:09:51 +01:00
Thomas Schoebel-Theuer b6bb9cb2db doc: add recommendation on mars_port= parameter 2024-03-25 08:00:11 +01:00
Thomas Schoebel-Theuer 4ef084b801 main: improve pre-allocation setup 2024-03-25 07:59:00 +01:00
Thomas Schoebel-Theuer fe33ab7ba1 mem: make brick_mem_reserve reentrant 2024-03-25 07:59:00 +01:00
Thomas Schoebel-Theuer 47f71d83cf mem: add prefer_freelist knob 2024-03-25 07:58:56 +01:00
Thomas Schoebel-Theuer 43a77b8a70 all: release mars0.1astable174 2024-02-22 11:00:17 +01:00
6 changed files with 46 additions and 5 deletions

View File

@ -182,6 +182,15 @@ Changelog for series 0.1a:
fixed during the preparation phase. I am releasing them
for the currently supported stable upstream kernels.
mars0.1astable175
* Minor improvement: pre-allocation of higher-order
pages.
mars0.1astable174
* Minor fix: automatic restart hanging syncs.
* Minor fix: automatic restart hanging fetches.
* Minor improvement: adapt to newer pre-patch version.
mars0.1astable173
* Minor fix: do not spawn many server kthreads on
recpetion of masses of connections.

View File

@ -2239,7 +2239,32 @@ m
\begin_layout Enumerate
A lot of sub-options for MARS will pop up.
Leave them at their default.
Leave them at their default
\begin_inset Foot
status open
\begin_layout Plain Layout
CONFIG_MARS_DEFAULT_PORT is defaulted to 7777 or 7776.
Please change it when needed (to an
\emph on
unsed
\emph default
port range of at least 4 consecutive ports), although
\family typewriter
insmod
\family default
can be used for overriding it dynamically via the
\family typewriter
mars_port=
\family default
parameter.
Notice that using different ports in a bigger production setup isn't a
good idea, leading to confusion on firewall level etc.
\end_layout
\end_inset
.
\end_layout
\begin_layout Enumerate

View File

@ -606,10 +606,9 @@ void __brick_block_free(void *data, int order, int cline)
#ifdef CONFIG_MARS_MEM_PREALLOC
int brick_allow_freelist = 1;
EXPORT_SYMBOL_GPL(brick_allow_freelist);
int brick_prefer_freelist = 1;
int brick_pre_reserve[BRICK_MAX_ORDER+1] = {};
EXPORT_SYMBOL_GPL(brick_pre_reserve);
/* Note: we have no separate lists per CPU.
* This should not hurt because the freelists are only used
@ -709,7 +708,7 @@ int brick_mem_reserve(void)
int i;
brick_mem_freelist_max[order] += max;
BRICK_INF("preallocating %d at order %d (new maxlevel = %d)\n", max, order, brick_mem_freelist_max[order]);
brick_pre_reserve[order] = 0;
max = brick_mem_freelist_max[order] - atomic_read(&freelist_count[order]);
if (max >= 0) {
@ -933,7 +932,9 @@ void _brick_block_free(void *data, int len, int cline)
}
#endif /* BRICK_DEBUG_MEM */
#ifdef CONFIG_MARS_MEM_PREALLOC
if (order > 0 && brick_allow_freelist && atomic_read(&freelist_count[order]) <= brick_mem_freelist_max[order]) {
if (order > 0 && brick_allow_freelist &&
(brick_prefer_freelist ||
atomic_read(&freelist_count[order]) <= brick_mem_freelist_max[order])) {
_put_free(data, order);
} else
#endif

View File

@ -237,6 +237,7 @@ extern void _brick_block_free(void *data, int len, int cline);
#ifdef CONFIG_MARS_MEM_PREALLOC
extern int brick_allow_freelist;
extern int brick_prefer_freelist;
extern int brick_pre_reserve[BRICK_MAX_ORDER+1];
extern int brick_mem_freelist_max[BRICK_MAX_ORDER+1];

View File

@ -264,12 +264,16 @@ void update_brick_mem_freelist_max(void)
for (order = 0; order <= BRICK_MAX_ORDER; order++) {
int max = 0;
int old_max = brick_mem_freelist_max[order];
if (order == MARS_MEMRESERVE_ORDER) {
max = nr_affected_resources + nr_prosumer_resources;
max *= MEMRESERVE_FACTOR_5;
}
set_brick_mem_freelist_max(max, order);
if (max <= old_max)
continue;
brick_mem_reserve();
}
#endif
}

View File

@ -650,6 +650,7 @@ struct ctl_table mars_table[] = {
INT_ENTRY("mem_used_raw_kb", brick_global_block_used,0400),
#ifdef CONFIG_MARS_MEM_PREALLOC
INT_ENTRY("mem_allow_freelist", brick_allow_freelist, 0600),
INT_ENTRY("mem_prefer_freelist", brick_prefer_freelist, 0600),
VEC_INT_ENTRY("mem_freelist_max", brick_mem_freelist_max, 0600, BRICK_MAX_ORDER+1),
VEC_INT_ENTRY("mem_alloc_count", brick_mem_alloc_count, 0400, BRICK_MAX_ORDER+1),
VEC_INT_ENTRY("mem_alloc_max", brick_mem_alloc_count, 0600, BRICK_MAX_ORDER+1),