. Kernel The Variability Model of the Linux Extra Conclusions - - PowerPoint PPT Presentation

kernel the variability model of the linux extra
SMART_READER_LITE
LIVE PREVIEW

. Kernel The Variability Model of the Linux Extra Conclusions - - PowerPoint PPT Presentation

. Krzysztof Czarnecki, Andrzej Wsowski The Variability Model of the Linux Kernel . . January 26, 2010 IT University of Copenhagen University of Leipzig University of Waterloo Steven She, Rafael Lotufo, Thorsten Berger, . Kernel The


slide-1
SLIDE 1

.

.

. Introduction Linux Study Conclusions Extra

The Variability Model of the Linux Kernel

Steven She, Rafael Lotufo, Thorsten Berger, Krzysztof Czarnecki, Andrzej Wąsowski

University of Waterloo University of Leipzig IT University of Copenhagen

January 26, 2010

. . The Variability Model of the Linux Kernel 1/18

slide-2
SLIDE 2

.

.

. Introduction Linux Study Conclusions Extra

Motivation

There is a growing number of variability modeling tools. We need practical benchmarks to evaluate these tools. Linux is a great example of a real software product line with a explicit variability model!

. . The Variability Model of the Linux Kernel 2/18

slide-3
SLIDE 3

.

.

. Introduction Linux Study Conclusions Extra

Motivation

There is a growing number of variability modeling tools. We need practical benchmarks to evaluate these tools. Linux is a great example of a real software product line with a explicit variability model!

. . The Variability Model of the Linux Kernel 2/18

slide-4
SLIDE 4

.

.

. Introduction Linux Study Conclusions Extra

Linux congurator

Variability model is specified using the Kconfig language.

. . The Variability Model of the Linux Kernel 3/18

slide-5
SLIDE 5

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration

menu "Power management and ACPI options" depends on !X86_VOYAGER config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that … config PM_DEBUG bool "Power Management Debug Support" depends on PM config CPU_IDLE bool "CPU idle PM support" default ACPI endmenu

. . The Variability Model of the Linux Kernel 4/18

slide-6
SLIDE 6

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration

menu "Power management and ACPI options" depends on !X86_VOYAGER config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that … config PM_DEBUG bool "Power Management Debug Support" depends on PM config CPU_IDLE bool "CPU idle PM support" default ACPI endmenu

. . The Variability Model of the Linux Kernel 4/18

slide-7
SLIDE 7

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration

menu "Power management and ACPI options" depends on !X86_VOYAGER config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that … config PM_DEBUG bool "Power Management Debug Support" depends on PM config CPU_IDLE bool "CPU idle PM support" default ACPI endmenu

. . The Variability Model of the Linux Kernel 4/18

slide-8
SLIDE 8

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration

menu "Power management and ACPI options" depends on !X86_VOYAGER config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that … config PM_DEBUG bool "Power Management Debug Support" depends on PM config CPU_IDLE bool "CPU idle PM support" default ACPI endmenu

. . The Variability Model of the Linux Kernel 4/18

slide-9
SLIDE 9

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration

menu "Power management and ACPI options" depends on !X86_VOYAGER config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that … config PM_DEBUG bool "Power Management Debug Support" depends on PM config CPU_IDLE bool "CPU idle PM support" default ACPI endmenu

. . The Variability Model of the Linux Kernel 4/18

slide-10
SLIDE 10

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration

menu "Power management and ACPI options" depends on !X86_VOYAGER config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that … config PM_DEBUG bool "Power Management Debug Support" depends on PM config CPU_IDLE bool "CPU idle PM support" default ACPI endmenu

. . The Variability Model of the Linux Kernel 4/18

slide-11
SLIDE 11

.

.

. Introduction Linux Study Conclusions Extra

Kcong feature model

PM_MENU → ¬X86_VOYAGER PM → ¬IA64_HP_SIM ACPI ↔ CPU_IDLE

. . The Variability Model of the Linux Kernel 5/18

slide-12
SLIDE 12

.

.

. Introduction Linux Study Conclusions Extra

Linux KCong → Feature Model

Analyzed four aspects of the Linux 2.6.28.6 Kconfig model in terms of feature modeling concepts:

  • characterized features,
  • model hierarchy,
  • constraints,
  • and natural language properties.

. . The Variability Model of the Linux Kernel 6/18

slide-13
SLIDE 13

.

.

. Introduction Linux Study Conclusions Extra

Comparing with published models

Compared Linux statistics with 32 published models1.

  • 19 models - software product lines
  • 8 models - other product lines (e.g. hardware, business)
  • 5 models - domain models (e.g. eCommerce systems)

Only 5 models describe real, existing software systems.

1http://www.splot-research.org . . The Variability Model of the Linux Kernel 7/18

slide-14
SLIDE 14

.

.

. Introduction Linux Study Conclusions Extra

Size of published models

2 4 6 8 10 12 14 50 100 150 200 250 300 Number of Feature Models Number of Features

Linux Kconfig model has 5426 features.

. . The Variability Model of the Linux Kernel 8/18

slide-15
SLIDE 15

.

.

. Introduction Linux Study Conclusions Extra

Size of published models

2 4 6 8 10 12 14 50 100 150 200 250 300 Number of Feature Models Number of Features

Linux Kconfig model has 5426 features.

. . The Variability Model of the Linux Kernel 8/18

slide-16
SLIDE 16

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-17
SLIDE 17

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-18
SLIDE 18

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-19
SLIDE 19

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-20
SLIDE 20

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-21
SLIDE 21

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-22
SLIDE 22

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-23
SLIDE 23

.

.

. Introduction Linux Study Conclusions Extra

Linux feature statistics

Kconfig Concept Features Mand. Grouped xor + or Config 5323 146

Non / User-Sel. 547 + 4744 Boolean 2005 136 Tristate 3130 10 Int 132 132 Hex 29 29 String 27 27

Menu 71 38 Choice 32 31 30 + 2 Total 5426 257 146 30 + 2

. . The Variability Model of the Linux Kernel 9/18

slide-24
SLIDE 24

.

.

. Introduction Linux Study Conclusions Extra

Published models vs. Linux

Concept Published Models (%) Linux (%) median min max mandatory features 25 66 4.74 grouped features 44 75 2.69 groups 16 35 0.59 xor 9 30 0.55

  • r

6 16 0.04

. . The Variability Model of the Linux Kernel 10/18

slide-25
SLIDE 25

.

.

. Introduction Linux Study Conclusions Extra

Code-granularity of features

Two heuristics for automatic feature selection in the Linux configurator: allyes, allno. Metric allyes allno ∆ θ Features 3,448 61 3387 1 Files 10,326 973 9,353 2.76 SLOC 4,266,171 210,302 4,055,869 1,197.48 ∆i = allyesi − allnoi; θi = ∆i/∆1

. . The Variability Model of the Linux Kernel 11/18

slide-26
SLIDE 26

.

.

. Introduction Linux Study Conclusions Extra

Code-granularity of features

Two heuristics for automatic feature selection in the Linux configurator: allyes, allno. Metric allyes allno ∆ θ Features 3,448 61 3387 1 Files 10,326 973 9,353 2.76 SLOC 4,266,171 210,302 4,055,869 1,197.48 ∆i = allyesi − allnoi; θi = ∆i/∆1

. . The Variability Model of the Linux Kernel 11/18

slide-27
SLIDE 27

.

.

. Introduction Linux Study Conclusions Extra

Qualitative characteristics

Subjective categorization of 180 randomly selected features.

Menu Support Option Debug No Info 1 97 46 13 23 User-based granularity categories of Linux features API Driver Kernel Protocol Subsystem No Info 5 120 15 14 1 25 Types of features in Linux kernel

. . The Variability Model of the Linux Kernel 12/18

slide-28
SLIDE 28

.

.

. Introduction Linux Study Conclusions Extra

Qualitative characteristics

Subjective categorization of 180 randomly selected features.

Menu Support Option Debug No Info 1 97 46 13 23 User-based granularity categories of Linux features API Driver Kernel Protocol Subsystem No Info 5 120 15 14 1 25 Types of features in Linux kernel

. . The Variability Model of the Linux Kernel 12/18

slide-29
SLIDE 29

.

.

. Introduction Linux Study Conclusions Extra

Hierarchy statistics

200 400 600 800 1000 1200 1400 1600 1800 1 2 3 4 5 6 7 8 Number of features Depth

  • 4544 leaves
  • well-balanced
  • relatively shallow

50 100 150 200 250 300 350 400 20 40 60 80-139 Number of features Number of children

  • many single childs
  • long tail

. . The Variability Model of the Linux Kernel 13/18

slide-30
SLIDE 30

.

.

. Introduction Linux Study Conclusions Extra

Constraint statistics

1000 2000 3000 4000 5000 6000 2 3 4 5 6 7 8 9 10-22 Number of constraints Number of unique features Requires Excludes Other

  • 9291 constraints
  • 82% features referenced
  • 89% requires constraints
  • some v. large constraints

Significant number of cross-tree constraints!

. . The Variability Model of the Linux Kernel 14/18

slide-31
SLIDE 31

.

.

. Introduction Linux Study Conclusions Extra

Constraint statistics

1000 2000 3000 4000 5000 6000 2 3 4 5 6 7 8 9 10-22 Number of constraints Number of unique features Requires Excludes Other

  • 9291 constraints
  • 82% features referenced
  • 89% requires constraints
  • some v. large constraints

Significant number of cross-tree constraints!

. . The Variability Model of the Linux Kernel 14/18

slide-32
SLIDE 32

.

.

. Introduction Linux Study Conclusions Extra

Identiers, prompts and descriptions

config PM bool "Power Management support" depends on !IA64_HP_SIM

  • --help---

"Power Management" means that parts of your computer are shut

  • ff or put into a power conserving "sleep" mode if they are not

being used. There are two competing standards for doing this: APM and ACPI. If you want to use either one, say Y here and then also to the requisite support below. Power Management is most important for battery powered laptop computers; if you have a laptop, check out the Linux Laptop home page on the WWW at <http://www.linux-on-laptops.com/> or Tuxmobil - Linux on Mobile Computers at <http://www.tuxmobil.org/> and the Battery Powered Linux mini-HOWTO, available from <http://www.tldp.org/docs.htmlhowto>.

. . The Variability Model of the Linux Kernel 15/18

slide-33
SLIDE 33

.

.

. Introduction Linux Study Conclusions Extra

Natural language properties

artifact

  • no. of characters
  • no. of words

median min max median min max identifiers 13 2 58 2 1 9 prompts 27 2 82 4 1 13 description

  • 29

2 392

Size of textual artifacts

text source most frequent domain terms identifier usb snd md serial fb debug prompt usb ethernet pci intel scsi pcmcia description usb linux scsi ethernet pci howto

Top domain terms

. . The Variability Model of the Linux Kernel 16/18

slide-34
SLIDE 34

.

.

. Introduction Linux Study Conclusions Extra

Natural language properties

artifact

  • no. of characters
  • no. of words

median min max median min max identifiers 13 2 58 2 1 9 prompts 27 2 82 4 1 13 description

  • 29

2 392

Size of textual artifacts

text source most frequent domain terms identifier usb snd md serial fb debug prompt usb ethernet pci intel scsi pcmcia description usb linux scsi ethernet pci howto

Top domain terms

. . The Variability Model of the Linux Kernel 16/18

slide-35
SLIDE 35

.

.

. Introduction Linux Study Conclusions Extra

Related work

  • Sincero and Schröder-Preikschat (ASPL 2008)
  • Tartler et al. - dead feature detection in Linux (FOSD 2009)
  • Segura and Ruiz-Cortés - FM benchmarks (VaMoS 2009)

. . The Variability Model of the Linux Kernel 17/18

slide-36
SLIDE 36

.

.

. Introduction Linux Study Conclusions Extra

Conclusions

  • Low number of mandatory features and groups.
  • Each feature crosses roughly 2.8 source files and 1200 SLOC.
  • Average leaf depth of 4, many single childs and long tail.
  • Significant number and size of cross-tree constraints.

1Available for download at http://fm.gsdlab.org . . The Variability Model of the Linux Kernel 18/18

slide-37
SLIDE 37

.

.

. Introduction Linux Study Conclusions Extra

Counting Constraints

Counted the number of distinct literals involved in the declaration of a constraint.

(MWINCHIP3D ∨ gcMCRUSOE ∨ gMEFFICEON ∨ MCYRIXIII∨ MK7 ∨ MK6 ∨ MPENTIUM4 ∨ MPENTIUMM ∨ MPENTIUMIII∨ MPENTIUMII ∨ M686 ∨ M586MMX ∨ M586TSC ∨ MK8∨ MVIAC3_2 ∨ MVIAC7 ∨ MGEODEGX1 ∨ MGEODE_LX∨ MCORE2) ∧ ¬X86_NUMAQ) ∨ X86_64) → X86_TSC = y Figure: Equation with 22 distinct literals

. . The Variability Model of the Linux Kernel 16/18

slide-38
SLIDE 38

.

.

. Introduction Linux Study Conclusions Extra

Kcong declaration (choice)

choice prompt "Subarchitecture Type" default X86_PC config X86_PC bool "PC-compatible" config X86_GENERICARCH bool "Generic architecture" depends on X86_32 if X86_GENERICARCH config X86_BIGSMP bool "Support for big SMP systems with more than 8 CPUs" depends on X86_32 && SMP endif endchoice

. . The Variability Model of the Linux Kernel 17/18

slide-39
SLIDE 39

.

.

. Introduction Linux Study Conclusions Extra

Kcong → Feature Model mapping

concepts Feature modeling concepts Switch config

Optional feature Entry-field config Mandatory feature Conditional menu Optional feature Unconditional menu Mandatory feature Choice Mandatory Mandatory feat. + xor-group Optional Optional feat. + xor-group Mandatory tristate Mandatory feat. + or-group Optional tristate Optional feat. + or-group Choice config Grouped feature Config, menu or choice nesting ➟ Sub-feature relation Visibility conditions

Cross-tree constraint Selects Constraining defaults

. . The Variability Model of the Linux Kernel 18/18