From: "Luis R. Rodriguez" <mcgrof@suse.com>
To: Andy Lutomirski <luto@amacapital.net>
Cc: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>,
Mike Marciniszyn <mike.marciniszyn@intel.com>,
Mike Marciniszyn <infinipath@intel.com>,
linux-rdma@vger.kernel.org, Andy Walls <awalls@md.metrocast.net>,
Toshi Kani <toshi.kani@hp.com>, "H. Peter Anvin" <hpa@zytor.com>,
Ingo Molnar <mingo@kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Hal Rosenstock <hal.rosenstock@gmail.com>,
Sean Hefty <sean.hefty@intel.com>,
Suresh Siddha <sbsiddha@gmail.com>,
Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>,
Roland Dreier <roland@purestorage.com>,
Juergen Gross <jgross@suse.com>,
Mauro Carvalho Chehab <mchehab@osg.samsung.com>,
Borislav Petkov <bp@suse.de>, Mel Gorman <mgorman@suse.de>,
Vlastimil Babka <vbabka@suse.cz>,
Davidlohr Bueso <dbueso@suse.de>,
Dave Hansen <dave.hansen@linux.intel.com>,
Jean-Christophe Plagniol-Villard <plagnioj@>
Subject: Re: ioremap_uc() followed by set_memory_wc() - burrying MTRR
Date: Wed, 22 Apr 2015 19:07:31 +0200 [thread overview]
Message-ID: <20150422170731.GH5622@wotan.suse.de> (raw)
In-Reply-To: <CALCETrWYRazYgovguNEodVZUwO3sCmzvg9-q73nTfJ2ahNrBxw@mail.gmail.com>
On Wed, Apr 22, 2015 at 09:53:03AM -0700, Andy Lutomirski wrote:
> On Wed, Apr 22, 2015 at 8:23 AM, Luis R. Rodriguez <mcgrof@suse.com> wrote:
> > On Tue, Apr 21, 2015 at 11:39:39PM -0600, Jason Gunthorpe wrote:
> >> On Wed, Apr 22, 2015 at 01:39:07AM +0200, Luis R. Rodriguez wrote:
> >> > > Mike, do you think the time is right to just remove the iPath driver?
> >> >
> >> > With PAT now being default the driver effectively won't work
> >> > with write-combining on modern kernels. Even if systems are old
> >> > they likely had PAT support, when upgrading kernels PAT will work
> >> > but write-combing won't on ipath.
> >>
> >> Sorry, do you mean the driver already doesn't get WC? Or do you mean
> >> after some more pending patches are applied?
> >
> > No, you have to consider the system used and the effects of calls used
> > on the driver in light of this table:
> >
> > ----------------------------------------------------------------------
> > MTRR Non-PAT PAT Linux ioremap value Effective memory type
> > ----------------------------------------------------------------------
> > Non-PAT | PAT
> > PAT
> > |PCD
> > ||PWT
> > |||
> > WC 000 WB _PAGE_CACHE_MODE_WB WC | WC
> > WC 001 WC _PAGE_CACHE_MODE_WC WC* | WC
> > WC 010 UC- _PAGE_CACHE_MODE_UC_MINUS WC* | UC
> > WC 011 UC _PAGE_CACHE_MODE_UC UC | UC
> > ----------------------------------------------------------------------
> >
> > (*) denotes implementation defined and is discouraged
> >
> > ioremap_nocache() will use _PAGE_CACHE_MODE_UC_MINUS by default today,
> > in the future we want to flip the switch and make _PAGE_CACHE_MODE_UC
> > the default. When that flip occurs it will mean ipath cannot get
> > write-combining on both non-PAT and PAT systems. Now that is for
> > the future, lets review the current situation for ipath.
> >
> > For PAT capable systems if mtrr_add() is used today on a Linux system on a
> > region mapped with ioremap_nocache() that will mean you effectively nullify the
> > mtrr_add() effect as the combinatorial effect above yields an effective memory
> > type of UC.
>
> Are you sure?
Well lets double check.
> I thought that ioremap_nocache currently is UC-,
It is.
> so mtrr_add + ioremap_nocache gets WC even on PAT systems.
https://www-ssl.intel.com/content/dam/www/public/us/en/documents/manuals/64-ia-32-architectures-software-developer-manual-325462.pdf
As per Intel SDM "11.5.2.2 Selecting Memory Types for Pentium
III and More Recent Processor Families" the ffect of a WC MTRR
for a region with a PAT entry value of UC will be UC. The effect
of a WC MTRR on a region with a PAT entry UC- will be WC. The
effect of a WC MTRR on a regoin with PAT entry WC is WC.
And indeed as per table 11-7 mtrr WC on PAT UC- yields WC. So ineed the above
table needs adjustment for this. So for PAT systems write-combing would be
effective with mtrr_add(), but once strong UC (_PAGE_CACHE_MODE_UC) is used by
default for ioremap_nocache() what I mentioned will be true. Furhtermore if we
switch the drivers to use arch_phys_wc_add() then for sure write-combining will
also not be effective.
Jason, Andy, is the change still a reasonable compromise? We'd just be asking
users to boot with noat for users for ipath, ivtv until the drivers gets proper
PAT support with a split.
There are two motivations for this:
* help move to strong UC as default
* bury MTRR
> Going forward, when mtrr_add is gone, this will change, of course.
Indeed.
Luis
next prev parent reply other threads:[~2015-04-22 17:07 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-15 20:42 ioremap_uc() followed by set_memory_wc() - burrying MTRR Andy Lutomirski
[not found] ` <CALCETrV0B7rp08-VYjp5=1CWJp7=xTUTBYo3uGxX317RxAQT+w-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2015-04-15 20:56 ` H. Peter Anvin
2015-04-21 22:46 ` Luis R. Rodriguez
2015-04-21 22:57 ` Jason Gunthorpe
[not found] ` <20150421225732.GA17356-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-04-21 23:39 ` Luis R. Rodriguez
[not found] ` <20150421233907.GA5622-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2015-04-22 5:39 ` Jason Gunthorpe
2015-04-22 15:23 ` Luis R. Rodriguez
2015-04-22 15:54 ` Luis R. Rodriguez
2015-04-22 15:59 ` Luis R. Rodriguez
[not found] ` <20150422152328.GB5622-B4tOwbsTzaBolqkO4TVVkw@public.gmane.org>
2015-04-22 16:17 ` Jason Gunthorpe
2015-04-22 16:51 ` Luis R. Rodriguez
[not found] ` <20150422161755.GA19500-ePGOBjL8dl3ta4EC/59zMFaTQe2KTcn/@public.gmane.org>
2015-04-22 18:53 ` Doug Ledford
[not found] ` <1429728791.121496.10.camel-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2015-04-22 19:05 ` Luis R. Rodriguez
2015-04-22 19:10 ` Doug Ledford
2015-04-22 19:14 ` Luis R. Rodriguez
2015-04-22 20:46 ` Jason Gunthorpe
2015-04-22 20:58 ` Doug Ledford
2015-04-22 16:53 ` Andy Lutomirski
2015-04-22 17:07 ` Luis R. Rodriguez [this message]
2015-04-15 22:15 ` Luis R. Rodriguez
2015-04-15 22:50 ` Andy Walls
[not found] ` <1429138212.1899.34.camel-xioobY1GIEhKttHedORAlB2eb7JE58TQ@public.gmane.org>
2015-04-15 23:52 ` Andy Lutomirski
2015-04-16 0:33 ` Andy Walls
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=20150422170731.GH5622@wotan.suse.de \
--to=mcgrof@suse.com \
--cc=awalls@md.metrocast.net \
--cc=bp@suse.de \
--cc=dave.hansen@linux.intel.com \
--cc=dbueso@suse.de \
--cc=hal.rosenstock@gmail.com \
--cc=hpa@zytor.com \
--cc=infinipath@intel.com \
--cc=jgross@suse.com \
--cc=jgunthorpe@obsidianresearch.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mchehab@osg.samsung.com \
--cc=mgorman@suse.de \
--cc=mike.marciniszyn@intel.com \
--cc=mingo@kernel.org \
--cc=rickard_strandqvist@spectrumdigital.se \
--cc=roland@purestorage.com \
--cc=sbsiddha@gmail.com \
--cc=sean.hefty@intel.com \
--cc=toshi.kani@hp.com \
--cc=vbabka@suse.cz \
/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