public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andi Kleen <andi@firstfloor.org>
To: Arjan van de Ven <arjan@infradead.org>
Cc: linux-kernel@vger.kernel.org, mingo@elte.hu, tglx@tglx.de, hpa@zytor.com
Subject: Re: [patch 1/3] x86: a new API for drivers/etc to control cache and other page attributes
Date: Mon, 28 Jan 2008 15:56:21 +0100	[thread overview]
Message-ID: <p733asi80dm.fsf@bingen.suse.de> (raw)
In-Reply-To: <20080125144937.2709f9ae@laptopd505.fenrus.org> (Arjan van de Ven's message of "Fri\, 25 Jan 2008 14\:49\:37 -0800")

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

  reply	other threads:[~2008-01-28 14:56 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-25 22:49 [patch 1/3] x86: a new API for drivers/etc to control cache and other page attributes Arjan van de Ven
2008-01-28 14:56 ` Andi Kleen [this message]
2008-01-28 15:55   ` Arjan van de Ven
2008-01-28 17:28     ` Andi Kleen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=p733asi80dm.fsf@bingen.suse.de \
    --to=andi@firstfloor.org \
    --cc=arjan@infradead.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=tglx@tglx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox