Back to the OS
Vineet GuptaGM – Software Engineering, Directi
http://vineetgupta.spaces.live.com/
It’s Commodity – Why Bother!
Meet the New PC
• Apple Mac Pro• 3.0 GHz Intel Xeon• 8 Cores
Intel TeraScale – 80 Cores in 5 years
Source: http://techresearch.intel.com/articles/terascalepop.html
Welcome to Many-Core
The Free Lunch is Over
• No more “Old apps get faster on newer hardware”
• To make apps take advantage of new hardware, you need to utilize more cores– 99% of code is serial!
• Impact is even higher on Desktop
Disk Is Tape
• The straw to disk is getting skinnier– Each generation:
• Capacity increases with areal density• Read/Write time with linear density
• 10+ Terabyte disks projected for 2010 ( $100 or so)– 5-15 hours read sequentially– 15-150 days to read randomly
Need to Treat Most of Disk as Cold Storage
Flash Is Disk
• Flash capacity doubled each year since 1995– Market driven by phone, camera, iPod– Low entry-cost $30/chip $3/chip
• Flash makes a better “disk” than disk– 5000 I/Os per second
• Read 20MB/sec; Write 10MB/sec (per chip)• N chips N * Bandwidth
– 8 chips plus controller 1 Watt !
2007 SATADisk
SCSIDisk
Flash DRAM
GB/$ 3.33 0.50 0.08 0.01
IOPS/GB 0.2 4 200 5,000,000
GB/Watt 50 5 100 0.5
SATA Disks 40XCheaper per GB (2007)
Current TrendsShow PriceCrossover
in 2012 or so…(SATA = Flash)
A Fat Straw RemainingFat as Capacity Rises
Flash Is COOL!
2010: 128GB Flash disk for $40
Storage Is Changing
Flash Is Disk…
Disk Is Tape…
Tape Is Dead…
Flash Is Cool…
The OS is far from being commodity
Please do bother!
Agenda
• Parallelism• Storage• User Interaction• Power• Security• Management
Parallelism
Sequential Programs Concurrent Programs
Behavior Deterministic NondeterministicMemory Stable In flux (unless private, read-only, or
protected by lock)Locks Unnecessary EssentialInvariants Must hold only on
method entry/exit, or calls to external code
Must hold anytime the protecting lock is not held
Deadlock Impossible Possible anytime there are multiple unordered locks
Testing Code coverage finds most bugs, stress testing proves quality
Code coverage insufficient, races cause hard bugs, and stress testing gives only probabilistic comfort
Debugging Trace execution leading to failure; finding a fix is generally assured
Postulate a race and inspect code; root causes easily remain unidentified (hard to reproduce, hard to go back in time)
Concurrency is Hard
Applications
Ultrasound imaging equipment Media encode/decodeImage processing/ enhancementData visualization
Applications
Automotive control system Internet – based photo services
Applications
Robotics-based manufacturing assembly lineSilverlight Olympics viewer
Distributed Cloud ComputingLocal Computing
Task Co
ncu
rrency
Data P
arallelismApplications
Enterprise search, OLTP, collabAnimation / CGI renderingWeather forecastingSeismic monitoringOil exploration
IFx / CCR
Maestro
TPL / PPL
D-TPL
D-PLINQ
MPI / MPI.Net
WCF
Cluster SOA
WF
PLINQ
TPL / PPL
CDS
OpenMP
Agents
Parallel Technologies from Microsoft
Parallelism and the Software Stack
Constructing Parallel Applications
Efficiently ExecutingParallel Applications
Applications
Libraries
Languages, Compilersand Tools
Concurrency Runtime
OS/Hypervisor
Hardware
CoordinatingSystem Resources and Services OS/Hypervisor
Windows 7 Proccessing Unit Scaling
128 Logical Processor SystemGroup
(up to 64 logical processors)
NUMA Node
Socket
Core
Logical Processor
Windows 7 Processing Unit Scaling
• Segmented specification – “groups” of CPUs– CPUs identified in software by Group#: CPU# – Allows backward compatibility with 64-bit affinity– New applications have full CPU range using new APIs– Permits better locality during scheduling than a
“flat” specification
Enabling Concurrency Runtimes
• Reducing kernel intervention in thread scheduling with User Mode Scheduling (UMS)
Core 2
Thread3
Non-running threads
Core 1
Thread4
Thread5
Thread1
Thread2
Thread6
Core 2Core 1
UserThrea
d2
KernelThrea
d2
UserThrea
d1
KernelThrea
d1
UserThrea
d3
KernelThrea
d3
UserThrea
d4
KernelThrea
d4
UserThrea
d5
KernelThrea
d5
UserThrea
d6
KernelThrea
d6
Storage
Storage Technologies
Growing gap between HDD and DRAM
FLASH is here today – “solid state storage”
No mechanics like HDD
Persistent unlike DRAM
Flash performance is complementary to HDD and DRAM
PCM is potentially a new layer
30x faster than today’s FLASH
No write limit
Being developed – future is not yet clear
100 1000 10000 1000000
102030405060708090
100
IOPS$/GB
PCM
?
DRAM
Flash
HDD
70s EEPROM($10K/GB)
1997 Digital photo – killer application
($1K/GB)
2005 Mobile applications($20/GB)
1987 FLASH invented($5K/GB)
2003 Digital music
($100/GB)
2006 Computing UFDs
($5/GB)
Windows 7 Enables Improved Endurance for SSD Technology
• SSD can identify itself differently from HDD in ATA
• Reporting non-rotating media will allow Windows 7to set Defrag off as default; improving device endurance by reducing writes
Best Of Both WorldsSmall cache with different characteristics than Primary Store
• Flash has faster random performance than HDD
Caching benefit determined by
• Type & speed of cache• Cache management method
Performance & Power defined by Size & RPM
• Incremental improvements gen-to-gen
• Fast sequential performance
• Random performance limited by mechanical latency
Delivers Affordable Capacity
Reliability gains come with integrating the flash-cache into the drive
Primary Store (disc)
Buffer (DRAM)
Cache (Flash)
I/F (SATA)
User Interaction - Touch
Multi-Touch Capable PCs Are Available Today
HP TouchSmartAll-in-one PC with 2-touch digitizer
from NextWindow
Dell Latitude XTLaptop with Multi-touch and
pen digitizer from N-Trig
Key Scenarios:• Navigating and consuming
the web• Reading & sorting email• Viewing photos• Playing casual games• Consuming music and video• Navigating files & arranging
windows• Using Office applications• All focused on consumption
Touch Scenarios And Windows 7
Areas of investment:• Developer Platform: At the root is the
touch developer platform that exposes touch APIs for any application
• UI Enhancements: Focusing on the core scenarios, many parts of the core UI have been optimized for touch experiences.
• Gestures: Multi-touch gestures have been added to enable consistent panning and zooming in most applications.
• Applications: A set of multi-touch focused applications that demonstrate the power of touch. These will ship separate from Win7.
Surface Hardware
Windows 7
Surface Hardware
Windows VistaWindows 7
NativeWin32
Application
WPF 3.5
Surface SDK1.0
Managed Wrapper and Interop
Managed Wrapper and Interop
WinForms Application
Windows 7 ReleaseNET 4.0 / Surface 2.0 Release
WPF 3.5 SP1
WPF 4.0
Surface SDK 2.0
WPF Application
Surface Application
Multi-Touch Controls
Multi-Touch API
Surface Multi-Touch
Controls & API
Multi-Touch API
Multi-Touch API and Controls
Touch Development Roadmap
Touch Platform Overview
Good Better BestAPIs For Free!
•Panning/zoom gestures
•Right click gesture
•Gesture notifications•Pan/zoom/rotate/etc
•Raw touch data•Manipulation and
Inertia processors
Native Win32
• Controls with standard scrollbars
• WM_GESTURE message • WM_TOUCH• COM based
Manipulation and Inertia Processors
WPF • WPF 4.0 pan support in ScrollViewer
• Gesture events• Inertia configuration
• Touch events• Manipulation and Inertia
Processors
WinForms • Controls with standard scrollbars
• WM_GESTURE message• P/Invoke
• Manipulation and Inertia Processors in Microsoft.Ink.DLL
• Real-time Stylus or Ink Collector
User Interaction - Readability
Unexploited High Resolution Displays
Monitor Max Resolution
% Set to Maximum
1280X1024 56%1400X1050 79%1600X1200 32%1680X1050 66%1920X1050 39%1920X1200 78%Avg. set to default 55%
User's Chosen
Resolution
% using that resolution
640X480 1%800X600 7%1024X768 57%1280X1024 3%1600X1200 32%
Total 100.00%
Details Users with Max Resolution of 1600X1200
Almost half of all of users are not
configuring their display to maximum
resolution (!)
Users are lowering their screen resolution to get larger text…
High DPI Issues
Clipped Text
Layout Issues & Image Size Issues
Pixilated Bitmaps
WinForms Issues
Blurry UI Mismatched Font Sizes
Configure DPI via Display CPL
Windows 7 uses Scaling percentage instead of a raw DPI value
This is because most users don’t understand DPI
100% = 96 DPI, 125% = 120 DPI, 150% = 144 DPI
DPI Settings Change System Metrics
System Metric 96 DPI 120 DPI 144 DPI
GetDeviceCaps(hDC, LOGPIXELSX) 96 120 144
DEFAULT_GUI_FONT height 13 16 20
SM_CXHTHUMB (scroll bar control) 17 21 26
SM_XICON (icon width) 32 40 48
Font and Text
When the DPI increases the UI uses more pixels to draw icons, UI controls (e.g. scrollbars), and Text.
System Text Size Increases with DPI
96 DPI(11 pixels)
120 DPI(13 pixels)
144 DPI(16 pixels)
This is the letter “N” blown at 1300% using a magnifier.
Notice the number of pixels used increases with DPI.
Also notice the sub-pixel coloration from ClearType, which is why native resolution is important.
Desktop Composition Primer (DWM)
Off-screen Memory Surface
DWM Composes the
Desktop
With DWM, all apps render off-screen and are composed by DWM at the screen refresh rate.
These off-screen surfaces are also used for Thumbnails and for Flip 3D
DPI Virtualization (Automatic Scaling)
DWM Scales A at composition
time
System metrics for A are in a 96-DPI virtualized space.
A is given a 96-DPI surface to render into (smaller).
B is DPI-Aware
A is not DPI Aware, and renders in a 96-DPI virtualized context
DPI Virtualization CompatibilityCan be disabled per-application by right-clicking the app and selecting Properties -> compatibility.
Note that DPI virtualization is only on by default if the DPI is set to 144 or greater.
This can also be disabled globally via the “custom DPI” dialog (below).
DirectWrite
• Modern Typography• Works with any rendering technology• Hardware accelerated text with Direct2D
– ClearType filter and blend performed in hardware– Enables app-level hardware
caching optimizations– Reduced CPU usage in Windows OS components when
drawing glyphs
DirectWrite Script Supportب3ي1ة ال8ع5ر5
Հայերէն
বাং��লা�
ㄓㄨ ㄧㄣ ㄈㄨ ㄏㄠ
ᐃᓄᒃᑎᑐᑦ
ᏣᎳᎩ
简体汉字繁体漢字Кириллица
𐐔𐐯𐑅𐐨𐑉𐐯𐐻
द�वना�गरी�ግዕዝ
მხედრული
Ελληνικό
ગ�જરા�તી�ਗ�ਰਮ�ਖੀ�
עhבjרhית
ひらがな、カタカナ、漢字
ಕನನ�ಡអកខ�រករកខមខេ�មរភាសា
한글ພາສາລາວ
Latin
മലയാ�ളം�
ᠮᠣᠩᠭᠣᠯ ᠪᠢᠴᠢᠻ ᦟᦹᧅ ᦎᦷ ᦑᦺ
ߒߞߏ
𐒋𐒘𐒈𐒑𐒛𐒒𐒕𐒀
ଓଡ�ଆ
ꡍꡂꡛꡌ
ශදධ සං�හල
ܠܫܢܐ ܣܘܪܝܝܐᥖᥭᥰᥖᥬᥳᥑᥨᥒᥰ
தமி�ழతలు�గు�ނ� ތ�ⵜⵉⴼⵉⵏⴰⵖอ�กษรไทยདབ་ཅན་ꕙꔤ
ꆈꌠꁱꂷ
DirectWrite – Precise Glyph Shapes
Power
Deep Focus on Idle
0 10 20 30 40 50 60 70 80 90 100 -
5.00
10.00
15.00
20.00
25.00
30.00
35.00
40.00
System Power vs. CPU Utilization(Idle)
CPU Utilization (%)
Tota
l Sys
tem
Pow
er (W
atts)
+10% CPU increases power by ~1.25W
1.25W increase results in 8.3% reduction in battery
life
Clean Install IT Image0%
1%
2%
3%
4%
5%
6%
7%
8%
CPU Utilization on Idle System
CPU
Util
izatio
n (%
)
Frequent Idle Activity
• Specific Windows 7 improvements– Eliminate TCP DPC timer on every
system timer interrupt– Reduce frequency of USB driver
maintenance timers– Intelligent Timer Tick Distribution (ITTD)– Timer Coalescing
• Eliminate idle activity in drivers and applications– Target average idle period greater than 100ms
Background Process Management
• Background activity on the macro scale (minutes, hours) also important for power– E.g., disk defragmentation, AV scans– Prevents low-power idle and sleep modes
• Unified Background Process Manager (UBPM)– New Windows 7 infrastructure– Drives scheduling of services and scheduled tasks– Transparent to users, IT pros, and existing APIs– Enables trigger-starting services– Delivers usage data and metrics to Microsoft via CEIP
Trigger-Start Services
• Many services configured to Autostart and wait for rare events
• UBPM enables Trigger-Start services based on environmental changes– Device arrival/removal, IP address change, domain join, etc.– Examples
• Bluetooth service is started only if a Bluetooth radio is currently attached• BitLocker encryption service started only when new volumes detected
• Call to Action– Leverage trigger-start capability for value-add services– Validate performance impact with XPerf tools
Security
Why Data Protection Matters
“Some of the largest and medium-sized U.S. airports report close to 637,000 laptops lost each year, according to the Ponemon Institute survey released Monday.”
—PC World June 2008
“More than 100 USB memory sticks, some containing secret information, have been lost or stolen from the Ministry of Defense since 2004, it has emerged.”
—BBC News July 2008
BitLocker ArchitectureStatic root of trust measurement of early boot components
Volume Blob of Target OS unlocked
All Boot Blobs unlocked
Static OS
BootSector
BootManager
Start OS
OS Loader
BootBlock
PreOS
BIOS
MBR
TPM Init
Disk Layout and Key Storage
Operating System Volume Contains• Encrypted OS• Encrypted page file• Encrypted temp files• Encrypted data• Encrypted hibernation file
SystemSystem Volume Contains
MBR
Boot Manager
Boot Utilities
FVEK
3
4
Operating System Volume
SRK1
VMK2
Where’s the Encryption Key?1. SRK (Storage Root Key) contained in TPM
2. SRK encrypts the VMK (Volume Master Key)
3. VMK encrypts FVEK (Full Volume Encryption Key) – used for the actual data encryption
4. FVEK and VMK are stored encrypted on the Operating System Volume
BitLocker in Windows 7
Drive Type
Unlock Methods
Recovery Methods Management Other requirements
Operating System Drives
TPM
TPM+PIN
TPM+Startup key
TPM+PIN+Startup Key
Startup key
Recovery password
Recovery key
Active Directory backup of recovery password
Domain Recovery Agent
Robust and consistent group policy enforcement
Minimum pin length
Drive preparation fully integrated in BitLocker setup
System partition size:200MB without WinRE400MB with WinRE
System partition letterless
NTFS file system
Data DrivesIncludes fixed and removable
Passphrase
Smart Card
Automatic unlocking
Same as OS drive Robust and consistent group policy controls
Ability to mandate encryption prior to granting write access
File systems:NTFSFATFAT32ExFAT
The UAC Prompt
Things an AdministratorCan do
Things a standardUser can doThings a real user
Needs to do
These are UAC elevationsThey allow the user
to do privilegedoperations when
needed
While highlightingthat these are privileged
operations that you don’t wantto happen without your consent
What Are These Elevations?
• Some are necessary– Install or uninstall software– Change firewall settings– Change system time– Don’t want malware doing this …
• Some are not so necessary– Applications making
unnecessary use of registry keys– Change time zone (a Vista enhancement)– Viewing (not changing) system settings
Management
Federated Search
• Enterprise information is growing at 40% annually
• Data is moving off desktops and into central document management systems– Collaboration– Information sharing
• Client search of remote Enterprise data repositories is a compelling need
Federated Search
• Rich client experience– Previews, metadata, drag-and-drop– Familiar Windows Explorer paradigms
• Simple and lightweight integration– No client code– Any server platform
• Standards-based– OpenSearch 1.1– RSS and ATOM
• Authentication– Windows Integrated
1. Search Connector (.osdx) Installed
2. Windows sends search terms as HTTP request
3. RSS results returned from server
Manageability
Automation
• Windows PowerShell 2.0
• Integrated Scripting Environment
• Group Policy Scripting
Troubleshooting
• Windows Troubleshooting Platform
• Remoteable Reliability Data
• Problem Steps Recorder
Administrative Control
• Enhanced Group Policy Scenarios
• Group Policy Preferences
• Boot from VHD
In Summary
• Parallelism• Storage• User Interaction• Power• Security• Management
Questions?
Thanks!