SlideShare a Scribd company logo
1 of 13
Download to read offline
“Unlimited” Event Channels
David Vrabel

24 October 2013
What are Event Channels?

Paravirtual interrupts
Edge triggered
Bidirectional
Directed at a single VCPU

24 October 2013

“Unlimited” Event Channels

2 / 13
How do Event Channels Work?
Domain A

1

Domain B

Notify

Xen

24 October 2013

Shared Memory

2

4

Set Pending

“Unlimited” Event Channels

Call Handlers

3

Upcall

3 / 13
Original (2-Level) Design
Per-VCPU Shared Memory
64 bits
Selector

...

1

Shared Memory
64 bits
Pending

...

Masked

0

1

0

0

...

...

0

1

0

...

...
...

4096 bits

24 October 2013

“Unlimited” Event Channels

4 / 13
Problems

Too few
No priorities
Unfair

24 October 2013

“Unlimited” Event Channels

5 / 13
Additional Requirements

Identical ABI between 32-bit and 64-bit guests
Reasonable memory usage
Easily extensible

24 October 2013

“Unlimited” Event Channels

6 / 13
New (FIFO-based) Design
Bit 15

READY

1

0

Bit 31

1

Port 0
1

(Reserved)

30

29

16

0

P

M

L

LINK

1

0

1

6

1

0

1

0

1

0

1

3

2
3

HEAD
Priority 0

5

1
...

Per-VCPU shared memory
24 October 2013

6
7
...

1

15

4

Up to 132,072 words

Shared memory
“Unlimited” Event Channels

7 / 13
Raising an Event
function raise(q, p)

1. Set pending

E[p].pending = 1
if not E[p].masked and not E[p].linked
E[p].linked = 1
if T[q] != p
linked = link(T[q], p)
else
linked = false
if not linked
C.head[q] = p
T[q] = p

24 October 2013

2. Unmasked and not in list?
Add to list
3. Set LINK of tail
or
Set HEAD in control block
4. Advance tail

“Unlimited” Event Channels

8 / 13
Handling an Event
function handle_one_event(q)

1. Get local head

p = H[q]
if p == 0
p = C.head[q]
link = unlink(p)
H[q] = link
if E[p].pending and not E[p].masked
handle(p)

2. List was empty?
Get new HEAD from
control block
3. Clear LINKED and LINK
4. Advance local head
5. Pending and unmasked?
Handle IRQ

24 October 2013

“Unlimited” Event Channels

9 / 13
Event Channel Fairness
3000
2-Level
FIFO-based

Latency (ns)

2500
2000

1500

1000
500

0

75

80

85

90

Event Channel Port
24 October 2013

“Unlimited” Event Channels

10 / 13
Current Status

Xen support in 4.4
Linux support in 3.14

24 October 2013

“Unlimited” Event Channels

11 / 13
Further Work

Investigate how priorities may be used
Add support for limiting number of event channels to other toolstacks (XAPI,
libvirt)
Add support in other OSes
Xen event lock scalability
Linux PIRQ setup/teardown refactoring

24 October 2013

“Unlimited” Event Channels

12 / 13
Questions?

Design Document
http://xenbits.xenproject.org/people/dvrabel/event-channels-F.pdf

24 October 2013

“Unlimited” Event Channels

13 / 13

More Related Content

More from The Linux Foundation

More from The Linux Foundation (20)

ELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made SimpleELC2019: Static Partitioning Made Simple
ELC2019: Static Partitioning Made Simple
 
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
XPDDS19: How TrenchBoot is Enabling Measured Launch for Open-Source Platform ...
 
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
XPDDS19 Keynote: Xen in Automotive - Artem Mygaiev, Director, Technology Solu...
 
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
XPDDS19 Keynote: Xen Project Weather Report 2019 - Lars Kurth, Director of Op...
 
XPDDS19 Keynote: Unikraft Weather Report
XPDDS19 Keynote:  Unikraft Weather ReportXPDDS19 Keynote:  Unikraft Weather Report
XPDDS19 Keynote: Unikraft Weather Report
 
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
XPDDS19 Keynote: Secret-free Hypervisor: Now and Future - Wei Liu, Software E...
 
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, XilinxXPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
XPDDS19 Keynote: Xen Dom0-less - Stefano Stabellini, Principal Engineer, Xilinx
 
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
XPDDS19 Keynote: Patch Review for Non-maintainers - George Dunlap, Citrix Sys...
 
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, BitdefenderXPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
XPDDS19: Memories of a VM Funk - Mihai Donțu, Bitdefender
 
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...OSSJP/ALS19:  The Road to Safety Certification: Overcoming Community Challeng...
OSSJP/ALS19: The Road to Safety Certification: Overcoming Community Challeng...
 
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making... OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
OSSJP/ALS19: The Road to Safety Certification: How the Xen Project is Making...
 
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, CitrixXPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
XPDDS19: Speculative Sidechannels and Mitigations - Andrew Cooper, Citrix
 
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltdXPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
XPDDS19: Keeping Coherency on Arm: Reborn - Julien Grall, Arm ltd
 
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
XPDDS19: QEMU PV Backend 'qdevification'... What Does it Mean? - Paul Durrant...
 
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&DXPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
XPDDS19: Status of PCI Emulation in Xen - Roger Pau Monné, Citrix Systems R&D
 
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM SystemsXPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
XPDDS19: [ARM] OP-TEE Mediator in Xen - Volodymyr Babchuk, EPAM Systems
 
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
XPDDS19: Bringing Xen to the Masses: The Story of Building a Community-driven...
 
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
XPDDS19: Will Robots Automate Your Job Away? Streamlining Xen Project Contrib...
 
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
XPDDS19: Client Virtualization Toolstack in Go - Nick Rosbrook & Brendan Kerr...
 
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSEXPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
XPDDS19: Core Scheduling in Xen - Jürgen Groß, SUSE
 

Recently uploaded

Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024Manulife - Insurer Innovation Award 2024
Manulife - Insurer Innovation Award 2024
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 

XPDS13: "Unlimited" Event Channels - David Vrabel, Citrix

  • 1. “Unlimited” Event Channels David Vrabel 24 October 2013
  • 2. What are Event Channels? Paravirtual interrupts Edge triggered Bidirectional Directed at a single VCPU 24 October 2013 “Unlimited” Event Channels 2 / 13
  • 3. How do Event Channels Work? Domain A 1 Domain B Notify Xen 24 October 2013 Shared Memory 2 4 Set Pending “Unlimited” Event Channels Call Handlers 3 Upcall 3 / 13
  • 4. Original (2-Level) Design Per-VCPU Shared Memory 64 bits Selector ... 1 Shared Memory 64 bits Pending ... Masked 0 1 0 0 ... ... 0 1 0 ... ... ... 4096 bits 24 October 2013 “Unlimited” Event Channels 4 / 13
  • 5. Problems Too few No priorities Unfair 24 October 2013 “Unlimited” Event Channels 5 / 13
  • 6. Additional Requirements Identical ABI between 32-bit and 64-bit guests Reasonable memory usage Easily extensible 24 October 2013 “Unlimited” Event Channels 6 / 13
  • 7. New (FIFO-based) Design Bit 15 READY 1 0 Bit 31 1 Port 0 1 (Reserved) 30 29 16 0 P M L LINK 1 0 1 6 1 0 1 0 1 0 1 3 2 3 HEAD Priority 0 5 1 ... Per-VCPU shared memory 24 October 2013 6 7 ... 1 15 4 Up to 132,072 words Shared memory “Unlimited” Event Channels 7 / 13
  • 8. Raising an Event function raise(q, p) 1. Set pending E[p].pending = 1 if not E[p].masked and not E[p].linked E[p].linked = 1 if T[q] != p linked = link(T[q], p) else linked = false if not linked C.head[q] = p T[q] = p 24 October 2013 2. Unmasked and not in list? Add to list 3. Set LINK of tail or Set HEAD in control block 4. Advance tail “Unlimited” Event Channels 8 / 13
  • 9. Handling an Event function handle_one_event(q) 1. Get local head p = H[q] if p == 0 p = C.head[q] link = unlink(p) H[q] = link if E[p].pending and not E[p].masked handle(p) 2. List was empty? Get new HEAD from control block 3. Clear LINKED and LINK 4. Advance local head 5. Pending and unmasked? Handle IRQ 24 October 2013 “Unlimited” Event Channels 9 / 13
  • 10. Event Channel Fairness 3000 2-Level FIFO-based Latency (ns) 2500 2000 1500 1000 500 0 75 80 85 90 Event Channel Port 24 October 2013 “Unlimited” Event Channels 10 / 13
  • 11. Current Status Xen support in 4.4 Linux support in 3.14 24 October 2013 “Unlimited” Event Channels 11 / 13
  • 12. Further Work Investigate how priorities may be used Add support for limiting number of event channels to other toolstacks (XAPI, libvirt) Add support in other OSes Xen event lock scalability Linux PIRQ setup/teardown refactoring 24 October 2013 “Unlimited” Event Channels 12 / 13