[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-Id: <200910122145.38067.thomas.schlichter@web.de>
Date: Mon, 12 Oct 2009 21:45:37 +0200
From: Thomas Schlichter <thomas.schlichter@....de>
To: Thomas Hellstrom <thellstrom@...are.com>
Cc: "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"x86@...nel.org" <x86@...nel.org>,
"dri-devel@...ts.sourceforge.net" <dri-devel@...ts.sourceforge.net>,
Arjan van de Ven <arjan@...ux.intel.com>,
Yinghai Lu <yinghai@...nel.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
Venkatesh Pallipadi <venkatesh.pallipadi@...el.com>,
Suresh Siddha <suresh.b.siddha@...el.com>,
Jan Beulich <jbeulich@...ell.com>, Tejun Heo <tj@...nel.org>,
Jesse Barnes <jbarnes@...rnes-g45>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
Robert Hancock <hancockrwd@...il.com>
Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available
Thomas Hellstrom wrote:
> Hi!
>
> One problem with this patch is that it conflicts with the way graphics
> drivers traditionally handles
> the situation, namely
>
> 1) Set up mtrr
> 2) Map. If fallback to uncached minus we will still have write-combined
> access.
>
> I think mtrr-add used in this fashion will typically fail due to the
> alignment constraints. In particular,
> for set_memory_wc() the typical usage pattern is a large number of pages
> in a fragmented physical address space.
Yes, maybe this patch tries to change current behavior too less. Indeed, if
setting up MTRR entries it simply behaves as today, and userspace does not see
that write combining is not correctly enabled.
> So if we were to fix the problem with libpciaccess in the kernel, I
> think the best option would be to fail the user-space mapping when we
> can't make it write-combined.
One idea to do this would be the attached patch. It simply returns an error if
PAT is not available. It does not even try to use MTRR on its own. But maybe
even better would be to combine both patches to something like this:
1. try to use PAT
2. if this fails try to set up MTRR
3. if this also fails, return error
Kind regards,
Thomas
View attachment "0001-Do-not-mmap-ioremap-uncached-when-WC-is-requested.patch" of type "text/x-patch" (2631 bytes)
Powered by blists - more mailing lists