Re: [patches] [PATCH] [1/58] x86: Always flush pages inchange_page_attr

From: Jan Beulich
Date: Mon Aug 06 2007 - 06:49:36 EST


>>> Andi Kleen <ak@xxxxxxx> 06.08.07 12:36 >>>
>On Monday 06 August 2007 12:15:01 Jan Beulich wrote:
>> But that is still wrong - you're again flushing the page table page rather than
>> the data one. Fixing this was the purpose of the patch I had sent, plus the
>> broken reference counting used by the reversion logic. Jan
>
>True. The problem is that we can't necessarily use the LRU list_head of the data
>pages though; e.g. when the page is mapped to user space.
>
>I guess we might need to go back to wbinvd again.

That was what my patch did, plus an attempt to avoid the wbinvd if all accumulated
pages that have pending modifications are contiguous.

>What was the remaining problem of the reference counting?

The counter gets adjusted regardless of the current attribute in effect, e.g. if you
change a page to PAGE_KERNEL that already happens to be PAGE_KERNEL, the
counter still gets decremented, which in turn may result in reverting the containing
2M/4M page prematurely. Likewise if a not-PAGE_KERNEL gets changed to another
non-PAGE_KERNEL attribute, the counter would get incremented, likely preventing
reverting the large page forever.

Jan

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/