Skip to content

Do unprivileged CRIU dump if requested+supported - #14836

Merged
tajila merged 1 commit into
eclipse-openj9:masterfrom
ymanton:criu-unprivileged
Apr 6, 2022
Merged

tajila merged 1 commit into
eclipse-openj9:masterfrom
ymanton:criu-unprivileged

Conversation

@ymanton

@ymanton ymanton commented Apr 1, 2022

Copy link
Copy Markdown
Member

If the user requests an unprivileged CRIU dump we check
if a non-NULL criu_set_unprivileged symbol can be found via
dlsym() and if so call it with true as the parameter.

If the user requests an unprivileged CRIU dump but the symbol
cannot be found we throw an exception.

If the user does not request an unprivileged CRIU dump we do
nothing as CRIU (currently) defaults to privileged.

Also link against libdl to get access to dlsym().

Signed-off-by: Younes Manton ymanton@ca.ibm.com

@ymanton ymanton added the criu Used to track CRIU snapshot related work label Apr 1, 2022
@ymanton

ymanton commented Apr 1, 2022

Copy link
Copy Markdown
Member Author

FYI @tajila @tjwatson

The corresponding Open Liberty PR is OpenLiberty/open-liberty#20683

Comment thread runtime/nls/j9cl/j9jcl.nls Resolved
@ymanton
ymanton force-pushed the criu-unprivileged branch from 7d81d4d to e90bad6 Compare April 1, 2022 19:10

@tajila tajila left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, just some formatting things

Comment thread runtime/criusupport/criusupport.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

format: } else {

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

Comment thread runtime/criusupport/criusupport.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use camelCase for naming here

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

Comment thread runtime/criusupport/criusupport.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be JNI_TRUE

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

Comment thread runtime/criusupport/criusupport.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it defined with bool in the criu API?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. I actually added the function since it is missing from checkpoint-restore/criu#1155 however other functions taking a boolean (e.g. criu_set_shell_job) also define their booleans as bool.

@ymanton
ymanton force-pushed the criu-unprivileged branch from e90bad6 to 1577bd4 Compare April 1, 2022 20:38
Comment thread runtime/criusupport/criusupport.cpp Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please JNI_FALSE != unprivileged for consistency

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

If the user requests an unprivileged CRIU dump we check
if a non-NULL `criu_set_unprivileged` symbol can be found via
dlsym() and if so call it with `true` as the parameter.

If the user requests an unprivileged CRIU dump but the symbol
cannot be found we throw an exception.

If the user does not request an unprivileged CRIU dump we do
nothing as CRIU (currently) defaults to privileged.

Also link against libdl to get access to dlsym().

Signed-off-by: Younes Manton <ymanton@ca.ibm.com>
@ymanton
ymanton force-pushed the criu-unprivileged branch from 1577bd4 to cbb83ab Compare April 6, 2022 04:59
@tajila

tajila commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

Jenkins compile xlinuxcriu jdk11

@tajila

tajila commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

Jenkins test sanity win jdk8

@tajila

tajila commented Apr 6, 2022

Copy link
Copy Markdown
Contributor

Jenkins test sanity plinux jdk11

@tajila
tajila merged commit 9554590 into eclipse-openj9:master Apr 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

criu Used to track CRIU snapshot related work

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants