Toggle navigation
Toggle navigation
This project
Loading...
Sign in
UT
/
clsync
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Authored by
redmine
2015-05-21 19:58:22 +0300
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
e860a988c03f30f988794451539fbf3435c144e5
e860a988
1 parent
a624a07d
[hllock] Decreased non-priv cpu utilization
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
8 deletions
configuration.h
privileged.c
configuration.h
View file @
e860a98
...
...
@@ -215,7 +215,7 @@ expire-after:20M\n\
// Upper limit
#define HL_LOCK_AUTO_LIMIT_HIGH (1<<20)
#define HL_LOCK_NONPRIV_TRIES (HL_LOCK_AUTO_LIMIT_HIGH <<
6
)
#define HL_LOCK_NONPRIV_TRIES (HL_LOCK_AUTO_LIMIT_HIGH <<
8
)
//#define READWRITE_SIGNALLING
...
...
privileged.c
View file @
e860a98
...
...
@@ -330,6 +330,7 @@ struct cmd_ret {
volatile
struct
pa_ret
ret_buf
;
volatile
void
*
ret
;
volatile
int
_errno
;
volatile
int
processing_longcmd
;
};
volatile
struct
cmd
*
cmd_p
;
volatile
struct
cmd_ret
*
cmd_ret_p
;
...
...
@@ -1162,7 +1163,9 @@ int privileged_handler(ctx_t *ctx_p)
case
PA_WAITPID
:
{
struct
pa_waitpid_arg
*
arg_p
=
(
void
*
)
&
cmd_p
->
arg
.
waitpid
;
debug
(
20
,
"PA_WAITPID(%u, 0x%o)"
,
arg_p
->
pid
,
arg_p
->
options
);
cmd_ret_p
->
ret
=
(
void
*
)(
long
)
waitpid
(
arg_p
->
pid
,
&
arg_p
->
status
,
arg_p
->
options
);
cmd_ret_p
->
processing_longcmd
=
1
;
cmd_ret_p
->
ret
=
(
void
*
)(
long
)
waitpid
(
arg_p
->
pid
,
&
arg_p
->
status
,
arg_p
->
options
);
cmd_ret_p
->
processing_longcmd
=
0
;
break
;
}
default:
...
...
@@ -1235,10 +1238,8 @@ static inline int privileged_action(
rc
=
ENOENT
;
goto
privileged_action_end
;
}
if
(
++
counter
>
HL_LOCK_NONPRIV_TRIES
)
{
if
(
cmd_ret_p
->
processing_longcmd
&&
++
counter
>
HL_LOCK_NONPRIV_TRIES
)
sleep
(
SLEEP_SECONDS
);
counter
=
0
;
}
}
}
else
{
# endif
...
...
@@ -1312,10 +1313,8 @@ static inline int privileged_action(
rc
=
ENOENT
;
goto
privileged_action_end
;
}
if
(
++
counter
>
HL_LOCK_NONPRIV_TRIES
)
{
if
(
cmd_ret_p
->
processing_longcmd
&&
++
counter
>
HL_LOCK_NONPRIV_TRIES
)
sleep
(
SLEEP_SECONDS
);
counter
=
0
;
}
}
# ifdef HL_LOCK_TRIES_AUTO
...
...
Please
register
or
login
to post a comment