Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
slash
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
uplex-varnish
slash
Commits
c665c0a9
Unverified
Commit
c665c0a9
authored
Nov 02, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
New flush policy from getblks
parent
2fdef88f
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
16 additions
and
22 deletions
+16
-22
fellow_log.c
src/fellow_log.c
+16
-22
No files found.
src/fellow_log.c
View file @
c665c0a9
...
...
@@ -802,7 +802,7 @@ struct fellow_log_prep {
};
// fwd decl
static
void
fellow_logwatcher_
check
(
struct
fellow_fd
*
);
static
void
fellow_logwatcher_
kick_locked
(
struct
fellow_fd
*
);
static
void
fellow_privatelog_submit
(
struct
fellow_fd
*
ffd
,
struct
fellow_logbuffer
*
lbuf
,
struct
fellow_dle
*
entry
,
unsigned
n
);
...
...
@@ -816,7 +816,7 @@ enum flw_need_e {
FLW_NEED_REWRITE
,
FLW_NEED_LIM
};
#ifdef DEBUG
#ifdef DEBUG
_DONTNEED
//lint -e773
static
const
char
*
const
flw_need_s
[
FLW_NEED_LIM
]
=
{
#define N(x) [x] = #x
...
...
@@ -3072,18 +3072,24 @@ logbuffer_addblks(struct fellow_fd *ffd,
/* if we need memory, just flush blocks
*/
if
(
canflush
&&
lbuf
->
space
>
0
&&
lbuf
->
n
==
lbuf
->
space
)
can
|=
LBUF_CAN_FLUSH
;
if
(
canflush
&&
lbuf
->
space
>
0
)
{
if
(
lbuf
->
n
==
lbuf
->
space
)
can
|=
LBUF_CAN_FLUSH
;
else
if
(
lbuf
->
n
*
2
>
lbuf
->
space
)
fellow_logwatcher_kick_locked
(
ffd
);
}
/* if we run short of disk blocks, we want to
/* if we run short of disk blocks
(25%)
, we want to
* ref in order to apply frees
*
* unless avail increases, this flushes for every half
*/
if
(
canflush
&&
lbuf
->
n
>
0
&&
lbuf
->
n
*
2
>=
avail
)
can
|=
LBUF_CAN_REF
;
if
(
canflush
&&
lbuf
->
n
>
0
)
{
if
(
lbuf
->
n
*
4
>=
avail
*
3
)
can
|=
LBUF_CAN_REF
;
else
if
(
!
can
&&
lbuf
->
n
*
2
>=
avail
)
fellow_logwatcher_kick_locked
(
ffd
);
}
/*
* flush if logbuffer is full or not enough blocks
...
...
@@ -5754,19 +5760,10 @@ fellow_logwatcher_thread(void *priv)
}
static
void
fellow_logwatcher_
check
(
struct
fellow_fd
*
ffd
)
fellow_logwatcher_
kick_locked
(
struct
fellow_fd
*
ffd
)
{
enum
flw_need_e
need
;
need
=
fellow_logwatcher_need
(
ffd
,
NULL
);
if
(
need
==
FLW_NEED_NONE
||
need
==
FLW_MAYFLUSH
)
return
;
DBG
(
"need %s"
,
flw_need_s
[
need
]);
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
if
(
ffd
->
phase
==
FP_OPEN
&&
ffd
->
watcher_running
)
AZ
(
pthread_cond_broadcast
(
&
ffd
->
watcher_cond
));
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
}
// not unter logmtx
...
...
@@ -6321,9 +6318,6 @@ fellow_log_dle_submit(struct fellow_fd *ffd,
if
(
prealloc
!=
NULL
)
regionlist_free
(
&
prealloc
,
ffd
->
dskbuddy
);
AZ
(
prealloc
);
if
(
ffd
->
phase
==
FP_OPEN
&&
ffd
->
logbuf
->
ff
.
inuse
==
0
)
fellow_logwatcher_check
(
ffd
);
}
/* emergency flush, called from nuke when we need-a-space
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment