From 07ff10c7fc194ee503b52691da000ab2c69d0fb1 Mon Sep 17 00:00:00 2001 From: Jeffrey Altman Date: Sun, 29 Apr 2012 10:40:31 -0400 Subject: [PATCH] Windows: Cc FileObject Settings Modify the assigned CcSetReadAheadGranularity() from 64K to the afsd_service configured chunk size. Assign a CcSetDirtyPageThreshold() to be twice the configured chunk size. Change-Id: I1cfa67612058cf5e08906e369236d0d8a48c54f0 Reviewed-on: http://gerrit.openafs.org/7294 Tested-by: BuildBot Reviewed-by: Jeffrey Altman Tested-by: Jeffrey Altman --- src/WINNT/afsrdr/kernel/lib/AFSRead.cpp | 5 ++++- src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp | 4 +++- src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h | 8 ++------ 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp b/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp index 6810d4da96..660e90fccb 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSRead.cpp @@ -1198,7 +1198,10 @@ AFSCommonRead( IN PDEVICE_OBJECT DeviceObject, pFcb); CcSetReadAheadGranularity( pFileObject, - READ_AHEAD_GRANULARITY); + pDeviceExt->Specific.RDR.MaximumRPCLength); + + CcSetDirtyPageThreshold( pFileObject, + AFS_DIRTY_CHUNK_THRESHOLD * pDeviceExt->Specific.RDR.MaximumRPCLength); } __except( EXCEPTION_EXECUTE_HANDLER) { diff --git a/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp b/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp index a9b5225fd1..e4db03a869 100644 --- a/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp +++ b/src/WINNT/afsrdr/kernel/lib/AFSWrite.cpp @@ -359,8 +359,10 @@ AFSCommonWrite( IN PDEVICE_OBJECT DeviceObject, pFcb); CcSetReadAheadGranularity( pFileObject, - READ_AHEAD_GRANULARITY); + pDeviceExt->Specific.RDR.MaximumRPCLength); + CcSetDirtyPageThreshold( pFileObject, + AFS_DIRTY_CHUNK_THRESHOLD * pDeviceExt->Specific.RDR.MaximumRPCLength); } __except( EXCEPTION_EXECUTE_HANDLER) { diff --git a/src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h b/src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h index fc5dc2cbad..f600fdb082 100644 --- a/src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h +++ b/src/WINNT/afsrdr/kernel/lib/Include/AFSDefines.h @@ -206,12 +206,6 @@ NTSTATUS // #define AFS_SERVER_PURGE_SLEEP 6 -// -// Read ahead granularity -// - -#define READ_AHEAD_GRANULARITY 0x10000 // 64KB - #define AFS_DIR_ENUM_BUFFER_LEN (16 * 1024) // @@ -351,6 +345,8 @@ NTSTATUS #define AFS_MAXIMUM_EXTENT_RELEASE_COUNT 100 +#define AFS_DIRTY_CHUNK_THRESHOLD 2 + // {41966169-3FD7-4392-AFE4-E6A9D0A92C72} - generated using guidgen.exe DEFINE_GUID (GUID_SD_AFS_REDIRECTOR_CONTROL_OBJECT, 0x41966169, 0x3fd7, 0x4392, 0xaf, 0xe4, 0xe6, 0xa9, 0xd0, 0xa9, 0x2c, 0x72);