[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [win-pv-devel] [PATCH 23/26] Track Queued/Submitted/Completed counts
From: Owen Smith <owen.smith@xxxxxxxxxx> --- src/xenvbd/adapter.c | 31 ++++++++++++++++++++++++++++++- src/xenvbd/blockring.c | 33 ++++++++++++++++++++++++++++++++- 2 files changed, 62 insertions(+), 2 deletions(-) diff --git a/src/xenvbd/adapter.c b/src/xenvbd/adapter.c index 945888d..b0a94e2 100644 --- a/src/xenvbd/adapter.c +++ b/src/xenvbd/adapter.c @@ -1853,7 +1853,36 @@ AdapterHwInitialize( IN PVOID DevExt ) { - UNREFERENCED_PARAMETER(DevExt); + ULONG status; + PERF_CONFIGURATION_DATA Perf; + + RtlZeroMemory(&Perf, sizeof(PERF_CONFIGURATION_DATA)); + Perf.Version = STOR_PERF_VERSION; + Perf.Size = sizeof(PERF_CONFIGURATION_DATA); + + status = StorPortInitializePerfOpts(DevExt, + TRUE, + &Perf); + if (status != STOR_STATUS_SUCCESS) + return TRUE; + + Verbose("Perf: %s%s%s%s%s%s\n", + Perf.Flags & STOR_PERF_DPC_REDIRECTION ? "DPC_REDIRECT " : "", + Perf.Flags & STOR_PERF_CONCURRENT_CHANNELS ? "CONCURRENT " : "", + Perf.Flags & STOR_PERF_INTERRUPT_MESSAGE_RANGES ? "MSG_RANGES " : "", + Perf.Flags & STOR_PERF_ADV_CONFIG_LOCALITY ? "LOCALITY " : "", + Perf.Flags & STOR_PERF_OPTIMIZE_FOR_COMPLETION_DURING_STARTIO ? "STARTIO " : "", + Perf.Flags & STOR_PERF_DPC_REDIRECTION_CURRENT_CPU ? "CURRENT_CPU " : ""); + Verbose("Perf: %u Channels\n", + Perf.ConcurrentChannels); + + if (Perf.Flags & STOR_PERF_CONCURRENT_CHANNELS) + Perf.ConcurrentChannels = KeQueryActiveProcessorCount(NULL); + + status = StorPortInitializePerfOpts(DevExt, + FALSE, + &Perf); + return TRUE; } diff --git a/src/xenvbd/blockring.c b/src/xenvbd/blockring.c index a41a912..96cc12e 100644 --- a/src/xenvbd/blockring.c +++ b/src/xenvbd/blockring.c @@ -79,6 +79,10 @@ struct _XENVBD_BLOCKRING { ULONG NrQueued; ULONG NrSubmitted; ULONG NrCompleted; + ULONG CurQueued; + ULONG CurSubmitted; + ULONG MaxQueued; + ULONG MaxSubmitted; ULONG NrInterrupts; ULONG NrDpcs; }; @@ -265,7 +269,11 @@ BlockRingPostRequest( req = RING_GET_REQUEST(&BlockRing->Front, BlockRing->Front.req_prod_pvt); ++BlockRing->Front.req_prod_pvt; + --BlockRing->CurQueued; ++BlockRing->NrSubmitted; + ++BlockRing->CurSubmitted; + if (BlockRing->CurSubmitted > BlockRing->MaxSubmitted) + BlockRing->MaxSubmitted = BlockRing->CurSubmitted; InsertTailList(&BlockRing->Submitted, &Request->ListEntry); BlockRingInsert(BlockRing, Request, req); @@ -355,6 +363,7 @@ BlockRingPoll( rsp->status); } ++BlockRing->NrCompleted; + --BlockRing->CurSubmitted; // zero entire ring slot (to detect further failures) RtlZeroMemory(rsp, sizeof(union blkif_sring_entry)); @@ -390,7 +399,7 @@ done: KeReleaseSpinLockFromDpcLevel(&BlockRing->Lock); } - + KSERVICE_ROUTINE BlockRingInterrupt; BOOLEAN @@ -493,6 +502,14 @@ BlockRingDebugCallback( BlockRing->NrSubmitted, BlockRing->NrCompleted); + XENBUS_DEBUG(Printf, + &BlockRing->DebugInterface, + "Queued: %u / %u, Submitted: %u / %u\n", + BlockRing->CurQueued, + BlockRing->MaxQueued, + BlockRing->CurSubmitted, + BlockRing->MaxSubmitted); + Port = XENBUS_EVTCHN(GetPort, &BlockRing->EvtchnInterface, BlockRing->Channel); @@ -847,9 +864,20 @@ BlockRingDisconnect( XENBUS_STORE(Release, &BlockRing->StoreInterface); RtlZeroMemory(&BlockRing->StoreInterface, sizeof(XENBUS_STORE_INTERFACE)); + Verbose("Queued: %u / %u, Submitted %u / %u, Completed: %u\n", + BlockRing->NrQueued, + BlockRing->MaxQueued, + BlockRing->NrSubmitted, + BlockRing->MaxSubmitted, + BlockRing->NrCompleted); + BlockRing->NrQueued = 0; BlockRing->NrSubmitted = 0; BlockRing->NrCompleted = 0; + BlockRing->CurQueued = 0; + BlockRing->CurSubmitted = 0; + BlockRing->MaxQueued = 0; + BlockRing->MaxSubmitted = 0; BlockRing->NrInterrupts = 0; BlockRing->NrDpcs = 0; @@ -873,7 +901,10 @@ BlockRingSubmit( break; InsertTailList(&BlockRing->Queued, ListEntry); ++BlockRing->NrQueued; + ++BlockRing->CurQueued; } + if (BlockRing->CurQueued > BlockRing->MaxQueued) + BlockRing->MaxQueued = BlockRing->CurQueued; KeReleaseSpinLock(&BlockRing->Lock, Irql); -- 2.8.3 _______________________________________________ win-pv-devel mailing list win-pv-devel@xxxxxxxxxxxxxxxxxxxx https://lists.xenproject.org/cgi-bin/mailman/listinfo/win-pv-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |