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
56a1acd9
Unverified
Commit
56a1acd9
authored
Dec 21, 2023
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_logs_rewrite: allocate pending logbuffer outside mtx
parent
9fdee0f7
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
9 deletions
+19
-9
fellow_log.c
src/fellow_log.c
+19
-9
No files found.
src/fellow_log.c
View file @
56a1acd9
...
...
@@ -5387,13 +5387,32 @@ fellow_logs_rewrite(struct fellow_fd *ffd,
bfa
->
bitfs
=
bitfs_init
(
bfamem
,
sizeof
bfamem
);
bfa
->
mem
=
(
struct
buddy_ptr_extent
[
BITFMAXSEGS
]){{
0
}};
bfa
->
lmem
=
BITFMAXSEGS
;
//flexelint
memset
(
lbuf_pend
,
0
,
sizeof
lbuf_pend
);
/*
* we put in place as the global buffer our temporary buffer
* backed by the pending region, which ultimately it is going to
* get appended to the rewritten global buffer.
*/
if
(
ffd
->
phase
==
FP_OPEN
)
{
logreg
=
&
ffd
->
logreg
[
pend_region
(
log_info
->
region
)];
logregion_reset
(
logreg
);
logbuffer_init
(
ffd
,
lbuf_pend
,
logreg
);
}
bfa_alloc
(
bfa
);
AZ
(
pthread_mutex_lock
(
&
ffd
->
logmtx
));
if
(
fellow_logs_rewriting
(
ffd
))
{
AZ
(
pthread_mutex_unlock
(
&
ffd
->
logmtx
));
ffd
->
diag
(
"... (raced)
\n
"
);
bfa_free
(
bfa
);
assert
(
lbuf_pend
->
state
==
LBUF_INIT
);
lbuf_pend
->
state
=
LBUF_FINI
;
logbuffer_fini
(
lbuf_pend
);
return
;
}
ffd
->
rewriting
=
1
;
...
...
@@ -5428,15 +5447,6 @@ fellow_logs_rewrite(struct fellow_fd *ffd,
AZ
(
log_info
->
off
.
pendblk
);
AZ
(
pendblk_off
);
/*
* we put in place as the global buffer our temporary buffer
* backed by the pending region, which ultimately it is going to
* get appended to the rewritten global buffer.
*/
logreg
=
&
ffd
->
logreg
[
pend_region
(
log_info
->
region
)];
logregion_reset
(
logreg
);
logbuffer_init
(
ffd
,
lbuf_pend
,
logreg
);
assert
(
lbuf_pend
->
state
==
LBUF_INIT
);
lbuf_pend
->
state
=
LBUF_PEND
;
...
...
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