windows 7 v2 vineet

58
Back to the OS Vineet Gupta GM – Software Engineering, Directi http://vineetgupta.spaces .live.com/

Upload: technext1

Post on 14-Dec-2014

509 views

Category:

Technology


2 download

DESCRIPTION

 

TRANSCRIPT

Page 1: Windows 7 V2   Vineet

Back to the OS

Vineet GuptaGM – Software Engineering, Directi

http://vineetgupta.spaces.live.com/

Page 2: Windows 7 V2   Vineet

It’s Commodity – Why Bother!

Page 3: Windows 7 V2   Vineet

Meet the New PC

• Apple Mac Pro• 3.0 GHz Intel Xeon• 8 Cores

Page 4: Windows 7 V2   Vineet

Intel TeraScale – 80 Cores in 5 years

Source: http://techresearch.intel.com/articles/terascalepop.html

Page 5: Windows 7 V2   Vineet

Welcome to Many-Core

Page 6: Windows 7 V2   Vineet

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

Page 7: Windows 7 V2   Vineet

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

Page 8: Windows 7 V2   Vineet

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

Page 9: Windows 7 V2   Vineet

Storage Is Changing

Flash Is Disk…

Disk Is Tape…

Tape Is Dead…

Flash Is Cool…

Page 10: Windows 7 V2   Vineet

The OS is far from being commodity

Please do bother!

Page 11: Windows 7 V2   Vineet

Agenda

• Parallelism• Storage• User Interaction• Power• Security• Management

Page 12: Windows 7 V2   Vineet

Parallelism

Page 13: Windows 7 V2   Vineet

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

Page 14: Windows 7 V2   Vineet

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

Page 15: Windows 7 V2   Vineet

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

Page 16: Windows 7 V2   Vineet

Windows 7 Proccessing Unit Scaling

128 Logical Processor SystemGroup

(up to 64 logical processors)

NUMA Node

Socket

Core

Logical Processor

Page 17: Windows 7 V2   Vineet

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

Page 18: Windows 7 V2   Vineet

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

Page 19: Windows 7 V2   Vineet

Storage

Page 20: Windows 7 V2   Vineet

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)

Page 21: Windows 7 V2   Vineet

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

Page 22: Windows 7 V2   Vineet

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)

Page 23: Windows 7 V2   Vineet

User Interaction - Touch

Page 24: Windows 7 V2   Vineet

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

Page 25: Windows 7 V2   Vineet

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.

Page 26: Windows 7 V2   Vineet

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

Page 27: Windows 7 V2   Vineet

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

Page 28: Windows 7 V2   Vineet

User Interaction - Readability

Page 29: Windows 7 V2   Vineet

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…

Page 30: Windows 7 V2   Vineet

High DPI Issues

Clipped Text

Layout Issues & Image Size Issues

Pixilated Bitmaps

WinForms Issues

Blurry UI Mismatched Font Sizes

Page 31: Windows 7 V2   Vineet

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

Page 32: Windows 7 V2   Vineet

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.

Page 33: Windows 7 V2   Vineet

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.

Page 34: Windows 7 V2   Vineet

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

Page 35: Windows 7 V2   Vineet

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

Page 36: Windows 7 V2   Vineet

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).

Page 37: Windows 7 V2   Vineet

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

Page 38: Windows 7 V2   Vineet

DirectWrite Script Supportب3ي1ة ال8ع5ر5

 Հայերէն

 বাং��লা�

  ㄓㄨ  ㄧㄣ ㄈㄨ  ㄏㄠ 

ᐃᓄᒃᑎᑐᑦ

 ᏣᎳᎩ

简体汉字繁体漢字Кириллица

𐐔𐐯𐑅𐐨𐑉𐐯𐐻

द�वना�गरी�ግዕዝ

მხედრული

Ελληνικό

ગ�જરા�તી�ਗ�ਰਮ�ਖੀ�

עhבjרhית

ひらがな、カタカナ、漢字

ಕನನ�ಡអកខ�រករកខមខេ�មរភាសា

한글ພາສາລາວ

Latin

മലയാ�ളം�

ᠮᠣᠩᠭᠣᠯ ᠪᠢᠴᠢᠻ ᦟᦹᧅ ᦎᦷ ᦑᦺ

ߒߞߏ

𐒋𐒘𐒈𐒑𐒛𐒒𐒕𐒀

ଓଡ�ଆ

ꡍꡂꡛꡌ

ශදධ සං�හල

ܠܫܢܐ ܣܘܪܝܝܐᥖᥭᥰᥖᥬᥳᥑᥨᥒᥰ

தமி�ழతలు�గు�ނ� ތ�ⵜⵉⴼⵉⵏⴰⵖอ�กษรไทยདབ་ཅན་ꕙꔤ

ꆈꌠꁱꂷ

Page 39: Windows 7 V2   Vineet

DirectWrite – Precise Glyph Shapes

Page 40: Windows 7 V2   Vineet

Power

Page 41: Windows 7 V2   Vineet

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 (%

)

Page 42: Windows 7 V2   Vineet

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

Page 43: Windows 7 V2   Vineet

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

Page 44: Windows 7 V2   Vineet

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

Page 45: Windows 7 V2   Vineet

Security

Page 46: Windows 7 V2   Vineet

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

Page 47: Windows 7 V2   Vineet

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

Page 48: Windows 7 V2   Vineet

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

Page 49: Windows 7 V2   Vineet

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

Page 50: Windows 7 V2   Vineet

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

Page 51: Windows 7 V2   Vineet

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

Page 52: Windows 7 V2   Vineet

Management

Page 53: Windows 7 V2   Vineet

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

Page 54: Windows 7 V2   Vineet

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

Page 55: Windows 7 V2   Vineet

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

Page 56: Windows 7 V2   Vineet

In Summary

• Parallelism• Storage• User Interaction• Power• Security• Management

Page 57: Windows 7 V2   Vineet

Questions?

Page 58: Windows 7 V2   Vineet

Thanks!