[<prev] [next>] [day] [month] [year] [list]
Message-Id: <1395936298@web.de>
Date: Thu, 22 Oct 2009 16:41:19 +0200
From: Thomas Schlichter <thomas.schlichter@....de>
To: Suresh Siddha <suresh.b.siddha@...el.com>
Cc: Jan Beulich <JBeulich@...ell.com>,
Arjan van de Ven <arjan@...ux.intel.com>,
"dri-devel@...ts.sourceforge.net" <dri-devel@...ts.sourceforge.net>,
Robert Hancock <hancockrwd@...il.com>,
Henrique de Moraes Holschuh <hmh@....eng.br>,
"H. Peter Anvin" <hpa@...or.com>,
"jbarnes@...tuousgeek.org" <jbarnes@...tuousgeek.org>,
Jeremy Fitzhardinge <jeremy.fitzhardinge@...rix.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Ingo Molnar <mingo@...e.hu>, Ingo Molnar <mingo@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Thomas Hellstrom <thellstrom@...are.com>,
Tejun Heo <tj@...nel.org>,
"Pallipadi, Venkatesh" <venkatesh.pallipadi@...el.com>,
"x86@...nel.org" <x86@...nel.org>, Yinghai Lu <yinghai@...nel.org>
Subject: Re: [RFC Patch] use MTRR for write combining if PAT is not available
Suresh Siddha wrote:
> > > There is no need to go through num_var_ranges etc.
> >
> > Well I have to remember wich file added which MTRR entries. Because I have
> > to remove them if the file is being closed. Therefore I need an array of size
> > "num_var_ranges" (or MTRR_MAX_VAR_RANGES which is the uper bound).
>
> No. the private data for example can keep track of a struct containing
> mtrr number and ref count etc. Exporting var_ranges and going through
> var ranges elements in an array is not clean, especially when you are
> populating only one element.
OK, I should have written that num_var_ranges is neccessary if I do copy a
algorithm for exactly the same purpose from an other place. And I don't see
anything better in having a dynamically growing list that makes the operation
of incrementing MTRR entries an O(n) operation where it now is a O(1) operation.
Additionally, the worst case memory requirement would be
2*sizeof(int)*num_var_ranges, where it is now 1*sizeof(int)*num_var_ranges.
So for me, this would be a step back, but if you want this, you should additionally
change arch/x86/kernel/cpu/mtrr/if.c from where I reused the algorithm.
Regards,
Thomas
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists