the kernel reportthe best solution someday. where are the patches? big.little switcher not upstream...

65
The kernel report (LinuxCon Japan 2013 edition) Jonathan Corbet LWN.net [email protected]

Upload: others

Post on 13-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

The kernel report

(LinuxCon Japan 2013 edition)

Jonathan CorbetLWN.net

[email protected]

Page 2: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

The kernel report(and weather forecast)

(LinuxCon Japan 2013 edition)

Jonathan CorbetLWN.net

[email protected]

Page 3: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

In the dim and distant past

Page 4: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

In the dim and distant past

(May 20, 2012)

The 3.4 kernel was released

Page 5: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Since then...

69,863 changesets merged3,173 developers have contributed360+ employers have contributed5 kernels releasedThe kernel is 1.57 million lines bigger

Page 6: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Recent release history

Release Date Days Csets Devs3.4 May 20 63 10,899 1,2863.5 July 21 62 10,957 1,1953.6 Sep 30 71 10,247 1,2163.7 Dec 10 71 11,990 1,2713.8 Feb 18 70 12,394 1,2533.9 Apr 28 69 11,910 1,3393.10 12,776* 1,237*

* so far

Page 7: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

A few headline features

Bufferbloat fixesAndroid integrationdm-verity, dm-cachex32 ABISeccomp filtersUser namespacesuprobesTCP fast openBtrfs send/receive, RAIDKernel hardening

64-bit ARM supportOpenVSwitchNUMA balancingKernel mem. acc'tingARM single zImageARM virtualizationPer-entity load trackingMemory pressure notif.Dynamic tickXFS metadata checksum...

Page 8: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Most active employers (3.4..)

(None) 11.3%Red Hat 9.8%Intel 8.4%(unknown) 7.2%Linaro 4.5%Texas Inst. 4.2%SUSE 3.3%IBM 3.0%Vision Engraving 3.0%Samsung 2.8%Google 2.5%

NVIDIA 1.4%Wolfson Micro 1.3%Oracle 1.3%Renasas Elect. 1.2%Freescale 1.2%consultants 1.2%Broadcom 1.2%Cisco 1.1%LINBIT 1.0%Inktank Storage 1.0%Ingics Tech 1.0%

Page 9: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Mobile/embedded participation

Page 10: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Lots going on out there

Page 11: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Lots going on out there(as usual)

Page 12: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

The 3.10 kernel

Due in early July

Features(Nearly) full dynamic tickBcacheMultiple ftrace buffersMemory pressure notificationsTCP tail loss probingARM single zImage workXFS metadata checksumsArm big.LITTLE preparation...

Page 13: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Scheduling

Page 14: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

NUMA balancing

Page 15: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

NUMA balancing

Page 16: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

NUMA balancing

Page 17: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

NUMA balancing

Page 18: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

NUMA balancing

Page 19: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Toward better NUMA performance

NUMA scheduling framework added v3.8

Ideas:A “home node” for processesActively migrate pages when processes move...

Page 20: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

There's more

Page 21: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Power-aware scheduling

Linux is very good when there's no work to do

The problem is easy on a busy system

Page 22: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Power-aware scheduling

Page 23: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Power-aware scheduling

Page 24: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Approaches to power-aware scheduling

Pack small tasks togetherDon't let them wake multiple processors

Spread big tasks outTry to get to idle quickly

Page 25: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Wait...there's more!

Page 26: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

big.LITTLE

Page 27: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Approaches to big.LITTLE

Switch all CPUs transparently in a hypervisorAn apparent 4-CPU systemKernel is unaware of switching

Page 28: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Approaches to big.LITTLE

Switch all CPUs transparently in a hypervisorAn apparent 4-CPU systemKernel is unaware of switching

Bundle pairs of big and little CPUsTreat it like frequency scaling“The big.LITTLE switcher”

Page 29: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Approaches to big.LITTLE

Switch all CPUs transparently in a hypervisorAn apparent 4-CPU systemKernel is unaware of switching

Bundle pairs of big and little CPUsTreat it like frequency scaling“The big.LITTLE switcher”

Teach the scheduler about heterogeneous systems“big LITTLE MP” patches existThe best solution someday

Page 30: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Where are the patches?

big.LITTLE switcherNot upstreamCode not yet recently posted

big LITTLE MPEarly-stage patches postedTrouble getting review and integration

Page 31: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Why is this stuff hard to merge?

Fear of regressions

Page 32: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Who hacks arch/arm* (3.3-3.9)

Linaro 15%Texas Instruments 12%(none) 7%consultants 7%ARM 6%NVIDIA 6%Samsung 5%Renesas Electronics 3%Atomide 3%Free Electrons 3%Freescale 3%Calxeda 2%

Page 33: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Who hacks {kernel,mm,fs}/

Red Hat 25%SUSE 8%NetApp 8%Google 5%Parallels 5%(none) 4%IBM 4%Oracle 4%Linaro 4%Fujitsu 4%Intel 3%Arista Networks 3%

Page 34: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

“Linux kernel development is driven by the needs of enterprise

computing.”

Page 35: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

We have an interesting integration problem

Page 36: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Why bother?

Maybe we need two kernels?One for enterprise / desktopOne for mobile / embedded

Page 37: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Features inflicted upon embedded by the enterprise

Symmetric multi-processingSupport for >1GB of memory on 32-bit systemsThe ext3/ext4 filesystemsThe completely fair schedulerBest-of-breed networking…

Page 38: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

One kernel for everybody is one of our strengths

Page 39: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

What about Android?

Much code merged

Some has been replacedIncluding wakelocks!

Some remains outsideION memory manager…

Google continues to innovate

Page 40: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Networking

Page 41: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Multipath TCP

Your phone has (at least) two interfacesOnly one is used at a time

3G celltower

IP 1.2.3.4

IP 5.6.7.8

Page 42: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Multipath TCP

What if both could be used together?

Better bandwidthTraffic can run across both links simultaneously

More reliablePaths can come and go - connection remains

Page 43: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Useful in data centers too

Page 44: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Multipath TCP status

Patches existLots of information on multipath-tcp.orgSpeed record for TCP claimedMainline merging still distant

But that's not the interesting part...

Page 45: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

The innovation-hostile net

Multipath TCP is complexFlow managementCongestion controlSecurity issues…

Where the real challenge was:The dreaded middlebox

Page 46: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Middleboxes

These boxes will:Change IP addresses on the fly (ports too)Add or remove TCP flagsResegment dataACK undelivered dataCorrupt the data itselfBlock anything that looks “scary”

Thus:MPTCP must look exactly like TCP

Page 47: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Network innovation comes to Linux first

Page 48: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Network innovation comes to Linux first

...but...

Page 49: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Deploying new protocols on the net has become nearly impossible.

Page 50: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Other interesting stuff

Page 51: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

CPU isolation

When you must have the whole CPU to yourself

With 3.10:No timer tickNo RCU callbacks…

Useful for:High-performance computingRealtime

Page 52: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Security

Page 53: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Attackers are reviewing our code better than we are

Page 54: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Some improvements

Better testingTrinity - fuzz testing

Kernel hardening efforts

Useful new technologiesUser namespaces...

Page 55: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

It's still not good enough.

Page 56: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Innovation

Page 57: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Different views of Linux

Classic LinuxKernelGNU libcSYSV initX11Desktop env

Page 58: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Different views of Linux

Classic LinuxKernelGNU libcSYSV initX11Desktop env

AndroidKernelBionicinit.rcSurfaceFlingerDalvik

Page 59: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Different views of Linux

Classic LinuxKernelGNU libcSYSV initX11Desktop env

AndroidKernelBionicinit.rcSurfaceFlingerDalvik

UbuntuKernelGNU libcupstartMirUnity

Page 60: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Are we repeating the Unix wars?

Page 61: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed
Page 62: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

Interesting things are now done on Linux first

Page 63: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed
Page 64: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed
Page 65: The kernel reportThe best solution someday. Where are the patches? big.LITTLE switcher Not upstream Code not yet recently posted ... Lots of information on multipath-tcp.org Speed

It's up to us to find the path(s)