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
16a1bb69
Unverified
Commit
16a1bb69
authored
Jan 15, 2024
by
Nils Goroll
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fellow_logcache: for prefetch, do not wait for allocations
parent
38fa9b39
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
+12
-8
fellow_log.c
src/fellow_log.c
+12
-8
No files found.
src/fellow_log.c
View file @
16a1bb69
...
...
@@ -1234,9 +1234,6 @@ fellow_logcache_init(struct fellow_logcache *flc, struct fellow_fd *ffd,
VTAILQ_INSERT_TAIL
(
&
flc
->
free
,
fle
,
list
);
}
//XXX
(
void
)
flc_mempool_avail
(
flc
->
mempool
);
fellow_fd_ioctx_get
(
ffd
,
&
flc
->
fdil
);
}
...
...
@@ -1309,9 +1306,13 @@ fellow_logcache_steal(struct fellow_logcache *flc, int direction)
return
(
fle
);
}
/* get an element from the free list, if any */
/*
* get an element from the free list, if any
*
* prefetch uses it with need == 0 to not wait for allocations
*/
static
struct
fellow_logcache_entry
*
fellow_logcache_take
(
struct
fellow_logcache
*
flc
,
int
direction
)
fellow_logcache_take
(
struct
fellow_logcache
*
flc
,
int
direction
,
int
need
)
{
struct
fellow_logcache_entry
*
fle
;
...
...
@@ -1320,6 +1321,9 @@ fellow_logcache_take(struct fellow_logcache *flc, int direction)
if
(
fle
==
NULL
)
return
(
fellow_logcache_steal
(
flc
,
direction
));
if
(
need
==
0
&&
!
flc_mempool_avail
(
flc
->
mempool
))
return
(
NULL
);
VTAILQ_REMOVE
(
&
flc
->
free
,
fle
,
list
);
AZ
(
fle
->
alloc
.
ptr
);
...
...
@@ -1489,7 +1493,7 @@ fellow_logcache_prefetch(struct fellow_logcache *flc,
}
if
(
noff
==
0
)
break
;
next
=
fellow_logcache_take
(
flc
,
direction
);
next
=
fellow_logcache_take
(
flc
,
direction
,
0
);
if
(
next
==
NULL
)
break
;
//DBG("%zu %s", noff, direction < 0 ? "<-" : "->");
...
...
@@ -1528,7 +1532,7 @@ fellow_logcache_get(struct fellow_logcache *flc, off_t off, int direction,
if
(
flc
->
current
==
NULL
)
{
DBG
(
"1st %zu %s"
,
off
,
direction
<
0
?
"<-"
:
"->"
);
fle
=
fellow_logcache_take
(
flc
,
direction
);
fle
=
fellow_logcache_take
(
flc
,
direction
,
1
);
AN
(
fle
);
flc
->
current
=
fle
;
assert
(
VTAILQ_EMPTY
(
&
flc
->
used
));
...
...
@@ -1546,7 +1550,7 @@ fellow_logcache_get(struct fellow_logcache *flc, off_t off, int direction,
CHECK_OBJ_ORNULL
(
fle
,
FELLOW_LOGCACHE_ENTRY_MAGIC
);
if
(
fle
==
NULL
)
{
DBG
(
"miss %zu %s"
,
off
,
direction
<
0
?
"<-"
:
"->"
);
fle
=
fellow_logcache_take
(
flc
,
direction
);
fle
=
fellow_logcache_take
(
flc
,
direction
,
1
);
AN
(
fle
);
fellow_logcache_insert
(
flc
,
flc
->
current
,
fle
,
direction
);
...
...
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