feature consistency in compile time configurable system
play

Feature Consistency in Compile-TimeConfigurable System Software - PowerPoint PPT Presentation

Feature Consistency in Compile-TimeConfigurable System Software Facing the Linux 10000 Feature Problem Reinhard Tartler , Daniel Lohmann, Julio Sincero, Wolfgang Schr oder-Preikschat System Software Group Friedrich-Alexander University


  1. Feature Consistency in Compile-Time–Configurable System Software Facing the Linux 10000 Feature Problem Reinhard Tartler , Daniel Lohmann, Julio Sincero, Wolfgang Schr¨ oder-Preikschat System Software Group Friedrich-Alexander University Erlangen-Nuremberg April 11, 2011 supported by

  2. System Software is Configurable System Software is incredibly configurable R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 2 – 19

  3. System Software is Configurable System Software is incredibly configurable Complexity increases considerably R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 2 – 19

  4. System Software is Configurable System Software is incredibly configurable Complexity increases considerably � Source of bugs ! R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 2 – 19

  5. System Software is Configurable System Software is incredibly configurable Linux v2.6.35 contains: Complexity increases considerably 11.057 Features � Source of bugs ! 27.166 Source files 82.116 #ifdef blocks R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 2 – 19

  6. Variability Implementation in Linux configuration space configuration variant user selection 1 config HOTPLUG_CPU bool "Support for ..." depends on SMP && ... 2 Kbuild KConfig files auto.make Kconfig 4 #define CONFIG_HOTPLUG_CPU #define CONFIG_SMP 3 ... #ifdef CONFIG_HOTPLUG_CPU ... #endif autoconf.h gcc source files implementation space implementation variant R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 3 – 19

  7. Variability Implementation in Linux R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 3 – 19

  8. Variability Implementation in Linux R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 3 – 19

  9. Variability Implementation in Linux R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 3 – 19

  10. Variability Implementation in Linux R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 3 – 19

  11. The Problem Configuration Implementation R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 4 – 19

  12. The Problem Configuration Source of Inconsistencies! Implementation R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 4 – 19

  13. Finding Bugs with Tools for Static Analysis Bugs in declaration and implementation Excellent tool support for static analysis: Dingo: Taming Device Drivers (EuroSys’09) KLEE: Automatic generation of high-coverage tests (EuroSys’08) RWset: Attacking path explosion (TACAS’08) EXE: Automatically generating inputs of death (CCS’06) ... R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 5 – 19

  14. Finding Bugs with Tools for Static Analysis Bugs in declaration and implementation Excellent tool support for static analysis: Dingo: Taming Device Drivers (EuroSys’09) KLEE: Automatic generation of high-coverage tests (EuroSys’08) RWset: Attacking path explosion (TACAS’08) EXE: Automatically generating inputs of death (CCS’06) ... Each of them is configuration agnostic: R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 5 – 19

  15. Outline 1. Introduction 2. Analysis 3. Approach and Implementation 4. Results 5. Future Work and Conclusions R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 6 – 19

  16. Problem Analysis Configuration Implementation

  17. Problem Analysis Configuration Implementation symbols symbols constraints constraints

  18. Problem Analysis Configuration Implementation config HOTPLUG_CPU symbols symbols constraints constraints depends on SMP && HOTPLUG

  19. Problem Analysis Configuration Implementation config HOTPLUG_CPU #ifdef CONFIG_CPU_HOTPLUG symbols symbols constraints constraints depends on SMP && HOTPLUG #ifdef CONFIG_CPU_HOTPLUG #else #endif

  20. Problem Analysis Configuration Implementation config HOTPLUG_CPU #ifdef CONFIG_CPU_HOTPLUG symbols symbols constraints constraints depends on SMP && HOTPLUG #ifdef CONFIG_CPU_HOTPLUG #else #endif

  21. Problem Analysis Configuration Implementation config HOTPLUG_CPU #ifdef CONFIG_CPU_HOTPLUG Symbolic � symbols symbols constraints constraints depends on SMP && HOTPLUG #ifdef CONFIG_CPU_HOTPLUG #else #endif

  22. Problem Analysis Configuration Implementation config HOTPLUG_CPU #ifdef CONFIG_CPU_HOTPLUG Symbolic � symbols symbols Logic � constraints constraints depends on SMP && HOTPLUG #ifdef CONFIG_CPU_HOTPLUG #else #endif R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 7 – 19

  23. Symbolic Inconsistency config HOTPLUG_CPU bool "Support for hot -pluggable CPUs" depends on SMP && HOTPLUG ---help --- R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 8 – 19

  24. Symbolic Inconsistency config HOTPLUG_CPU bool "Support for hot -pluggable CPUs" depends on SMP && HOTPLUG ---help --- static int hotplug_cfd (struct notifier_block *nfb , unsigned long action , void *hcpu) { // [...] switch (action) { case CPU_UP_PREPARE : case CPU_UP_PREPARE_FROZEN : // [...] #ifdef CONFIG_CPU_HOTPLUG case CPU_UP_CANCELED : case CPU_UP_CANCELED_FROZEN : case CPU_DEAD: case CPU_DEAD_FROZEN : free_cpumask_var (cfd ->cpumask ); break; #endif }; return NOTIFY_OK; R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 8 – 19

  25. Symbolic Inconsistency config HOTPLUG_CPU bool "Support for hot -pluggable CPUs" depends on SMP && HOTPLUG ---help --- Symbolic � static int hotplug_cfd (struct notifier_block *nfb , unsigned long action , void *hcpu) { // [...] switch (action) { case CPU_UP_PREPARE : case CPU_UP_PREPARE_FROZEN : // [...] #ifdef CONFIG_CPU_HOTPLUG case CPU_UP_CANCELED : case CPU_UP_CANCELED_FROZEN : case CPU_DEAD: case CPU_DEAD_FROZEN : free_cpumask_var (cfd ->cpumask ); break; #endif }; return NOTIFY_OK; Result: Fix for a critical bug R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 8 – 19

  26. Logic Inconsistencies #ifdef CONFIG DISCONTIGMEM MEMORY MODEL // Block 1 static . . . int pfn_to_mid ( . . . ) FLATMEM # ifdef CONFIG NUMA // Block 2 SPARSEMEM NUMA # else DISCONTIGMEM // Block 3 d n e o p s e n d # endif #endif R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 9 – 19

  27. Logic Inconsistencies #ifdef CONFIG DISCONTIGMEM MEMORY MODEL // Block 1 static . . . int pfn_to_mid ( . . . ) FLATMEM # ifdef CONFIG NUMA // Block 2 SPARSEMEM NUMA # else DISCONTIGMEM // Block 3 d n e o p s e n d # endif #endif Feature DISCONTIGMEM requires NUMA Inner block is not configuration dependent anymore R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 9 – 19

  28. Logic Inconsistencies #ifdef CONFIG DISCONTIGMEM MEMORY MODEL // Block 1 static . . . int pfn_to_mid ( . . . ) FLATMEM # ifdef CONFIG NUMA // Block 2 SPARSEMEM NUMA # else DISCONTIGMEM // Block 3 d n e o p s e n d # endif Logic � #endif Feature DISCONTIGMEM requires NUMA Inner block is not configuration dependent anymore R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 9 – 19

  29. Logic Inconsistencies #ifdef CONFIG DISCONTIGMEM MEMORY MODEL // Block 1 static . . . int pfn_to_mid ( . . . ) FLATMEM # ifdef CONFIG NUMA // Block 2 SPARSEMEM NUMA # else DISCONTIGMEM // Block 3 d n e o p s e n d # endif Logic � #endif Feature DISCONTIGMEM requires NUMA Inner block is not configuration dependent anymore Result: code cleanup R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 9 – 19

  30. Outline 1. Introduction 2. Analysis 3. Approach and Implementation 4. Results 5. Future Work and Conclusions R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 10 – 19

  31. General Approach #ifdef CONFIG DISCONTIGMEM MEMORY MODEL // Block 1 static . . . int pfn_to_mid ( . . . ) # ifdef CONFIG NUMA FLATMEM // Block 2 SPARSEMEM NUMA # else DISCONTIGMEM // Block 3 n d o e p s e n d # endif #endif R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 11 – 19

  32. General Approach #ifdef CONFIG DISCONTIGMEM MEMORY MODEL // Block 1 static . . . int pfn_to_mid ( . . . ) # ifdef CONFIG NUMA FLATMEM // Block 2 SPARSEMEM NUMA # else DISCONTIGMEM // Block 3 n d o e p s e n d # endif #endif R. Tartler Feature Consistency in Compile-Time–Configurable System Software (April 11, 2011) 11 – 19

Recommend


More recommend