Home | History | Annotate | Download | only in dist

Lines Matching defs:pGroup

36896 typedef struct PGroup PGroup;
36898 /* Each page cache (or PCache) belongs to a PGroup. A PGroup is a set
36900 ** pages when they are under memory pressure. A PGroup is an instance of
36905 ** (1) Every PCache is the sole member of its own PGroup. There is
36906 ** one PGroup per PCache.
36908 ** (2) There is a single global PGroup that all PCaches are a member
36916 ** For mode (1), PGroup.mutex is NULL. For mode (2) there is only a single
36917 ** PGroup which is the pcache1.grp global variable and its mutex is
36920 struct PGroup {
36941 ** The PGroup mutex must be held when accessing nMax.
36943 PGroup *pGroup; /* PGroup this cache belongs to */
36953 ** when the accessor is holding the PGroup mutex.
36988 PGroup grp; /* The global PGroup for mode (2) */
37154 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
37155 pcache1LeaveMutex(pCache->pGroup);
37168 pcache1EnterMutex(pCache->pGroup);
37174 pCache->pGroup->nCurrentPage++;
37191 assert( sqlite3_mutex_held(p->pCache->pGroup->mutex) );
37197 pCache->pGroup->nCurrentPage--;
37257 assert( sqlite3_mutex_held(p->pGroup->mutex) );
37264 pcache1LeaveMutex(p->pGroup);
37268 pcache1EnterMutex(p->pGroup);
37291 ** PGroup LRU list, if is part of it. If pPage is not part of the PGroup
37294 ** The PGroup mutex must be held when this function is called.
37300 PGroup *pGroup;
37304 pGroup = pCache->pGroup;
37305 assert( sqlite3_mutex_held(pGroup->mutex) );
37306 if( pPage->pLruNext || pPage==pGroup->pLruTail ){
37313 if( pGroup->pLruHead==pPage ){
37314 pGroup->pLruHead = pPage->pLruNext;
37316 if( pGroup->pLruTail==pPage ){
37317 pGroup->pLruTail = pPage->pLruPrev;
37330 ** The PGroup mutex must be held when this function is called.
37337 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
37349 static void pcache1EnforceMaxPage(PGroup *pGroup){
37350 assert( sqlite3_mutex_held(pGroup->mutex) );
37351 while( pGroup->nCurrentPage>pGroup->nMaxPage && pGroup->pLruTail ){
37352 PgHdr1 *p = pGroup->pLruTail;
37353 assert( p->pCache->pGroup==pGroup );
37373 assert( sqlite3_mutex_held(pCache->pGroup->mutex) );
37429 PGroup *pGroup; /* The group the new page cache will belong to */
37434 ** PGroup. In other words, separateCache is true for mode (1) where no
37453 sz = sizeof(PCache1) + sizeof(PGroup)*separateCache;
37458 pGroup = (PGroup*)&pCache[1];
37459 pGroup->mxPinned = 10;
37461 pGroup = &pcache1.grp;
37463 pCache->pGroup = pGroup;
37469 pcache1EnterMutex(pGroup);
37470 pGroup->nMinPage += pCache->nMin;
37471 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
37472 pcache1LeaveMutex(pGroup);
37486 PGroup *pGroup = pCache->pGroup;
37487 pcache1EnterMutex(pGroup);
37488 pGroup->nMaxPage += (nMax - pCache->nMax);
37489 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
37492 pcache1EnforceMaxPage(pGroup);
37493 pcache1LeaveMutex(pGroup);
37505 PGroup *pGroup = pCache->pGroup;
37507 pcache1EnterMutex(pGroup);
37508 savedMaxPage = pGroup->nMaxPage;
37509 pGroup->nMaxPage = 0;
37510 pcache1EnforceMaxPage(pGroup);
37511 pGroup->nMaxPage = savedMaxPage;
37512 pcache1LeaveMutex(pGroup);
37522 pcache1EnterMutex(pCache->pGroup);
37524 pcache1LeaveMutex(pCache->pGroup);
37589 PGroup *pGroup;
37596 pcache1EnterMutex(pGroup = pCache->pGroup);
37610 /* The pGroup local variable will normally be initialized by the
37613 ** local variable here. Delaying the initialization of pGroup is an
37618 pGroup = pCache->pGroup;
37624 assert( pGroup->mxPinned == pGroup->nMaxPage + 10 - pGroup->nMinPage );
37627 nPinned>=pGroup->mxPinned
37639 if( pCache->bPurgeable && pGroup->pLruTail && (
37641 || pGroup->nCurrentPage>=pGroup->nMaxPage
37645 pPage = pGroup->pLruTail;
37661 pGroup->nCurrentPage -= (pOther->bPurgeable - pCache->bPurgeable);
37690 pcache1LeaveMutex(pGroup);
37707 PGroup *pGroup = pCache->pGroup;
37710 pcache1EnterMutex(pGroup);
37713 ** part of the PGroup LRU list.
37716 assert( pGroup->pLruHead!=pPage && pGroup->pLruTail!=pPage );
37718 if( reuseUnlikely || pGroup->nCurrentPage>pGroup->nMaxPage ){
37722 /* Add the page to the PGroup LRU list. */
37723 if( pGroup->pLruHead ){
37724 pGroup->pLruHead->pLruPrev = pPage;
37725 pPage->pLruNext = pGroup->pLruHead;
37726 pGroup->pLruHead = pPage;
37728 pGroup->pLruTail = pPage;
37729 pGroup->pLruHead = pPage;
37734 pcache1LeaveMutex(pCache->pGroup);
37753 pcache1EnterMutex(pCache->pGroup);
37770 pcache1LeaveMutex(pCache->pGroup);
37782 pcache1EnterMutex(pCache->pGroup);
37787 pcache1LeaveMutex(pCache->pGroup);
37797 PGroup *pGroup = pCache->pGroup;
37799 pcache1EnterMutex(pGroup);
37801 assert( pGroup->nMaxPage >= pCache->nMax );
37802 pGroup->nMaxPage -= pCache->nMax;
37803 assert( pGroup->nMinPage >= pCache->nMin );
37804 pGroup->nMinPage -= pCache->nMin;
37805 pGroup->mxPinned = pGroup->nMaxPage + 10 - pGroup->nMinPage;
37806 pcache1EnforceMaxPage(pGroup);
37807 pcache1LeaveMutex(pGroup);