Skip to contentSkip to conversation

x86: memtest bootparam

DISCUSSION Andrew Morton 4 participants 8 messages Apr 18, 2008 – Apr 21, 2008 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 13 lines · On Fri, 18 Apr 2008 17:17:44 GMT Linux Kernel Mailing List…
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64df70793a9c344874eb4af19f85e0662d2d3ee
Commit:     c64df70793a9c344874eb4af19f85e0662d2d3ee
Parent:     9b967106da0357ef8b08847dce35584a04134f20
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri Mar 21 18:56:19 2008 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:21 2008 +0200

x86: memtest bootparam

...

Review

Quoted 4 lines
(quoted diff) +4 -0
+	memtest=	[KNL,X86_64] Enable memtest
+			Format: <integer>
+			range: 0,4 : pattern number
+			default : 0 <disable>

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

Quoted 19 lines
(quoted diff) +18 -0
+config MEMTEST_BOOTPARAM
+	bool "Memtest boot parameter"
+	depends on X86_64
+	default y
+	help
+	  This option adds a kernel parameter 'memtest', which allows memtest
+	  to be disabled at boot.  If this option is selected, memtest
+	  functionality can be disabled with memtest=0 on the kernel
+	  command line.  The purpose of this option is to allow a single
+	  kernel image to be distributed with memtest built in, but not
+	  necessarily enabled.
+
+	  If you are unsure how to answer this question, answer Y.
+
+config MEMTEST_BOOTPARAM_VALUE
+	int "Memtest boot parameter default value (0-4)"
+	depends on MEMTEST_BOOTPARAM
+	range 0 4

Review

Quoted 10 lines
(quoted diff) +10 -0
+	default 0
+	help
+	  This option sets the default value for the kernel parameter
+	  'memtest', which allows memtest to be disabled at boot.  If this
+	  option is set to 0 (zero), the memtest kernel parameter will
+	  default to 0, disabling memtest at bootup.  If this option is
+	  set to 4, the memtest kernel parameter will default to 4,
+	  enabling memtest at bootup, and use that as pattern number.
+
+	  If you are unsure how to answer this question, answer 0.

These seem pointless. Why not just unconditionally implement memtest=? All the code for that should be __init anyway so we're hardly saving anything here.

#2 lore raw
Quoted 16 lines · Andrew Morton
Quoted 13 lines · On Fri, 18 Apr 2008 17:17:44 GMT Linux Kernel Mailing List…
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64df70793a9c344874eb4af19f85e0662d2d3ee
Commit:     c64df70793a9c344874eb4af19f85e0662d2d3ee
Parent:     9b967106da0357ef8b08847dce35584a04134f20
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri Mar 21 18:56:19 2008 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:21 2008 +0200

x86: memtest bootparam

...

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+     memtest=        [KNL,X86_64] Enable memtest
+                     Format: <integer>
+                     range: 0,4 : pattern number
+                     default : 0 <disable>

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

need one text file in Documentation ?

Quoted 26 lines
Quoted 26 lines
(quoted diff) +24 -0
+config MEMTEST_BOOTPARAM
+     bool "Memtest boot parameter"
+     depends on X86_64
+     default y
+     help
+       This option adds a kernel parameter 'memtest', which allows memtest
+       to be disabled at boot.  If this option is selected, memtest
+       functionality can be disabled with memtest=0 on the kernel
+       command line.  The purpose of this option is to allow a single
+       kernel image to be distributed with memtest built in, but not
+       necessarily enabled.
+
+       If you are unsure how to answer this question, answer Y.
+
+config MEMTEST_BOOTPARAM_VALUE
+     int "Memtest boot parameter default value (0-4)"
+     depends on MEMTEST_BOOTPARAM
+     range 0 4
+     default 0
+     help
+       This option sets the default value for the kernel parameter
+       'memtest', which allows memtest to be disabled at boot.  If this
+       option is set to 0 (zero), the memtest kernel parameter will
+       default to 0, disabling memtest at bootup.  If this option is
Quoted 8 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+       set to 4, the memtest kernel parameter will default to 4,
+       enabling memtest at bootup, and use that as pattern number.
+
+       If you are unsure how to answer this question, answer 0.

These seem pointless. Why not just unconditionally implement memtest=? All the code for that should be __init anyway so we're hardly saving anything here.

also
for big box, like 64g above, that will take a while.

YH

#3 lore raw
Quoted 23 lines · On Fri, 18 Apr 2008 15:07:46 -0700 "Yinghai Lu" <[email protected]> wrote:
Quoted 21 lines · Andrew Morton
Quoted 17 lines · On Fri, 18 Apr 2008 17:17:44 GMT Linux Kernel Mailing List…
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64df70793a9c344874eb4af19f85e0662d2d3ee
Commit:     c64df70793a9c344874eb4af19f85e0662d2d3ee
Parent:     9b967106da0357ef8b08847dce35584a04134f20
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri Mar 21 18:56:19 2008 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:21 2008 +0200

x86: memtest bootparam

...

(quoted diff) +4 -0
+     memtest=        [KNL,X86_64] Enable memtest
+                     Format: <integer>
+                     range: 0,4 : pattern number
+                     default : 0 <disable>
Quoted 4 lines
Quoted 2 lines

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

need one text file in Documentation ?

Well if there was a single CONFIG_MEMTEST then it would probably be sufficent to document it all within the Kconfig help for that option.

But there isn't a CONFIG_MEMTEST. It appears that the presence or absence of the memtest feature is controlled by CONFIG_MEMTEST_BOOTPARAM which makes no sense at all!

Quoted 6 lines
Quoted 3 lines

These seem pointless. Why not just unconditionally implement memtest=? All the code for that should be __init anyway so we're hardly saving anything here.

also
for big box, like 64g above, that will take a while.

So... such users shouldn't add the memtest= boot parameter?

I'd suggest the following:

- Add a CONFIG_MEMTEST. No other config variable needed.

- Put all the memtest code inside #ifdef CONFIG_MEMTEST.

- As part of that memtest code, implement the memtest= boot option

- Make the memtest feature default to "off" if memtest= was not provided.

That's all very simple and conventional?

#4 lore raw
Quoted 53 lines · Andrew Morton
Quoted 23 lines · On Fri, 18 Apr 2008 15:07:46 -0700 "Yinghai Lu" <[email protected]> wrote:
Quoted 21 lines · Andrew Morton
Quoted 17 lines · On Fri, 18 Apr 2008 17:17:44 GMT Linux Kernel Mailing List…
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64df70793a9c344874eb4af19f85e0662d2d3ee
Commit:     c64df70793a9c344874eb4af19f85e0662d2d3ee
Parent:     9b967106da0357ef8b08847dce35584a04134f20
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri Mar 21 18:56:19 2008 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:21 2008 +0200

x86: memtest bootparam

...

(quoted diff) +4 -0
+     memtest=        [KNL,X86_64] Enable memtest
+                     Format: <integer>
+                     range: 0,4 : pattern number
+                     default : 0 <disable>
Quoted 4 lines
Quoted 2 lines

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

need one text file in Documentation ?

Well if there was a single CONFIG_MEMTEST then it would probably be sufficent to document it all within the Kconfig help for that option.

But there isn't a CONFIG_MEMTEST. It appears that the presence or absence of the memtest feature is controlled by CONFIG_MEMTEST_BOOTPARAM which makes no sense at all!

Quoted 6 lines
Quoted 3 lines

These seem pointless. Why not just unconditionally implement memtest=? All the code for that should be __init anyway so we're hardly saving anything here.

also
for big box, like 64g above, that will take a while.

So... such users shouldn't add the memtest= boot parameter?

I'd suggest the following:

- Add a CONFIG_MEMTEST. No other config variable needed.

Quoted 8 lines

- Put all the memtest code inside #ifdef CONFIG_MEMTEST.

- As part of that memtest code, implement the memtest= boot option

- Make the memtest feature default to "off" if memtest= was not provided.

That's all very simple and conventional?

ok, I will produce one patch. it will be

memtest=0 ==> disable
memtest=4 ==> will run 4 test pattern

YH

#5 lore raw
In reply to Andrew Morton

Hi!

Quoted 15 lines
Quoted 13 lines · Linux Kernel Mailing List
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64df70793a9c344874eb4af19f85e0662d2d3ee
Commit:     c64df70793a9c344874eb4af19f85e0662d2d3ee
Parent:     9b967106da0357ef8b08847dce35584a04134f20
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri Mar 21 18:56:19 2008 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:21 2008 +0200

x86: memtest bootparam

...

Quoted 7 lines

Review

Quoted 4 lines
(quoted diff) +4 -0
+	memtest=	[KNL,X86_64] Enable memtest
+			Format: <integer>
+			range: 0,4 : pattern number
+			default : 0 <disable>

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

Actually it would be nice if memtest was global, not x86-specific, feature.

I had some fun with arm running with 256mb, when only 128mb was present. It booted succesfully...

Signature · 2 lines
(english) http://www.livejournal.com/~pavelmachek
(cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html
#6 lore raw
Quoted 23 lines · Pavel Machek

Hi!

Quoted 20 lines
Quoted 17 lines · Linux Kernel Mailing List
Gitweb:     http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=c64df70793a9c344874eb4af19f85e0662d2d3ee
Commit:     c64df70793a9c344874eb4af19f85e0662d2d3ee
Parent:     9b967106da0357ef8b08847dce35584a04134f20
Author:     Yinghai Lu <[email protected]>
AuthorDate: Fri Mar 21 18:56:19 2008 -0700
Committer:  Ingo Molnar <[email protected]>
CommitDate: Thu Apr 17 17:41:21 2008 +0200

x86: memtest bootparam

...

(quoted diff) +4 -0
+   memtest=        [KNL,X86_64] Enable memtest
+                   Format: <integer>
+                   range: 0,4 : pattern number
+                   default : 0 <disable>
Quoted 8 lines
Quoted 2 lines

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

Actually it would be nice if memtest was global, not x86-specific, feature.

I had some fun with arm running with 256mb, when only 128mb was present. It booted succesfully...

depends if you have find_e820_area_size in you platform. that need reserve_early...

maybe we need to make reserve_early generic at first.

YH

#7 lore raw
Quoted 6 lines · Yinghai Lu
Quoted 6 lines
Quoted 2 lines

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

Actually it would be nice if memtest was global, not x86-specific, feature.

Quoted 7 lines
Quoted 2 lines

I had some fun with arm running with 256mb, when only 128mb was present. It booted succesfully...

depends if you have find_e820_area_size in you platform. that need reserve_early...

maybe we need to make reserve_early generic at first.

e820 is very x86 specific - i think the proper interface would be to move the memtest feature to the bootmem subsystem. I.e. to run it once all the early reservations have been flushed into bootmem - but before we free all bootmem pages into the page allocator.

this still leaves a rather large amount of RAM to be tested, and keeps it all cross-arch as well. Hm?

Ingo

#8 lore raw
Quoted 17 lines · Ingo Molnar
Quoted 6 lines · Yinghai Lu
Quoted 6 lines
Quoted 2 lines

OK. Did the new memtest feature get documented anywhere, btw? I'm only vaguely aware of its existence.

Actually it would be nice if memtest was global, not x86-specific, feature.

Quoted 7 lines
Quoted 2 lines

I had some fun with arm running with 256mb, when only 128mb was present. It booted succesfully...

depends if you have find_e820_area_size in you platform. that need reserve_early...

maybe we need to make reserve_early generic at first.

Quoted 7 lines

e820 is very x86 specific - i think the proper interface would be to move the memtest feature to the bootmem subsystem. I.e. to run it once all the early reservations have been flushed into bootmem - but before we free all bootmem pages into the page allocator.

this still leaves a rather large amount of RAM to be tested, and keeps it all cross-arch as well. Hm?

sounds good, and arch part only need to check region that bootdata use for bootmem allocation.

YH