• Non ci sono risultati.

Hot Patching

N/A
N/A
Protected

Academic year: 2021

Condividi "Hot Patching"

Copied!
14
0
0

Testo completo

(1)

Hot Patching

Advanced Operating Systems and Virtualization Alessandro Pellegrini

A.Y. 2019/2020

(2)

Why hot patching?

• Huge costs of downtime → reduce cost of planned downtime

• Common tiers of change management:

– incident response

• "we are down and/or exploited"

– emergency change

• "we could go down: we are vulnerable"

– scheduled change

• "time is not critical, we keep safe"

2

Hot Patching

is handy here!

(3)

Why is Rebooting a Problem?

• Disruption to users/applications

• Sysadmins don't always have control of users or applications

• Many applications aren't distributed

• Re-architecting can be expensive or impractical

• Distributed systems need to reboot too

• (Up)time is money

• Hardware reboot failures

(4)

50k Sandy Bridge cores

The most beautiful

supercomputer in the world

Terabytes of data

Reboot?

© BSC

4

Barcelona Supercomputing Center

Mare Nostrum Supercomputer

(5)

NASA JPL

© NASA JPL

5m telescope with adaptive optics on Mount Palomar

Avoid atmospheric blurring in Real Time

Control 3888 segments of a deformable mirror with a latency <250 μs

Reboot?

Hale telescope PALM-3000 Adaptive optics

(6)

SAP HANA

4-16 TB of RAM

All operations done in memory

Disk used for journalling

Active-Passive HA

Failover measured in seconds

Reboot?

© HP

6

HP DL980 w/ 12 TB RAM

In-memory database and analytics engine

(7)

Not a New Idea:1943 Manhattan Project

• IBM punchcard automatic calculators were used to crunch the numbers

• A month before the Trinity nuclear device test, the question was: “What will the yield be, how much energy will be released?”

• The calculation would normally take three months to complete –

recalculating any batches with errors

• Multiple colored punch cards introduced to fix errors in

calculations while the calculator was running

Trinity test site, 16ms after initiation

(8)

Windows Hot Patching (2003)

• Windows Server 2003 SP1

• Stops Kernel execution for activeness check

– Schedule deferred procedure calls on all but current CPUs and keep them busy

• Uses short jumps patched into functions for redirection

– The second redirection jumps to a new function

• Removed in Windows 8 and later versions

– only ~10 patches used it in 12 years of support

(9)

Linux kpatch (2014)

• Tries to overcome the costs and problems of rebooting systems to apply patches

• Based on two "simple" steps:

1. Build the patch module ( kpatch-build foo.patch )

2. Apply the patch ( kpatch load kpatch-foo.ko )

(10)

Building the Patch Module

• Much harder than patching the kernel

• Compile kernel with/without patch

• Compare binaries

• Detect which functions have changed

• Extract object code of changed functions into

patch module

(11)

Patching the Kernel

• Load new functions into memory

• Link new functions into kernel

• Allows access to unexported kernel symbols

• Activeness safety check

• Prevent old & new functions from running at same

• stop_machine() + stack backtrace checks time

• Patch it!

• Uses ftrace

(12)

What is ftrace?

• Ftrace is the first generic tracing system to get mainlined

– Mainlined in 2.6.27

– Derived from RT-preempt latency tracer

• Provides a generic framework for tracing

– Infrastructure for defining tracepoints

– Ability to register different kinds of tracers

– Specialized data structure (ring buffer) for trace

data storage

(13)

ftrace Schematization

Caller

Function

Func exit Tracer

mcount

Func entry Tracer

Thead_info struct ret_stack

Stack caller 1 caller 2

ret addr

(14)

Patching with ftrace

Original Functio n

ftrace kpatch

New Functio n

call

return

return

no opnoop

Old Functio n

Original Functio n

call

no op

Old Functio n

Before patching:

14

After patching:

call

return

call

Riferimenti

Documenti correlati

In particular, acoustic requirements concern the following parameters and limit values: x Sound Reduction Index of external windows: Rw • 25 dB; x Sound Reduction Index of air ducts

Inoltre, quando si intende interpretare un profilo ematologico nella specie equina, bisogna tenere presenti alcune caratteristiche specifiche dell’emogramma in questa

• chap 2 presents a detailed description of machine’s characteristics used • chap 3 defines the page ranking problem from the theoretical point of view • chap 4 describes

Figura 4.19 - Biometano immesso in rete per inseguimento termico con caldaia In Figura 4.20 sono rappresentati i flussi energetici annuali legati alla potenza elettrica.. Figura 4.20

The optimization of total nitrogen removal from municipal wastewater was investigated in a laboratory- scale photo-sequencing batch reactor (PSBR) operated with a mixed

In the present article, we aim to obtain the general solution without imposing the supplementary condition Equation ( 5 ) in order to have the model for dense gases and in

E accanto alla portata pubblica della sua eredità culturale, esiste anche una dimensione privata e biografica che fa sentire Grazia Deledda ancora più vicina a chi come lei, e