Re: [RFC Patch] use MTRR for write combining if PAT is not available

From: Thomas Schlichter
Date: Sat Oct 17 2009 - 15:48:54 EST


Jan Beulich wrote:
> >>> Thomas Schlichter <thomas.schlichter@xxxxxx> 14.10.09 21:14 >>>
> >
> >I added a function mtrr_add_unaligned() that tries to create as many MTRR
> >entries as necessary, beginning with the biggest regions. It does not
> > check the return values of each mtrr_add(), nor does it return the
> > indexes of the created MTRR entries. So it seems to be only useful with
> > increment=false. Or do you have a better idea?
>
> I don't have immediate thoughts on how to address this, but nevertheless
> I continue to think that the issue must be solved in some way, even more
> that now you may be leaking multiple MTRRs.

OK, it required some changes on different edges, but now I have it...

Patches 0001-0003 introduce functionality/changes to the MTRR and sysfs
subsystems. Patch 0004 is the main patch which sets up the MTRR entries when
pci memory regions are mmapped. The Patches 0005-0006 also change ioremap()
and set_mempry_wc() to set up MTRR entries. These two are completely optional,
especially and there is currently no way to automatically remove MTRR entries
set up with them.

What do you think about these patches?

Kind regards,
Thomas