linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mika Fischer <mika.fischer@zoopnet.de>
To: Yinghai Lu <yhlu.kernel@gmail.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Ingo Molnar <mingo@elte.hu>, "H. Peter Anvin" <hpa@zytor.com>,
	Thomas Gleixner <tglx@linutronix.de>,
	Gabriel C <nix.or.die@googlemail.com>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] x86: mtrr cleanup for converting continuous to discrete - auto detect
Date: Thu, 01 May 2008 18:59:56 +0200	[thread overview]
Message-ID: <4819F70C.6030305@zoopnet.de> (raw)
In-Reply-To: <86802c440805010935w5a74f132l639d7b794804bb9e@mail.gmail.com>

Yinghai Lu schrieb:
> On Thu, May 1, 2008 at 5:09 AM, Mika Fischer <mika.fischer@zoopnet.de> wrote:
>> Yinghai Lu schrieb:
>>
>>> loop mtrr chunk_size and gran_size from 1M to 2G to find out optimal value.
>>  >
>>  > so user don't need to add mtrr_chunk_size and mtrr_gran_size,
>>  >
>>  > if optimal value is not found, print out all list to help select less optimal
>>  > value.
>>  >
>>  > add mtrr_spare_reg_nr= so user could set 2 instead of 1, if the card need more entries.
>>
>>  On my system x86-latest + this patch and using no boot options gives me
>>  this /proc/mtrr:
>>  reg00: base=0x00000000 (   0MB), size=2048MB: write-back, count=1
>>  reg01: base=0x80000000 (2048MB), size= 512MB: write-back, count=1
>>  reg02: base=0xa0000000 (2560MB), size= 256MB: write-back, count=1
>>  reg03: base=0xb0000000 (2816MB), size= 256MB: write-back, count=1
>>  reg04: base=0xbf700000 (3063MB), size=   1MB: uncachable, count=1
>>  reg05: base=0xbf800000 (3064MB), size=   8MB: uncachable, count=1
>>  reg06: base=0x100000000 (4096MB), size=1024MB: write-back, count=1
>>
>>  Which is OK. It could probably collapse reg01-reg03 into one but that's
>>  a minor issue (for me at least, there are probably cases where
>>  collapsing them might save the user from having to specify the
>>  mtrr_spare_reg_nr boot option).
> 
> yes. please try mtrr_spare_reg_nr=3 or etc.

Sure this works. But that was my point exactly. It should be possible to
figure out the better configuration automatically so that I *don't* have
to specify mtrr_spare_reg_nr=3.

Or in other words: If there are multiple equivalent configurations that
don't lose any RAM(!), the one with the most free MTRR regs should be
preferred.

AFAICT you loop over the chunk size and stop when you have found a
configuration that leaves the number of free MTRR registers requested
(default 1).

This will almost always result in a configuration where you have
*exactly* the number of requested free regs available, even if a more
efficient configuration was possible.

What I'm suggesting is, that - in the case where no RAM is lost at this
point - the loop should continue to try and free up more registers, as
long as no RAM is lost.

I.e. even if in my case chunk_size=256M gives adequate results and
leaves me with 1 free reg, since I don't lose any RAM at this point the
loop should continue as long as I do not lose any RAM. That way it would
find the ideal chunk_size (1g) automatically.

But again, this is non-critical. But I think it might help a few users
who need more than 1 free reg, because they probably will have no idea
about the kernel option...

Regards,
 Mika

  reply	other threads:[~2008-05-01 17:00 UTC|newest]

Thread overview: 89+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-28  6:37 [PATCH] x86: mtrr cleanup for converting continuous to discrete layout Yinghai Lu
2008-04-28  9:06 ` [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v2 Yinghai Lu
2008-04-28 13:08   ` Ingo Molnar
2008-04-28 13:49     ` Arjan van de Ven
2008-04-28 15:28       ` Mika Fischer
2008-04-28  5:50         ` Arjan van de Ven
2008-04-28 16:01         ` Gabriel C
2008-04-28 16:28           ` Mika Fischer
2008-04-28 19:44   ` [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v3 Yinghai Lu
2008-04-28 20:15     ` Ingo Molnar
2008-04-28 20:18       ` Yinghai Lu
2008-04-28 20:29         ` Ingo Molnar
2008-04-28 20:16     ` [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v4 Yinghai Lu
2008-04-28 22:05       ` [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v5 Yinghai Lu
2008-04-28 22:36         ` Randy Dunlap
2008-04-28 22:47           ` Yinghai Lu
2008-04-29  2:42         ` Andrew Morton
2008-04-29  3:01           ` Yinghai Lu
     [not found]         ` <200804290157.30651.yhlu.kernel@gmail.com>
2008-04-29  8:59           ` [PATCH 2/2] x86: fix trimming e820 with MTRR holes Yinghai Lu
2008-04-29 11:35             ` Ingo Molnar
2008-04-29 17:18               ` Yinghai Lu
2008-04-29 17:20                 ` Yinghai Lu
2008-04-30  3:25             ` [PATCH] x86: fix trimming e820 with MTRR holes. - fix Yinghai Lu
2008-04-30 12:09               ` Ingo Molnar
2008-04-29  9:00         ` [PATCH 1/2] x86: mtrr cleanup for converting continuous to discrete layout v7 Yinghai Lu
2008-04-29  9:47           ` Gabriel C
2008-04-29 10:30             ` Yinghai Lu
2008-04-29 10:56               ` Yinghai Lu
2008-04-29 11:26                 ` Ingo Molnar
2008-04-29 11:51                 ` Gabriel C
2008-04-29 17:11                   ` Yinghai Lu
2008-04-29 20:25                     ` Gabriel C
2008-04-29 21:49                       ` Yinghai Lu
2008-04-29 23:56                         ` Gabriel C
2008-04-30  0:06                           ` Gabriel C
2008-04-30  0:38                             ` Yinghai Lu
2008-04-30  1:02                               ` Gabriel C
2008-04-30  3:00                                 ` Yinghai Lu
2008-04-30  3:29                                   ` Yinghai Lu
2008-04-30  4:12                                     ` Gabriel C
2008-04-30  4:25                                       ` Yinghai Lu
2008-04-30 12:04                                         ` Gabriel C
2008-04-30 16:26                                           ` Yinghai Lu
2008-04-30  0:13                           ` Yinghai Lu
2008-04-29 10:52           ` [PATCH 1/2] x86: mtrr cleanup for converting continuous to discrete layout v8 Yinghai Lu
2008-04-29 13:07             ` Ingo Molnar
2008-04-29 17:25               ` Yinghai Lu
2008-04-29 20:46             ` Randy Dunlap
2008-04-29 21:54               ` Yinghai Lu
2008-04-30  3:25             ` [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v8 - fix Yinghai Lu
2008-04-30 12:09               ` Ingo Molnar
2008-05-01  8:00               ` [PATCH] x86: mtrr cleanup for converting continuous to discrete - auto detect Yinghai Lu
2008-05-01 11:45                 ` Gabriel C
2008-05-02  0:06                   ` Yinghai Lu
2008-05-02  0:29                     ` Gabriel C
2008-05-02  0:35                       ` Yinghai Lu
2008-05-02  1:18                         ` Gabriel C
2008-05-02  1:55                           ` Yinghai Lu
2008-05-01 12:09                 ` Mika Fischer
2008-05-01 16:35                   ` Yinghai Lu
2008-05-01 16:59                     ` Mika Fischer [this message]
2008-05-01 17:40                       ` Yinghai Lu
2008-05-01 15:09                 ` Randy Dunlap
2008-05-01 16:38                   ` Yinghai Lu
2008-05-01 18:57                 ` [PATCH] x86: mtrr cleanup for converting continuous to discrete - auto detect v2 Yinghai Lu
2008-05-01 19:42                   ` H. Peter Anvin
2008-05-01 21:02                     ` Yinghai Lu
2008-05-01 21:10                       ` H. Peter Anvin
2008-05-01 21:20                         ` Yinghai Lu
2008-05-01 21:26                           ` H. Peter Anvin
2008-05-01 21:31                             ` Yinghai Lu
2008-05-01 21:33                               ` H. Peter Anvin
2008-05-01 21:44                                 ` Yinghai Lu
2008-05-01 21:49                                   ` H. Peter Anvin
2008-05-01 22:52                                     ` Yinghai Lu
2008-05-01 22:57                                       ` H. Peter Anvin
2008-05-01 23:10                                         ` Yinghai Lu
2008-05-02  0:52                   ` [PATCH] x86: mtrr cleanup for converting continuous to discrete - auto detect v3 Yinghai Lu
2008-05-02  9:40                     ` [PATCH] x86: mtrr cleanup for converting continuous to discrete - auto detect v4 Yinghai Lu
2008-04-29 19:00         ` [PATCH] x86: mtrr cleanup for converting continuous to discrete layout v5 Eric W. Biederman
2008-04-29 20:04           ` Yinghai Lu
2008-04-29 20:29             ` Eric W. Biederman
2008-04-29 21:57               ` Yinghai Lu
2008-04-29 22:09                 ` Ingo Molnar
2008-04-29 22:18                   ` Yinghai Lu
2008-04-29 22:14                 ` Eric W. Biederman
2008-04-29 22:54                   ` Thomas Gleixner
2008-04-30  1:16                     ` Eric W. Biederman
2008-04-30  9:57                       ` Alan Cox

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=4819F70C.6030305@zoopnet.de \
    --to=mika.fischer@zoopnet.de \
    --cc=akpm@linux-foundation.org \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nix.or.die@googlemail.com \
    --cc=tglx@linutronix.de \
    --cc=yhlu.kernel@gmail.com \
    /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;
as well as URLs for NNTP newsgroup(s).