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

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

Chinaunix

  平臺(tái) 論壇 博客 文庫(kù)
最近訪問板塊 發(fā)新帖
樓主: embeddedlwp
打印 上一主題 下一主題

[內(nèi)存管理] page cache問題 [復(fù)制鏈接]

論壇徽章:
1
雙魚座
日期:2013-08-28 13:47:26
51 [報(bào)告]
發(fā)表于 2012-05-29 16:50 |只看該作者
回復(fù) 50# embeddedlwp
我覺得這個(gè)值就是vm_start/PAGE_SIZE,得0是就是在線性地址小于4k時(shí)。

論壇徽章:
16
2015亞冠之吉達(dá)阿赫利
日期:2015-08-17 11:21:462015年迎新春徽章
日期:2015-03-04 09:58:11酉雞
日期:2014-12-07 09:06:19水瓶座
日期:2014-11-04 14:23:29天秤座
日期:2014-03-02 08:57:52雙魚座
日期:2014-02-22 13:07:56午馬
日期:2014-02-14 11:08:18雙魚座
日期:2014-02-13 11:09:37卯兔
日期:2014-02-06 15:10:34子鼠
日期:2014-01-20 14:48:19戌狗
日期:2013-12-19 09:37:46射手座
日期:2013-12-19 09:33:47
52 [報(bào)告]
發(fā)表于 2012-05-29 17:14 |只看該作者
回復(fù) 51# firkraag


也就是說(shuō)vma->pgoff在filemap與anon的時(shí)候是不一樣的含義是吧
在anon的時(shí)候是vm_start/PAGE_SIZE

不知理解對(duì)不對(duì)


   

論壇徽章:
1
雙魚座
日期:2013-08-28 13:47:26
53 [報(bào)告]
發(fā)表于 2012-05-29 17:17 |只看該作者
回復(fù) 52# embeddedlwp
是的。


   

論壇徽章:
16
2015亞冠之吉達(dá)阿赫利
日期:2015-08-17 11:21:462015年迎新春徽章
日期:2015-03-04 09:58:11酉雞
日期:2014-12-07 09:06:19水瓶座
日期:2014-11-04 14:23:29天秤座
日期:2014-03-02 08:57:52雙魚座
日期:2014-02-22 13:07:56午馬
日期:2014-02-14 11:08:18雙魚座
日期:2014-02-13 11:09:37卯兔
日期:2014-02-06 15:10:34子鼠
日期:2014-01-20 14:48:19戌狗
日期:2013-12-19 09:37:46射手座
日期:2013-12-19 09:33:47
54 [報(bào)告]
發(fā)表于 2012-05-29 17:37 |只看該作者
回復(fù) 43# firkraag

忘記了是哪個(gè)帖子啦,能不能給個(gè)鏈接  


   

論壇徽章:
1
雙魚座
日期:2013-08-28 13:47:26
55 [報(bào)告]
發(fā)表于 2012-05-29 17:44 |只看該作者
回復(fù) 54# embeddedlwp
http://72891.cn/thread-3731204-1-1.html

   

論壇徽章:
16
2015亞冠之吉達(dá)阿赫利
日期:2015-08-17 11:21:462015年迎新春徽章
日期:2015-03-04 09:58:11酉雞
日期:2014-12-07 09:06:19水瓶座
日期:2014-11-04 14:23:29天秤座
日期:2014-03-02 08:57:52雙魚座
日期:2014-02-22 13:07:56午馬
日期:2014-02-14 11:08:18雙魚座
日期:2014-02-13 11:09:37卯兔
日期:2014-02-06 15:10:34子鼠
日期:2014-01-20 14:48:19戌狗
日期:2013-12-19 09:37:46射手座
日期:2013-12-19 09:33:47
56 [報(bào)告]
發(fā)表于 2012-05-29 21:31 |只看該作者
回復(fù) 55# firkraag

COW的page fault函數(shù)是do_wp_page函數(shù),do_wp_page函數(shù)首先獲取與缺頁(yè)異常相關(guān)的頁(yè)框描述符。在2.6.11代碼中也就是一句:
pfn_to_page(pfn);
但是在2.6.24中確實(shí)下邊龐大的函數(shù),不知紅色部分的注釋怎么理解,比如什么叫raw PFN

/*
* This function gets the "struct page" associated with a pte.
*
* NOTE! Some mappings do not have "struct pages". A raw PFN mapping
* will have each page table entry just pointing to a raw page frame
* number, and as far as the VM layer is concerned, those do not have
* pages associated with them - even if the PFN might point to memory
* that otherwise is perfectly fine and has a "struct page".
*

* The way we recognize those mappings is through the rules set up
* by "remap_pfn_range()": the vma will have the VM_PFNMAP bit set,
* and the vm_pgoff will point to the first PFN mapped: thus every
* page that is a raw mapping will always honor the rule
*
*        pfn_of_page == vma->vm_pgoff + ((addr - vma->vm_start) >> PAGE_SHIFT)
*
* and if that isn't true, the page has been COW'ed (in which case it
* _does_ have a "struct page" associated with it even if it is in a
* VM_PFNMAP range).
*/
struct page *vm_normal_page(struct vm_area_struct *vma, unsigned long addr, pte_t pte)
{
        unsigned long pfn = pte_pfn(pte);

        if (unlikely(vma->vm_flags & VM_PFNMAP)) {
                unsigned long off = (addr - vma->vm_start) >> PAGE_SHIFT;
                if (pfn == vma->vm_pgoff + off)
                        return NULL;
                if (!is_cow_mapping(vma->vm_flags))
                        return NULL;
        }

#ifdef CONFIG_DEBUG_VM
        /*
         * Add some anal sanity checks for now. Eventually,
         * we should just do "return pfn_to_page(pfn)", but
         * in the meantime we check that we get a valid pfn,
         * and that the resulting page looks ok.
         */
        if (unlikely(!pfn_valid(pfn))) {
                print_bad_pte(vma, pte, addr);
                return NULL;
        }
#endif

        /*
         * NOTE! We still have PageReserved() pages in the page
         * tables.
         *
         * The PAGE_ZERO() pages and various VDSO mappings can
         * cause them to exist.
         */
        return pfn_to_page(pfn);
}

   

論壇徽章:
16
2015亞冠之吉達(dá)阿赫利
日期:2015-08-17 11:21:462015年迎新春徽章
日期:2015-03-04 09:58:11酉雞
日期:2014-12-07 09:06:19水瓶座
日期:2014-11-04 14:23:29天秤座
日期:2014-03-02 08:57:52雙魚座
日期:2014-02-22 13:07:56午馬
日期:2014-02-14 11:08:18雙魚座
日期:2014-02-13 11:09:37卯兔
日期:2014-02-06 15:10:34子鼠
日期:2014-01-20 14:48:19戌狗
日期:2013-12-19 09:37:46射手座
日期:2013-12-19 09:33:47
57 [報(bào)告]
發(fā)表于 2012-05-29 21:38 |只看該作者
本帖最后由 embeddedlwp 于 2012-05-29 21:45 編輯

回復(fù) 55# firkraag

非線性內(nèi)存映射主要用于什么場(chǎng)合?

在handle_pte_fault函數(shù)中,為什么根據(jù)pte設(shè)置_PAGE_FILE就可以確定是非線性內(nèi)存映射:

if (pte_file(entry))
                        return do_nonlinear_fault(mm, vma, address,
                                        pte, pmd, write_access, entry);


   

論壇徽章:
1
雙魚座
日期:2013-08-28 13:47:26
58 [報(bào)告]
發(fā)表于 2012-05-30 08:25 |只看該作者
本帖最后由 firkraag 于 2012-05-30 08:26 編輯

回復(fù) 57# embeddedlwp
這個(gè)_PAGE_FILE就是_PAGE_DIRTY,對(duì)于不存在于內(nèi)存中的臟頁(yè)(這種情況應(yīng)該不存在吧),就認(rèn)為是Non-Linear Memory Mapping頁(yè)。
   
systemcall:
http://lwn.net/Articles/24468/

論壇徽章:
1
雙魚座
日期:2013-08-28 13:47:26
59 [報(bào)告]
發(fā)表于 2012-05-30 08:53 |只看該作者
回復(fù) 56# embeddedlwp

見remap_pfn_range系統(tǒng)調(diào)用:
http://gnugeneration.com/books/linux/2.6.20/kernel-api/re286.html

就是直接修改頁(yè)表項(xiàng),讓它指向一個(gè)頁(yè)幀,不管該頁(yè)幀是否與一個(gè)page結(jié)構(gòu)相關(guān)。
   

論壇徽章:
1
雙魚座
日期:2013-08-28 13:47:26
60 [報(bào)告]
發(fā)表于 2012-05-30 09:06 |只看該作者
回復(fù) 59# firkraag
感覺就是要滿足這樣一種需求:“不管這個(gè)物理頁(yè)是否被使用,用戶都要能看到它的內(nèi)容,如果權(quán)限允許,還可以修改它!
這樣極端的需求給我的感覺就好像是在操作未經(jīng)加工(raw)的物理頁(yè)。

   
您需要登錄后才可以回帖 登錄 | 注冊(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