亚洲av成人无遮挡网站在线观看,少妇性bbb搡bbb爽爽爽,亚洲av日韩精品久久久久久,兔费看少妇性l交大片免费,无码少妇一区二区三区

  免費(fèi)注冊(cè) 查看新帖 |

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問(wèn)板塊 發(fā)新帖
查看: 1427 | 回復(fù): 1
打印 上一主題 下一主題

[內(nèi)存管理] anon page到inactive lru之后還能回active lru嗎?page_check_references()問(wèn)題。 [復(fù)制鏈接]

論壇徽章:
0
跳轉(zhuǎn)到指定樓層
1 [收藏(0)] [報(bào)告]
發(fā)表于 2015-10-21 10:28 |只看該作者 |倒序?yàn)g覽
畫(huà)了一個(gè)anon page life的狀態(tài)圖。

發(fā)現(xiàn)點(diǎn)疑問(wèn),當(dāng)page到inactive lru時(shí),此時(shí)應(yīng)用再訪問(wèn)它的話,則會(huì)缺頁(yè)異常激活young pte, 考慮現(xiàn)在只有一個(gè)young pte的話,page_check_references代碼看起來(lái)只會(huì)keep在inactive lru中。不知道是否分析正確?

static enum page_references page_check_references(struct page *page,
                                                  struct scan_control *sc)
{
        int referenced_ptes, referenced_page;
        unsigned long vm_flags;

        referenced_ptes = page_referenced(page, 1, sc->target_mem_cgroup,
                                          &vm_flags);
        referenced_page = TestClearPageReferenced(page);

        /*
         * Mlock lost the isolation race with us.  Let try_to_unmap()
         * move the page to the unevictable list.
         */
        if (vm_flags & VM_LOCKED)
                return PAGEREF_RECLAIM;

        if (referenced_ptes) {
                if (PageSwapBacked(page))
                        return PAGEREF_ACTIVATE;
                /*
                 * All mapped pages start out with page table
                 * references from the instantiating fault, so we need
                 * to look twice if a mapped file page is used more
                 * than once.
                 *
                 * Mark it and spare it for another trip around the
                 * inactive list.  Another page table reference will
                 * lead to its activation.
                 *
                 * Note: the mark is set for activated pages as well
                 * so that recently deactivated but used pages are
                 * quickly recovered.
                 */
                SetPageReferenced(page);

                if (referenced_page || referenced_ptes > 1)
                        return PAGEREF_ACTIVATE;

                /*
                 * Activate file-backed executable pages after first usage.
                 */
                if (vm_flags & VM_EXEC)
                        return PAGEREF_ACTIVATE;

                return PAGEREF_KEEP;
        }

        /* Reclaim if clean, defer dirty pages to writeback */
        if (referenced_page && !PageSwapBacked(page))
                return PAGEREF_RECLAIM_CLEAN;

        return PAGEREF_RECLAIM;
}


論壇徽章:
0
2 [報(bào)告]
發(fā)表于 2015-10-21 10:56 |只看該作者
                SetPageReferenced(page);

                if (referenced_page || referenced_ptes > 1)
                        return PAGEREF_ACTIVATE;

判斷referenced_ptes > 1還有一個(gè)refrence_page條件。那么看起來(lái)流程是這樣的:

1. new page, active anon lru
2. shrink_active_list, (old lpte, no hw pte), inactive anon lru
3. 用戶訪問(wèn)缺頁(yè)異常。 (young lpte, hw pte), inactive anon lru
4. shrink_inactive_list, keep inactive anon lru (set page referenced)(old lpte, no hw pte)
5. 用戶訪問(wèn)缺頁(yè)異常。(young lpte, hw pte), inactive anon lru, page referenced
6. shrink_inactive_list, because page referenced and young pte,  回active anon lru

不知理解是否正確。
您需要登錄后才可以回帖 登錄 | 注冊(cè)

本版積分規(guī)則 發(fā)表回復(fù)

  

北京盛拓優(yōu)訊信息技術(shù)有限公司. 版權(quán)所有 京ICP備16024965號(hào)-6 北京市公安局海淀分局網(wǎng)監(jiān)中心備案編號(hào):11010802020122 niuxiaotong@pcpop.com 17352615567
未成年舉報(bào)專區(qū)
中國(guó)互聯(lián)網(wǎng)協(xié)會(huì)會(huì)員  聯(lián)系我們:huangweiwei@itpub.net
感謝所有關(guān)心和支持過(guò)ChinaUnix的朋友們 轉(zhuǎn)載本站內(nèi)容請(qǐng)注明原作者名及出處

清除 Cookies - ChinaUnix - Archiver - WAP - TOP