Skip to content

#5356 Fix fast texture cache's mutex stall #2#5412

Merged
akleshchev merged 1 commit intodevelopfrom
andreyk/viewer_5356_1
Feb 15, 2026
Merged

#5356 Fix fast texture cache's mutex stall #2#5412
akleshchev merged 1 commit intodevelopfrom
andreyk/viewer_5356_1

Conversation

@akleshchev
Copy link
Contributor

First attempt didn't work well enough, prelocking mutex to make sure main thread gets priority and does not wait on the same mutex multiple times per frame.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR aims to reduce main-thread stalls in the fast texture cache path by prelocking cache-related mutexes so the main thread doesn’t repeatedly contend on the same locks multiple times per frame.

Changes:

  • Prelock texture cache fast-cache and header ID map mutexes while draining mFastCacheList on the main thread.
  • Expose LLTextureCache mutex accessors to support external prelocking.
  • Add additional profiling zones in LLMeshRepoThread::notifyLoadedMeshes() and clarify comments around fast-cache image construction.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated 2 comments.

File Description
indra/newview/llviewertexturelist.cpp Prelocks texture cache mutexes while processing mFastCacheList to reduce per-frame lock contention.
indra/newview/lltexturecache.h Adds public accessors for internal mutexes and documents a lock-ordering constraint.
indra/newview/lltexturecache.cpp Comment-only clarifications around fast-cache open lifetime and LLImageRaw ownership.
indra/newview/llmeshrepository.cpp Adds named profiling zones around mesh notification processing blocks.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@akleshchev akleshchev force-pushed the andreyk/viewer_5356_1 branch from e94a18b to a7e42a9 Compare February 11, 2026 23:43
@akleshchev akleshchev force-pushed the andreyk/viewer_5356_1 branch from a7e42a9 to 7955b5f Compare February 12, 2026 01:46
@akleshchev akleshchev merged commit b9fd205 into develop Feb 15, 2026
22 of 23 checks passed
@akleshchev akleshchev deleted the andreyk/viewer_5356_1 branch February 15, 2026 14:11
@github-actions github-actions bot locked and limited conversation to collaborators Feb 15, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants