VirtualBox

Ignore:
Timestamp:
May 17, 2019 11:46:23 AM (6 years ago)
Author:
vboxsync
Message:

winnt/vboxsf: Investigated all the file info queries after opening a file and used TTL on the stat info to try avoid those. The TTL code needed some fixing. bugref:9172

Location:
trunk/src/VBox/Additions/WINNT/SharedFolders/driver
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/info.cpp

    r78553 r78563  
    12691269                           uint8_t fTimestampsToCopyAnyway, PFILE_OBJECT pFileObj, PMRX_FCB pFcb)
    12701270{
     1271    LogFlow(("vbsfNtCopyInfo: hFile=%#RX64 pVBoxFobX=%p\n", pVBoxFobX->hFile, pVBoxFobX));
     1272    uint64_t const nsNow = RTTimeSystemNanoTS();
     1273
    12711274    /*
    12721275     * Check if the size changed because RDBSS and the cache manager have
     
    13081311    }
    13091312    pVBoxFobX->Info = *pObjInfo;
     1313    pVBoxFobX->nsUpToDate = nsNow;
    13101314}
    13111315
     
    14431447         * give is "fixes".
    14441448         *
     1449         * The TTL here works around two issues in particular:
     1450         *
     1451         *  1. We don't want to go to the host three times during a
     1452         *     FileAllInformation query (RDBSS splits it up).
     1453         *
     1454         *  2. There are several filter drivers which will query info at the end of the
     1455         *     IRP_MJ_CREATE processing.  On a W10 guest here, FileFinder.sys (belived to
     1456         *     be related to the prefetcher) first queries FileStandardInformation, then
     1457         *     WdFilter.sys (Windows Defender) will query FileBasicInformation,
     1458         *     FileStandardInformation and (not relevant here) FileInternalInformation.
     1459         *     It would be complete waste of time to requery the data from the host for
     1460         *     each of the three queries.
     1461         *
     1462         * The current hardcoded 100us value was choosen by experimentation with FsPerf
     1463         * on a decent intel system (6700K).  This is however subject to the timer tick
     1464         * granularity on systems without KeQueryInterruptTimePrecise (i.e. pre win8).
     1465         *
    14451466         * Note! We verify the buffer size after talking to the host, assuming that there
    14461467         *       won't be a problem and saving an extra switch statement.  IIRC the
    1447          *       NtQueryInformationFile code verfies the sizes too.
     1468         *       NtQueryInformationFile code verifies the sizes too.
    14481469         */
    14491470        /** @todo r=bird: install a hack so we get FileAllInformation directly up here
     
    14621483            if (   !(pVBoxFobx->Info.Attr.fMode & RTFS_DOS_DIRECTORY) /** @todo figure out why we don't return up-to-date info for directories! */
    14631484                && (   !pVBoxFobx->nsUpToDate
    1464                     || pVBoxFobx->nsUpToDate - RTTimeSystemNanoTS() < RT_NS_100US /** @todo implement proper TTL */ ) )
     1485                    || RTTimeSystemNanoTS() - pVBoxFobx->nsUpToDate > RT_NS_100US /** @todo implement proper TTL */ ) )
    14651486            {
    14661487                PVBSFNTFCBEXT pVBoxFcbx = VBoxMRxGetFcbExtension(capFcb);
  • trunk/src/VBox/Additions/WINNT/SharedFolders/driver/path.cpp

    r78553 r78563  
    222222    Log(("VBOXSF: vbsfNtCreateWorker: Calling VbglR0SfHostReqCreate(fCreate=%#RX32)...\n", pReq->CreateParms.CreateFlags));
    223223    int vrc = VbglR0SfHostReqCreate(pNetRootExtension->map.root, pReq);
    224     Log(("VBOXSF: vbsfNtCreateWorker: VbglR0SfHostReqCreate returns vrc = %Rrc, Result = 0x%x\n", vrc, pReq->CreateParms.Result));
     224    Log(("VBOXSF: vbsfNtCreateWorker: VbglR0SfHostReqCreate returns vrc = %Rrc, Result = 0x%x, Handle = %#RX64\n",
     225         vrc, pReq->CreateParms.Result, pReq->CreateParms.Handle));
    225226
    226227    if (RT_SUCCESS(vrc))
     
    502503             * Initialize our file object extension data.
    503504             */
    504             pVBoxFobx->Info     = pReq->CreateParms.Info;
    505             pVBoxFobx->hFile    = pReq->CreateParms.Handle;
    506             pVBoxFobx->pSrvCall = RxContext->Create.pSrvCall;
     505            pVBoxFobx->Info         = pReq->CreateParms.Info;
     506            pVBoxFobx->nsUpToDate   = RTTimeSystemNanoTS();
     507            pVBoxFobx->hFile        = pReq->CreateParms.Handle;
     508            pVBoxFobx->pSrvCall     = RxContext->Create.pSrvCall;
    507509
    508510            /* bird: Dunno what this really's about. */
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette