Skip to content

Commit

Permalink
Merge pull request #10002 from eclipse/revert-9988-sharedCache
Browse files Browse the repository at this point in the history
Revert "Add a private flag to indicate a thread is in SCC read mutex"
  • Loading branch information
pshipton authored Jun 24, 2020
2 parents 1ef4b91 + c8075af commit ff705d5
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 20 deletions.
2 changes: 1 addition & 1 deletion runtime/oti/j9consts.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ extern "C" {
#define J9_PRIVATE_FLAGS_STACKS_OUT_OF_SYNC 0x40000000
#define J9_PRIVATE_FLAGS_FINAL_CALL_OUT_OF_MEMORY 0x80000000

#define J9_PRIVATE_FLAGS2_IN_SHARED_CACHE_READ_MUTEX 0x1
#define J9_PRIVATE_FLAGS2_UNUSED_0x1 0x1
#define J9_PRIVATE_FLAGS2_CHECK_PACKAGE_ACCESS 0x2
#define J9_PRIVATE_FLAGS2_UNSAFE_HANDLE_SIGBUS 0x4

Expand Down
1 change: 0 additions & 1 deletion runtime/shared_common/CacheMap.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -933,7 +933,6 @@ SH_CacheMap::updateROMSegmentList(J9VMThread* currentThread, bool hasClassSegmen
if (!hasClassSegmentMutex) {
Trc_SHR_Assert_ShouldNotHaveLocalMutex(classSegmentMutex);
Trc_SHR_Assert_False(_ccHead->hasWriteMutex(currentThread));
Trc_SHR_Assert_False(_ccHead->hasReadMutex(currentThread));
enterLocalMutex(currentThread, classSegmentMutex, "class segment mutex", "updateROMSegmentList");
} else {
Trc_SHR_Assert_ShouldHaveLocalMutex(classSegmentMutex);
Expand Down
15 changes: 0 additions & 15 deletions runtime/shared_common/CompositeCache.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2433,9 +2433,6 @@ SH_CompositeCacheImpl::enterReadMutex(J9VMThread* currentThread, const char* cal
}

Trc_SHR_Assert_NotEquals(currentThread, _commonCCInfo->hasWriteMutexThread);
if (UnitTest::COMPOSITE_CACHE_TEST != UnitTest::unitTest) {
Trc_SHR_Assert_False(hasReadMutex(currentThread));
}

/* THREADING: Important to increment readerCount before checking isLocked(), as the incremented
* reader count prevents a lock from occurring.
Expand Down Expand Up @@ -2473,8 +2470,6 @@ SH_CompositeCacheImpl::enterReadMutex(J9VMThread* currentThread, const char* cal
}
}
}

currentThread->privateFlags2 |= J9_PRIVATE_FLAGS2_IN_SHARED_CACHE_READ_MUTEX;
Trc_SHR_CC_enterReadMutex_Exit(currentThread, caller, rc);
return rc;
}
Expand Down Expand Up @@ -2503,12 +2498,8 @@ SH_CompositeCacheImpl::exitReadMutex(J9VMThread* currentThread, const char* call
}

Trc_SHR_Assert_NotEquals(currentThread, _commonCCInfo->hasWriteMutexThread);
if (UnitTest::COMPOSITE_CACHE_TEST != UnitTest::unitTest) {
Trc_SHR_Assert_True(hasReadMutex(currentThread));
}

decReaderCount(currentThread);
currentThread->privateFlags2 &= ~J9_PRIVATE_FLAGS2_IN_SHARED_CACHE_READ_MUTEX;
Trc_SHR_CC_exitReadMutex_Exit(currentThread, caller);
}

Expand Down Expand Up @@ -7326,9 +7317,3 @@ SH_CompositeCacheImpl::getCreateTime(void) const
{
return _oscache->getCreateTime();
}

bool
SH_CompositeCacheImpl::hasReadMutex(J9VMThread* currentThread) const
{
return J9_ARE_ALL_BITS_SET(currentThread->privateFlags2, J9_PRIVATE_FLAGS2_IN_SHARED_CACHE_READ_MUTEX);
}
4 changes: 1 addition & 3 deletions runtime/shared_common/CompositeCacheImpl.hpp
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*******************************************************************************
* Copyright (c) 2001, 2020 IBM Corp. and others
* Copyright (c) 2001, 2019 IBM Corp. and others
*
* This program and the accompanying materials are made available under
* the terms of the Eclipse Public License 2.0 which accompanies this
Expand Down Expand Up @@ -443,8 +443,6 @@ class SH_CompositeCacheImpl : public SH_CompositeCache, public AbstractMemoryPer
void setMetadataMemorySegment(J9MemorySegment** segment);

const char* getCacheNameWithVGen(void) const;

bool hasReadMutex(J9VMThread* currentThread) const;

private:
J9SharedClassConfig* _sharedClassConfig;
Expand Down

0 comments on commit ff705d5

Please sign in to comment.