ArticleslgStudy

computer science

CRIU

CRIU is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand CRIU rather than just read about it. In short: Checkpoint/Restore In Userspace (CRIU) (pronounced kree-oo, /kriu/), is a software tool for the Linux operating system. Using this tool, it is possible to freeze a running application (or part of it) and checkpoint it to persistent storage as a collection of files.

Key takeaways

  • CRIU belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect CRIU to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of CRIU from memory before moving on to harder problems.

Reference excerpt

Checkpoint/Restore In Userspace (CRIU) (pronounced kree-oo, /kriu/), is a software tool for the Linux operating system. Using this tool, it is possible to freeze a running application (or part of it) and checkpoint it to persistent storage as a collection of files. One can then use the files to restore and run the application from the point it was frozen at. The distinctive feature of the CRIU project is that it is mainly implemented in user space, rather than in the kernel.

History The initial version of CRIU software was presented to the Linux developers community by Pavel Emelyanov, the OpenVZ kernel team leader, on 15 July 2011. In September 2011, the project was presented at the Linux Plumbers Conference. In general, most of the attendees took a positive view of the project, which is proven by the fact that a number of kernel patches required for implementing the project were included in the mainline kernel. Andrew Morton, however, was a bit skeptical:

A note on this: this is a project by various mad Russians to perform c/r mainly from userspace, with various oddball helper code added into the kernel where the need is demonstrated... However I'm less confident than the developers that it will all eventually work! So what I'm asking them to do is to wrap each piece of new code inside CONFIG_CHECKPOINT_RESTORE. So if it all eventually comes to tears and the project as a whole fails, it should be a simple matter to go through and delete all trace of it.

Use The CRIU tool is being developed as part of the OpenVZ project, with the aim of replacing the in-kernel checkpoint/restore. Though its main focus is to support the migration of containers, allowing users to check-point and restore the current state of running processes and process groups. The tool can currently be used on x86-64 and ARM systems and supports the following features:

Processes: their hierarchy, PIDs, user and group authenticators (UID, GID, SID, etc.), system capabilities, threads, and running and stopped states Application memory: memory-mapped files and shared memory Open files Pipes and FIFOs Unix domain sockets Network sockets, including TCP sockets in ESTABLISHED state (see below) System V IPC Timers Signals Terminals Linux kernel-specific system calls: inotify, signalfd, eventfd and epoll As of September 2013, no kernel patching is required because all of the required functionality has already been merged into the Linux kernel mainline since kernel version 3.11, which was released on September 2, 2013.

TCP connection migration One of the initial project goals was to support the migration of TCP connections, the biggest challenge being to suspend and then restore only one side of a connection. This was necessary for performing the live migration of containers (along with all their active network connections) between physical servers, the main scenario of using the checkpoint/restore feature in OpenVZ. To cope with this problem, a new feature, "TCP repair mode", was implemented. The feature was included in version 3.5 of the Linux kernel mainline and provides users with additional means to disassemble and reconstruct TCP sockets without the necessity of exchanging network packets with the opposite side of the connection.

References

Further reading Sanidhya Kashyap. "Rebootless Kernel Update and Validation". Rami Rosen. "Linux Containers and the Future Cloud" (PDF). CRIU Team. "Comparison to other CR projects".

Worked examples

Example 1 — a first encounter with CRIU

Start with the simplest possible case. Write down what CRIU claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to CRIU before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about CRIU ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of CRIU

In research
CRIU appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses CRIU in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
CRIU is common in secondary-school and first-year university syllabi. It links to neighbouring topics Linux-only free software, Linux software, so understanding it makes those chapters shorter.
In everyday life
Look for CRIU outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “CRIU” →

How to study CRIU in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what CRIU means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain CRIU out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is CRIU in simple terms?

Checkpoint/Restore In Userspace (CRIU) (pronounced kree-oo, /kriu/), is a software tool for the Linux operating system. Using this tool, it is possible to freeze a running application (or part of it) and checkpoint it to persistent storage as a collection of files.

Why does CRIU matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study CRIU?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on CRIU.

Tags

  • Linux-only free software
  • Linux software

Keep exploring