Linux 4.0 no longer requires a reboot

  • 2020-05-13 04:09:21
  • OfStack

In Linux 4.0, you may never have to restart your operating system again.

One of the reasons you like linux on most servers or data centers is that you don't have to reboot as often. Sure, some critical patches will have to be rebooted, but you can wait months to do so. Now, thanks to the latest update to the linux kernel, you may not have to reboot for years.

Thanks to the Ksplice project, this feature was made available in 2009. After comparing the original and patched kernels, this project USES a custom kernel module to add new code to the running kernel. In the Ksplice-enabled kernel, each function to be patched carries a special set of flags to distinguish it from the others. The Ksplice process monitors whether the code that is patching the function is currently out of use, dangdang, patch it, and run it on your server.

Oracle acquired the Ksplice project in 2011 and used it as an optional service of RHEL for its own Oracle Linux (a clone of RHEL (Red Hat Enterprise Linux). This isolates the technology from other enterprise and server versions of Linux.

Since then, KemelCare has released a non-starter patch service for most enterprise releases of Linux. This program is proprietary software and can only be used for monthly payments. This makes it difficult to satisfy most Linux system administrators.

So, Red Hat and SUSE have embarked on a fully open source, non-restart solution for installing serious patches for Linux. The Red Had project is named kpatch, and the SUSE project is named kGraft.

The two companies took different approaches. Kpatch issued an stop_machine() command. After that, it looks at the existing stack processing to use ftrace, and if patching can be done safely, it redirects the running code to the patching function, and then removes the currently outdated code.

Better than ever, data centres are running all over the world, but many of them require a 21st-century reboot. Today's data centers must be more efficient, robust, and flexible than ever before. We examine how to run your data center, as opposed to outsourcing to a cloud or a service provider, or taking a hybrid approach.

Kgraft 1 USES ftrace directly, although it works at the thread level. When an old function is called, it locates a point in the thread and then switches it to the new function.

Although the end result was the same, that is, the operating system stayed up while patching, there were significant performance differences. While kGraft can take a few minutes, Kpatch can take between 1 and 40 milliseconds, but they never stop.
At the linux developer conference in October 2014, two small groups, 2, were working together to make linux's patch work stop restarting. In fact, they ended up dropping both kpatch and kGraft into the Linux kernel.

Jiri Kosina, one SUSE software engineers and Linux kernel developers explained that Linux kernel hotfixes will "provide a basic infrastructure for function" hot patch (for example: redirect code), including in order to contain the actual patch the kernel module of API (application programming interface), and for operating in user space can patch API/ABI 2 base interface (application) and this is a "relatively easy and simple, because the use of it as much as the foundation of the existing kernel (called ftrace). It's also self-contained, in the sense that it doesn't call itself from any other kernel subsystem (it doesn't even touch any other code)."

Linux 4.0 RC version has now been released, and Kosina claims that "the x86 architecture currently in place is only a reference architecture, and support for powerpc, s390 and arm is already in the works". Indeed, the source code for supporting these architectures is already available on Live Patching Git code.
Simple code is just the beginning, and your distribution will support and use it with patches. With support for Red Hat and SUSE, the live patch will soon be available by default in all commercial Linux distributions.

That's all for this article, I hope you enjoy it.


Related articles: