I/O Manager, 64-bit Porting, and New Driver Models

Slides:



Advertisements
Similar presentations
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Advertisements

© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Identity Management - Login © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Building Scalable Web Apps with Windows Azure Name Title Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
© 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Feature: Reprint Outstanding Transactions Report © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Purchase Requisitions - Requester © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
MIX 09 4/15/ :14 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Co- location Mass Market Managed Hosting ISV Hosting.
 Jason Roberts Program Manager Microsoft Corporation PC44.
Windows 7 Training Microsoft Confidential. Windows ® 7 Compatibility Version Checking.
Multitenant Model Request/Response General Model.
Feature: Purchase Order Prepayments II © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: OLE Notes Migration Utility
Feature: Web Client Keyboard Shortcuts © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: SmartList Usability Enhancements © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Session 1.
Built by Developers for Developers…. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
 Rico Mariani Architect Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Assign an Item to Multiple Sites © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
WinHEC /22/2017 © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Print Remaining Documents © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
Connect with life Connect with life
NEXT: Overview – Sharing skills & code.
demo Receive Inventory Export Parse and Normalize.
FonePlus Hugh Teegan Architect Mobile Devices Microsoft Corporation.
© 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or.
Feature: Document Attachment –Replace OLE Notes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
Feature: Customer Combiner and Modifier © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
Feature: Employee Self Service Timecard Entry © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
Ian Ellison-Taylor General Manager Microsoft Corporation PC27.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.
demo Instance AInstance B Read “7” Write “8”

customer.
demo © 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names.
demo Demo.
Feature: Void Historical/Open Transaction Updates © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
demo QueryForeign KeyInstance /sm:body()/x:Order/x:Delivery/y:TrackingId1Z
Feature: Suggested Item Enhancements – Analysis and Assignment © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and.
projekt202 © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are.
The CLR CoreCLRCoreCLR © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product.
© 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks.
© 2008 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or.

IoCompleteRequest (Irp);... p = NULL; …f(p);
MIX 09 4/17/2018 4:41 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Возможности Excel 2010, о которых следует знать
Title of Presentation 11/22/2018 3:34 PM
Baseline: How Are We Doing Now?
Office Mac /30/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Title of Presentation 12/2/2018 3:48 PM
1/3/2019 1:21 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
28 days.
8/04/2019 9:13 PM © 2006 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Виктор Хаджийски Катедра “Металургия на желязото и металолеене”
WINDOWS AZURE A LAP AROUND PLATFORM THE Steve Marx
PENSACOLA ENERGY WORK PLAN OCTOBER 10, 2016
Title of Presentation 5/12/ :53 PM
Шитманов Дархан Қаражанұлы Тарих пәнінің
Title of Presentation 5/24/2019 1:26 PM
5/24/2019 6:44 PM 1/8/18 Bell #10 In a world governed by the gods, is there any room for human will? Do human choices make a difference? EXPLAIN © 2007.
日本初公開!? Vista の新機能を実演 とっちゃん わんくま同盟 7/23/2019 9:09 AM
Title of Presentation 7/24/2019 8:53 PM
Presentation transcript:

I/O Manager, 64-bit Porting, and New Driver Models 9/14/2018 12:13 AM I/O Manager, 64-bit Porting, and New Driver Models Nar Ganapathy Architect Windows Device Platform Group Microsoft Corporation © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Topics Interactive discussion on related topics Windows Vista I/O subsystem changes New cancellation Support Scheduled file I/O support Prioritized I/O support Thread-neutral I/O support Miscellaneous Driver model changes in Windows Vista Interactive discussion on related topics Driver models and I/O Manager 64-bit porting

I/O Cancellation Overview WHDC PowerPoint Template Notes & Handouts Friday, September 14, 2018 I/O Cancellation Overview A mechanism to cancel already – issued I/O requests (IRP) IRP cancellation scenarios Thread / process termination Application wants to cancel an I/O request Asynchronous I/O (CanceIIo, CancelIoEx) Synchronous I/O (CancelSynchronousIo) Windows Vista added support for new I/O cancellation to address system hangs Blocked thread in the kernel

Cancellation Routine Example Application ReadFile() Application issues read Request on file handle Sync call: I/O Manager waits for driver to process request Async call: pending status is immediately returned to application System sends request to driver through I/O Manager I/O Manager Driver returns Pending status Driver Cancel routine Driver sets Cancel routine in IRP

Process Termination Example Application Process Terminated System cancels all I/O associated with the process I/O call(s) Process cleanup occurs only after all IRPs complete or cancel I/O Manager Cancel routine(s) invoked Driver(s) Cancel Routine(s)

Cancellation – Synchronous I/O Windows Vista Application Status -> app T2 passes T1’s handle Thread 1 (T1) waits for I/O to complete Another process thread (T2) requests cancellation CreateFile() CancelSynchronousIo() Returns immediately I/O Manager tries to cancel T1’s synchronous I/O I/O Manager Driver returns with STATUS_CANCELLED Cancel routine invoked Driver IRP completes Cancel routine

Cancellation – Asynchronous I/O Windows Vista Application Status -> app Passes file handle Some thread in process requests cancellation for all pending file I/O on specified handle ReadFileEx() CancelIoEx() Returns immediately I/O Manager tries to cancel all pending I/O on this handle I/O Manager Driver returns with STATUS_CANCELLED Cancel routine(s) invoked Driver IRP completes Cancel routine

Key Takeaways Kernel-mode waits that block user-mode threads are bad Cannot be interrupted Don’t wait inside driver (Return STATUS_PENDING) Always set a Cancel routine on IRPs that are held in a queue In Windows Vista, IRP_MJ_CREATE IRPs can be cancelled Use cancellable wait APIs FsRtlCancellableWaitForSingleObject FsRtlCancellableWaitForMultipleObjects

WHDC PowerPoint Template Notes & Handouts Friday, September 14, 2018 Scheduled File I/O Driven by glitch-free multi-media initiative Allows applications to reserve bandwidth and specify latency hints Win32 APIs SetFileBandwidthReservation GetFileBandwidthReservation I/O passes this information to the storage stack Storage stack queues implement the reservation algorithm Trickles down to transports like USB

WHDC PowerPoint Template Notes & Handouts Friday, September 14, 2018 Prioritized File I/O Improves system response Targeted at storage stack Allows device stacks to prioritize I/O based on hints from applications Win32 APIs allow applications to set priority hints on file handles SetFileInformationByHandle I/O priorities can also be set on threads Inherited by all I/O operations issued by the thread SetThreadPriority SetPriorityClass

Prioritized File I/O Priority Hints Clients of prioritized I/O Very Low // Search Indexing, AV scanning Low // Pre-fetching Normal High Critical // Used by Memory Manager only Clients of prioritized I/O Background threads like indexing Pre-fetchers

Thread-Neutral I/O Goal is to improve scalability Pre-Windows Vista: all user-mode I/Os associated with a thread Thread context used to rundown IRPs and cancel them Thread context also used to postprocess IRPs for updating buffers, I/O status blocks Post processing requires an APC If I/O uses completion ports, system requires two context switches (APC and completion thread)

Thread Neutral I/O Windows Vista Misc changes If handle associated with completion port. Or if handle has a locked IOSB range, then disassociate I/O from thread I/Os tracked per file object Post processing done on completion thread or in the DPC Avoids context switches and invocation of dispatcher lock Improvement expected on systems with > 4 processors Misc changes Kernel stack switch for storage stacks

Driver Models in Windows Vista Windows Driver Foundation Simplified driver model layered over WDM Two implementations KMDF UMDF WDDM (Windows Display Driver Model) NDIS 6.0 Windows Portable Devices (WPD) Built on UMDF

Call To Action Consider UMDF—User Mode Driver Framework—as your first driver model of choice Use static analysis tools on your drivers— Static Driver Verifier and PREfast for Drivers Please follow completion and cancelation guidelines for drivers Ensure that your device and driver work on ALL 64-bit versions of Windows Please answer DMA API survey at    http://connect.microsoft.com/Survey/Survey.asp x?SurveyID=3965&SiteID=221

Resources Windows Driver Foundation (WDF) I/O cancelation One stop shop for all WDF related information is http://www.microsoft.com/whdc/driver/wdf/default.mspx MS Press Book on WDF I/O cancelation http://www.microsoft.com/whdc/driver/tips/IRPcancel.mspx 64 bit porting guidelines http://www.microsoft.com/whdc/driver/64bitguide.mspx I/O Prioritization http://www.microsoft.com/whdc/driver/priorityio.mspx

© 2007 Microsoft Corporation. All rights reserved © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.