lkml.org 
[lkml]   [2008]   [Jan]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [patch 1/3] x86: a new API for drivers/etc to control cache and other page attributes
From
Date
Arjan van de Ven <arjan@infradead.org> writes:

> Right now, if drivers or other code want to change, say, a cache attribute of a
> page, the only API they have is change_page_attr(). c-p-a is a really bad API
> for this, because it forces the caller to know *ALL* the attributes he wants
> for the page, not just the 1 thing he wants to change. So code that wants to
> set a page uncachable, needs to be aware of the NX status as well etc etc etc.

Please think clearly through the various cases.

NX for areas which can be legitimately non NX (very few) is 100%
transparently handled in c_p_a() no matter what the caller passes in.

For DEBUG_PAGEALLOC it is similar. While it can make kernel pages
ro these should be only free pages and what business has anybody changing
attributes on arbitary free pages? No it is just a bug.

So if you look closely at the various cases there is no legitimate
reason to ever use anything other than the standard PAGE_KERNEL_*
defines with change_page_attr()

The only exception I know of is the cpa selftest which can change
attributes of arbitrary pages, but that one does a lookup_address on
its own anyways.

You basically solved a non-issue here.

-Andi


\
 
 \ /
  Last update: 2008-01-28 15:59    [W:0.055 / U:0.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site