Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
O
OpenLDAP
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Christopher Ng
OpenLDAP
Commits
d4a42232
Commit
d4a42232
authored
22 years ago
by
Howard Chu
Browse files
Options
Downloads
Patches
Plain Diff
From ITS#2183, use a long-lived IDL stack per thread.
parent
32f6c9ec
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
servers/slapd/back-bdb/back-bdb.h
+1
-0
1 addition, 0 deletions
servers/slapd/back-bdb/back-bdb.h
servers/slapd/back-bdb/search.c
+42
-2
42 additions, 2 deletions
servers/slapd/back-bdb/search.c
with
43 additions
and
2 deletions
servers/slapd/back-bdb/back-bdb.h
+
1
−
0
View file @
d4a42232
...
@@ -99,6 +99,7 @@ struct bdb_info {
...
@@ -99,6 +99,7 @@ struct bdb_info {
slap_mask_t
bi_defaultmask
;
slap_mask_t
bi_defaultmask
;
Cache
bi_cache
;
Cache
bi_cache
;
Avlnode
*
bi_attrs
;
Avlnode
*
bi_attrs
;
void
*
bi_search_stack
;
#ifdef BDB_HIER
#ifdef BDB_HIER
Avlnode
*
bi_tree
;
Avlnode
*
bi_tree
;
ldap_pvt_thread_rdwr_t
bi_tree_rdwr
;
ldap_pvt_thread_rdwr_t
bi_tree_rdwr
;
...
...
This diff is collapsed.
Click to expand it.
servers/slapd/back-bdb/search.c
+
42
−
2
View file @
d4a42232
...
@@ -957,6 +957,40 @@ static int oc_filter(
...
@@ -957,6 +957,40 @@ static int oc_filter(
return
rc
;
return
rc
;
}
}
#define SRCH_STACK_SIZE 16
static
void
search_stack_free
(
void
*
key
,
void
*
data
)
{
ch_free
(
data
);
}
static
void
*
search_stack
(
BackendDB
*
be
,
Operation
*
op
)
{
struct
bdb_info
*
bdb
=
(
struct
bdb_info
*
)
be
->
be_private
;
void
*
ret
=
NULL
;
if
(
op
->
o_threadctx
)
{
ldap_pvt_thread_pool_getkey
(
op
->
o_threadctx
,
search_stack
,
&
ret
,
NULL
);
}
else
{
ret
=
bdb
->
bi_search_stack
;
}
if
(
!
ret
)
{
ret
=
ch_malloc
(
SRCH_STACK_SIZE
*
BDB_IDL_UM_SIZE
*
sizeof
(
ID
)
);
if
(
op
->
o_threadctx
)
{
ldap_pvt_thread_pool_setkey
(
op
->
o_threadctx
,
search_stack
,
ret
,
search_stack_free
);
}
else
{
bdb
->
bi_search_stack
=
ret
;
}
}
return
ret
;
}
static
int
search_candidates
(
static
int
search_candidates
(
BackendDB
*
be
,
BackendDB
*
be
,
Operation
*
op
,
Operation
*
op
,
...
@@ -1053,11 +1087,17 @@ static int search_candidates(
...
@@ -1053,11 +1087,17 @@ static int search_candidates(
#endif
#endif
/* Allocate IDL stack, plus 1 more for former tmp */
/* Allocate IDL stack, plus 1 more for former tmp */
stack
=
ch_malloc
(
(
depth
+
1
)
*
BDB_IDL_UM_SIZE
*
sizeof
(
ID
)
);
if
(
depth
+
1
>
SRCH_STACK_SIZE
)
{
stack
=
ch_malloc
(
(
depth
+
1
)
*
BDB_IDL_UM_SIZE
*
sizeof
(
ID
)
);
}
else
{
stack
=
search_stack
(
be
,
op
);
}
rc
=
bdb_filter_candidates
(
be
,
&
f
,
ids
,
stack
,
stack
+
BDB_IDL_UM_SIZE
);
rc
=
bdb_filter_candidates
(
be
,
&
f
,
ids
,
stack
,
stack
+
BDB_IDL_UM_SIZE
);
ch_free
(
stack
);
if
(
depth
+
1
>
SRCH_STACK_SIZE
)
{
ch_free
(
stack
);
}
if
(
rc
)
{
if
(
rc
)
{
#ifdef NEW_LOGGING
#ifdef NEW_LOGGING
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment