From: SMTP%"davidg@balder.com" 22-NOV-1997 09:54:51.01 To: "'Assaf Pazner'" , "'NTFSD Mailing List'" CC: Subj: RE: [ntfsd] Lazy Writer & RE: [ntfsd] How to force file system to flush cache ? Return-Path: owner-ntfsd@atria.com Received: by arisia.gce.com (UCX V4.1-12C, OpenVMS V7.1 VAX); Sat, 22 Nov 1997 09:54:12 -0500 Received: from gw.atria.com (gw.atria.com [192.88.237.2]) by mercury.mv.net (8.8.8/mem-971025) with SMTP id EAA07450 for ; Sat, 22 Nov 1997 04:54:11 -0500 (EST) Received: by gw.atria.com id Sat, 22 Nov 1997 02:42:59 -0500 Received: from ivy-balder.Goebel-Enterprises by gw.atria.com id Sat, 22 Nov 1997 02:42:54 -0500 Received: by ivy-balder.Goebel-Enterprises with SMTP (Microsoft Exchange Server Internet Mail Connector Version 4.0.993.5) id <01BCF6D7.379B56E0@ivy-balder.Goebel-Enterprises>; Fri, 21 Nov 1997 23:43:07 -0800 Message-ID: From: "David Goebel (Balder Technology Group, Inc.)" To: "'Assaf Pazner'" , "'NTFSD Mailing List'" Subject: RE: [ntfsd] Lazy Writer & RE: [ntfsd] How to force file system to flush cache ? Date: Fri, 21 Nov 1997 23:42:59 -0800 X-Mailer: Microsoft Exchange Server Internet Mail Connector Version 4.0.993.5 MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: owner-ntfsd@atria.com Precedence: bulk Both these message brought up an issue that I think deserves some clarification. In Windows NT (as opposed to other OSes), "flush" usually means to just write dirty data. "Purge" means to toss data from the cache. You can flush without purging and you can purge without flushing. The prior commits data to disk without removing it from the cache and the latter tosses data from the cache whether it was dirty or not. As you might imagine, the "flush then purge" combination is popular. This is, however, tricky stuff. Look at FatForceCacheMiss() fastfat\filobsup.c (in the MS IFS kit). Purging (and even flushing for that matter) may cause file objects to be dereferenced and this cause recursive closes. Look at the steps fastfat takes to detect this and carefully step around the mess. There are also resource acquisition rules that must be followed to interact successfully with both the cache manager and memory manager (not to mention yourself recursively!). Again, study carefully what fastfat does and you should be OK. As far as controlling what order the cache manager flushes data, you are not going to be able to do anything deterministic here. Of course the CM only flushes data that's dirty, and there are create options that give the CM clues (for both read ahead and write behind). These must be seen as ways to influence the cache manager though, not control it. David >-----Original Message----- >From: Assaf Pazner [SMTP:a-pazner@uchicago.edu] >Sent: Friday, November 21, 1997 12:54 PM >To: 'NTFSD Mailing List' >Subject: [ntfsd] Lazy Writer > >Hi, > >The Lazy Writer thread may send Paging IO write IRP's with file offsets that >are not sequential. For example, one IRP writing 0x10000-0x1FFFF and after >that another IRP writing 0x00000-0x0FFFF. > >Is there any way to force the Lazy Writer thread to flush lower offsets >first? >or >Is there any way to call CcFlushCache while processing Paging IO IRP's >without >causing the system to hang? >or >Is there any way to mark an offset range "Clean" so that it will not be >written >when calling CcFlushCache but will still remain cached? > >Thanks in advance. >Assaf Pazner. > - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - >[ To unsubscribe, send email to ntfsd-request@atria.com with body >UNSUBSCRIBE (the subject is ignored). ] - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - [ To unsubscribe, send email to ntfsd-request@atria.com with body UNSUBSCRIBE (the subject is ignored). ]