Читаем Windows® Internals, Sixth Edition, Part 2 полностью

During an I/O operation on a file, the file’s VACB reference count is incremented, and then it’s decremented when the I/O operation is over. When the reference count is nonzero the VACB is active. For access to file system metadata, the active count represents how many file system drivers have the pages in that view locked into memory.

EXPERIMENT: Looking at VACBs and VACB Statistics

The cache manager internally keeps track of various values that are useful to developers and support engineers when debugging crash dumps. All these debugging variables start with the CcDbg prefix, which makes it easy to see the whole list, thanks to the x command:lkd> x nt!*ccdbg* 8194ba84 nt!CcDbgNumberOfCcUnmapInactiveViews = 8197c740 nt!CcDbgNumberOfFailedMappingsDueToVacbSpace = 8197c730 nt!CcDbgNumberOfFailedBitmapAllocations = 8197c73c nt!CcDbgNumberOfFailedHighPriorityMappingsDueToMmResources = ...

Some systems may show differences in variable names due to 32-bit versus 64-bit implementations. The exact variable names are irrelevant in this experiment—focus instead on the methodology that is explained. Using these variables and your knowledge of the VACB array header data structures, you can use the kernel debugger to list all the VACB array headers. The CcVacbArrays variable is an array of pointers to VACB array headers, which you dereference in order to dump the contents of the _VACB_ARRAY_HEADERs. First, obtain the highest array index:lkd> dd nt!CcVacbArraysHighestUsedIndex l 1 8194ba7c 00000000

And now you can dereference each index until the maximum index. On this system (and this is the norm), the highest index is 0, which means there’s only one header to dereference:lkd> ?? (*((nt!_VACB_ARRAY_HEADER***)@@(nt!CcVacbArrays)))[0] struct _VACB_ARRAY_HEADER * 0x8315b000 +0x000 VacbArrayIndex : 0 +0x004 MappingCount : 0x5ab +0x008 HighestMappedIndex : 0x9a9 +0x00c Reserved : 0

If there were more, you could change the array index at the end of the command with a higher number, until you reached the highest used index. The output shows that the system has only one VACB array with 1,451 (0x5ab) active VACBs.

Finally, the CcNumberOfFreeVacbs variable stores the number of VACBs on the free VACB list. Dumping this variable on the system used for the experiment results in 2,645 (0xa55):lkd> dd nt!CcNumberOfFreeVacbs l 1 8197c768 00000a55

As expected, the sum of the free (0x5ab—1,451 decimal) and active VACBs (0xa55—2,645 decimal) on a 32-bit system with one VACB array equals 4,096, the number of VACBs in one VACB array. If the system were to run out of free VACBs, the cache manager would try to allocate a new VACB array. Because of the volatile nature of this experiment, your system may create and/or free additional VACBs between the two steps (dumping the active and then the free VACBs). This might cause your total of free and active VACBs to not match exactly 4,096. Try quickly repeating the experiment a couple of times if this happens, although you may never get stale numbers, especially if there is lots of file system activity on the system.


Per-File Cache Data Structures

Each open handle to a file has a corresponding file object. (File objects are explained in detail in Chapter 8.) If the file is cached, the file object points to a private cache map structure that contains the location of the last two reads so that the cache manager can perform intelligent read-ahead (described later, in the section Intelligent Read-Ahead). In addition, all the private cache maps for open instances of a file are linked together.

Each cached file (as opposed to file object) has a shared cache map structure that describes the state of the cached file, including its size and its valid data length. (The function of the valid data length field is explained in the section Write-Back Caching and Lazy Writing.) The shared cache map also points to the section object (maintained by the memory manager and which describes the file’s mapping into virtual memory), the list of private cache maps associated with that file, and any VACBs that describe currently mapped views of the file in the system cache. (See Chapter 10 for more about section object pointers.) The relationships among these per-file cache data structures are illustrated in Figure 11-7.

When asked to read from a particular file, the cache manager must determine the answers to two questions:

Is the file in the cache?

If so, which VACB, if any, refers to the requested location?

Перейти на страницу:

Похожие книги

Веб-аналитика: анализ информации о посетителях веб-сайтов
Веб-аналитика: анализ информации о посетителях веб-сайтов

Компании в веб-пространстве тратят колоссальные средства на веб-аналитику и оптимизацию своих веб-сайтов, которые, в свою очередь, приносят миллиарды долларов дохода. Если вы аналитик или работаете с веб-данными, то эта книга ознакомит вас с новейшими точками зрения на веб-аналитику и то, как с ее помощью сделать вашу компанию весьма успешной в веб. Вы изучите инструментальные средства и показатели, которые можно использовать, но что важнее всего, эта книга ознакомит вас с новыми многочисленными точками зрения на веб-аналитику. Книга содержит много советов, приемов, идей и рекомендаций, которые вы можете взять на вооружение. Изучение веб-аналитики по этой уникальной книге позволит познакомиться с проблемами и возможностями ее современной концепции. Написанная практиком, книга охватывает определения и теории, проливающие свет на сложившееся мнение об этой области, а также предоставляет поэтапное руководство по реализации успешной стратегии веб-аналитики.Эксперт в данной области Авинаш Кошик в присущем ему блестящем стиле разоблачает укоренившиеся мифы и ведет по пути к получению действенного понимания аналитики. Узнайте, как отойти от анализа посещаемости сайта, почему основное внимание следует уделять качественным данным, каковы методы обретения лучшего понимания, которое поможет выработать мировоззрение, ориентированное на мнение клиента, без необходимости жертвовать интересами компании.- Изучите все преимущества и недостатки методов сбора данных.- Выясните, как перестать подсчитывать количество просмотренных страниц, получить лучшее представление о своих клиентах.- Научитесь определять ценность показателей при помощи тройной проверки "Ну и что".- Оптимизируйте организационную структуру и выберите правильный инструмент аналитики.- Изучите и примените передовые аналитические концепции, включая анализ SEM/PPC, сегментацию, показатели переходов и др.- Используйте решения с быстрым началом для блогов и электронной торговли, а также веб-сайтов мелкого бизнеса.- Изучите ключевые компоненты платформы экспериментирования и проверки.- Используйте анализ конкурентной разведки для обретения понимания и принятия мер.Здесь также находятся:- Десять шагов по улучшению веб-аналитики.- Семь шагов по созданию управляемой данными культуры в организации.- Шесть способов замера успеха блога.- Три секрета создания эффективной веб-аналитики.- Десять признаков великого веб-аналитика.

Авинаш Кошик

ОС и Сети, интернет
Linux
Linux

Книга посвящена операционной системе Linux. Приводятся подробные сведения о ее особенностях и возможностях, идеологии файловой системы, инсталляции и основных командах, вопросах компиляции ядра, настройках и сервисах. Большое внимание уделяется организации на базе Linux различных серверов и служб: электронной почты, WWW, FTP, INN, Proxy, NTP, а также проблемам администрирования сети, обеспечения безопасной работы и другим вопросам. Описаны способы настройки под Linux рабочих станций, в т. ч. и бездисковых, установки и эксплуатации на них графических сред типа X Window, а также конфигурирование модемных соединений, принтеров и сканеров, отладка взаимодействия с Linux-машинами такой «экзотической» периферии, как карманные компьютеры, мобильные телефоны, TV-тюнеры и т. п. Рассматриваемые в книге конфигурационные файлы и структура каталогов соответствуют дистрибутиву Red Hat Linux 7.x, тем не менее, при минимальной адаптации все упоминаемые в книге пакеты устанавливаются в любом дистрибутиве Linux.Для начинающих администраторов или пользователей Linux.

Алексей Александрович Стахнов

ОС и Сети, интернет