lkml.org 
[lkml]   [2009]   [Jul]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 06/10] ksm: identify PageKsm pages
Andrea Arcangeli wrote:

>> +static inline void page_add_ksm_rmap(struct page *page)
>> +{
>> + if (atomic_inc_and_test(&page->_mapcount)) {
>> + page->mapping = (void *) PAGE_MAPPING_ANON;
>> + __inc_zone_page_state(page, NR_ANON_PAGES);
>> + }
>> +}
>
> Is it correct to account them as anon pages?

Yes, but ...

>> - if (PageAnon(old_page)) {
>> + if (PageAnon(old_page) && !PageKsm(old_page)) {
>> if (!trylock_page(old_page)) {
>> page_cache_get(old_page);
>> pte_unmap_unlock(page_table, ptl);
>
> What exactly does it buy to have PageAnon return 1 on ksm pages,
> besides requiring the above additional check (that if we stick to the
> above code, I would find safer to move inside reuse_swap_page).

I guess that if they are to remain unswappable, they
should go onto the unevictable list.

Then again, I'm guessing this is all about to change
in not too much time :)

--
All rights reversed.


\
 
 \ /
  Last update: 2009-07-21 19:59    [W:0.178 / U:3.712 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site