POV-Ray : Newsgroups : povray.off-topic : pagefile.sys : Re: pagefile.sys Server Time
5 Sep 2024 09:20:09 EDT (-0400)
  Re: pagefile.sys  
From: Darren New
Date: 29 Sep 2009 12:33:57
Message: <4ac236f5$1@news.povray.org>
clipka wrote:
> (1) The UI to pick which drive to defragment, to visualize 
> defragmentation status, and to show a report afterwards

OK. I found this too trivial to talk about, given how simple the UI was.

> (2) The decision-making where to actually put exactly which file (the 
> "business logic" so to speak)

Yeah. Really, it isn't that hard. If you're to the point where you have 
movable files that you don't just move, your disk is too full anyway. The 
only hard part is guessing the future of the files and how they'll be used 
after you defrag them, and tracking all *that* is the responsibility of 
other components of the OS.

> (3) The low-level code to swap one particular block with another in a 
> safe way


> I'm not too familiar with NTFS, but I expect (3) to be not too 
> complicated, 

Until you take into account that other processes are reading and writing the 
blocks at the same time, and you have to recover from a crash at any time 
without actually running a chkdsk, and that some blocks are buffered in 
memory, and some blocks are buffered on the readyboost memory, and that you 
have volume shadow copies, and that you have compressed files, and that 
defragging a file can actually change its size... But sure, if you ignore 
all the hard parts, it's pretty easy.

Go read the papers Executive Software wrote about it. It is *far* from 
trivial, and its even more complicated in Vista.

> while (2) is the one that actually determines the quality of the 
> defragmentation result: For instance, whether files in the same 
> directory are kept close together, or whether they are grouped according 
> to other criteria; how much free space is inserted after each file; and 
> plenty more stuff like that.

Sure. Plus, of course, MS added all the stuff that keeps track of how often 
you use the file, what order the blocks are used in, and so on. None of that 
is part of the defrag system at all.

For example, Vista tracks what blocks of which files are demand-paged in as 
you boot and log in. (That's the "readyboot" subsystem.)  Their defragger 
then doesn't defrag the file in block order, but rather into the order you 
tend to demand-page it in, if I understand correctly.

You can make it arbitrarily complicated. Most UIs don't. DiskKeeper only 
defragged stuff that it guessed would be faster to defrag than to just read 
fragmented.

-- 
   Darren New, San Diego CA, USA (PST)
   I ordered stamps from Zazzle that read "Place Stamp Here".


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.