linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] [RFC] Verification and debugging of memory initialisation
@ 2008-04-16 13:50 Mel Gorman
  2008-04-16 13:51 ` [PATCH 1/4] Add a basic debugging framework for " Mel Gorman
                   ` (4 more replies)
  0 siblings, 5 replies; 18+ messages in thread
From: Mel Gorman @ 2008-04-16 13:50 UTC (permalink / raw)
  To: linux-mm; +Cc: Mel Gorman, mingo, linux-kernel

Boot initialisation has always been a bit of a mess with a number
of ugly points. While significant amounts of the initialisation
is architecture-independent, it trusts of the data received from the
architecture layer. This was a mistake in retrospect as it has resulted in
a number of difficult-to-diagnose bugs.

This patchset is an RFC to add some validation and tracing to memory
initialisation. It also introduces a few basic defencive measures and
depending on a boot parameter, will perform additional tests for errors
"that should never occur". I think this would have reduced debugging time
for some boot-related problems. The last part of the patchset is a similar
fix for the patch "[patch] mm: sparsemem memory_present() memory corruption"
that corrects a few more areas where similar errors were made.

I'm not looking to merge this as-is obviously but are there opinions on
whether this is a good idea in principal? Should it be done differently or
not at all?

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/4] Verification and debugging of memory initialisation V2
@ 2008-04-17  0:06 Mel Gorman
  2008-04-17  0:06 ` [PATCH 1/4] Add a basic debugging framework for memory initialisation Mel Gorman
  0 siblings, 1 reply; 18+ messages in thread
From: Mel Gorman @ 2008-04-17  0:06 UTC (permalink / raw)
  To: linux-mm; +Cc: Mel Gorman, mingo, linux-kernel

Many changes are based on feedback from Ingo. Others are from off-list mails
that were not group-replied for some reason. A number of issues were rattled
out while testing on machines other than x86-32. V1 was pretty flaky and
barely a proof-of-concept but this version has successfully boot-tested on
x86-32, x86-64 and ppc64. It has been successfully cross-compiled on ARM
which does not support arch-independent zone-sizing.

Changelog since V1
  o Make memory initialisation verification a DEBUG option depending on
    DEBUG_KERNEL option. By default it will then to verify structures but
    tracing can be enabled via the command-line. Without the CONFIG option,
    checks will still be made on PFN ranges passed by the architecture-specific
    code and a warning printed once if a problem is encountered
  o Reshuffle the patches so that the zonelist printing is at the end of the
    patchset. This is because -mm requires a different patch to print zonelists
    and this allows the end patch to be temporarily dropped when testing against
    -mm
  o Rebase on top of Ingo's sparsemem fix for easier testing
  o WARN_ON_ONCE when PFNs from the architecture violate SPARSEMEM limitations.
    The warning should be "harmless" as the system will boot regardless but
    it acts as a reminder that bad input is being used.
  o Convert mminit_debug_printk() to a macro
  o Spelling mistake corrections
  o Proper use of KERN_CONT
  o Document mminit_debug_level=
  o Fix check on pageflags where the masks were not being shifted
  o The zone ID should should have used page_zonenum not page_zone_id
  o Iterate all zonelists correctly
  o Correct typo of SECTIONS_SHIFT

Boot initialisation has always been a bit of a mess with a number
of ugly points. While significant amounts of the initialisation
is architecture-independent, it trusts of the data received from the
architecture layer. This was a mistake in retrospect as it has resulted in
a number of difficult-to-diagnose bugs.

This patchset optionally adds some validation and tracing to memory
initialisation. It also introduces a few basic defencive measures and
depending on a boot parameter, will perform additional tests for errors
"that should never occur". I think this would have reduced debugging time
for some boot-related problems. 

One question. These patches generally print at KERN_INFO level on the
assumption if the user has compiled in the option, they are not expecting to
also have to set loglevel. However, it has been pointed out privately that this
may be confusing. Which level for printk would people find less surprising?

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/4] Verification and debugging of memory initialisation V3
@ 2008-04-22 18:31 Mel Gorman
  2008-04-22 18:31 ` [PATCH 1/4] Add a basic debugging framework for memory initialisation Mel Gorman
  0 siblings, 1 reply; 18+ messages in thread
From: Mel Gorman @ 2008-04-22 18:31 UTC (permalink / raw)
  To: linux-mm; +Cc: Mel Gorman, mingo, linux-kernel, clameter

Other than a rebase to the latest -mm, there are not many big changes.
Credit goes to Christoph Lameter, an off-list reviewer and in particular
Ingo Molnar for helping bash this into shape.

Changelog since V2
  o (Mel) Rebase to 2.6.25-mm1 and rewrite zonelist dump
  o (Mel) Depend on DEBUG_VM instead of DEBUG_KERNEL
  o (Mel) Use __meminitdata instead of __initdata for logging level
  o (Christoph) Get rid of FLAGS_RESERVED references
  o (Christoph) Print out flag usage information
  o (Ingo) Default do the verifications on DEBUG_VM and instead control the
           level of verbose logging with mminit_loglevel= instead of
	   mminit_debug_level=
  o (Anon) Log at KERN_DEBUG level
  o (Anon) Optimisation to the mminit_debug_printk macro

Changelog since V1
  o (Ingo) Make memory initialisation verification a DEBUG option depending on
    DEBUG_KERNEL option. By default it will then to verify structures but
    tracing can be enabled via the command-line. Without the CONFIG option,
    checks will still be made on PFN ranges passed by the architecture-specific
    code and a warning printed once if a problem is encountered
  o (Ingo) WARN_ON_ONCE when PFNs from the architecture violate SPARSEMEM
    limitations. The warning should be "harmless" as the system will boot
    regardless but it acts as a reminder that bad input is being used.
  o (Anon) Convert mminit_debug_printk() to a macro
  o (Anon) Spelling mistake corrections
  o (Anon) Use of KERN_CONT properly for multiple printks
  o (Mel) Reshuffle the patches so that the zonelist printing is at the
    end of the patchset. This is because -mm requires a different patch to
    print zonelists and this allows the end patch to be temporarily dropped
    when testing against -mm
  o (Mel) Rebase on top of Ingo's sparsemem fix for easier testing
  o (Mel) Document mminit_debug_level=
  o (Mel) Fix check on pageflags where the masks were not being shifted
  o (Mel) The zone ID should should have used page_zonenum not page_zone_id
  o (Mel) Iterate all zonelists correctly
  o (Mel) Correct typo of SECTIONS_SHIFT

Boot initialisation has always been a bit of a mess with a number
of ugly points. While significant amounts of the initialisation
is architecture-independent, it trusts of the data received from the
architecture layer. This was a mistake in retrospect as it has resulted in
a number of difficult-to-diagnose bugs.

This patchset adds some validation and tracing to memory initialisation when
CONFIG_DEBUG_VM is set. The configuration option can be explicitly disabled
for embedded systems. It also introduces a few basic defencive measures and
depending on a boot parameter, will perform additional tests for errors
"that should never occur". The intention is that additional checks are
added over time that would have identified mysterious boot failures faster.

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 18+ messages in thread
* [PATCH 0/4] Verification and debugging of memory initialisation V4
@ 2008-04-28 19:28 Mel Gorman
  2008-04-28 19:28 ` [PATCH 1/4] Add a basic debugging framework for memory initialisation Mel Gorman
  0 siblings, 1 reply; 18+ messages in thread
From: Mel Gorman @ 2008-04-28 19:28 UTC (permalink / raw)
  To: akpm; +Cc: Mel Gorman, linux-kernel, linux-mm, apw, mingo, clameter

Boot initialisation is very complex, with significant numbers of
architecture-specific routines, hooks and code ordering. While significant
amounts of the initialisation is architecture-independent, it trusts
the data received from the architecture layer. This is a mistake, and has
resulted in a number of difficult-to-diagnose bugs. This patchset adds some
validation and tracing to memory initialisation. It also introduces a few
basic defensive measures.  The validation code can be explicitly disabled
for embedded systems.

I believe it's ready for a round of testing in -mm. The patches are based
against 2.6.25-mm1.

Changelog since V3
  o (Andrew) Only allow disabling of verification checks on CONFIG_EMBEDDED
  o (Andy Whitcroft) Documentation and leader fixups
  o (Andy) Rename mminit_debug_printk to mminit_dprintk for consistency
  o (Andy) Rename mminit_verify_pageflags to mminit_verify_pageflags_layout
  o (Andy) Rename mminit_validate_physlimits to mminit_validate_memmodel_limits
  o (Andy) Fix page->flags bitmap overlap checks
  o (Andy) Fix argument type for level in mminit_dprintk()
  o (Mel) Add WARNING error level that is the default logging level for
  	  mminit_loglevel=. Messages printed at this or lower levels will use
	  KERN_WARNING for the printk loglevel. Otherwise KERN_DEBUG is used.

Changelog since V2
  o (Mel) Rebase to 2.6.25-mm1 and rewrite zonelist dump
  o (Mel) Depend on DEBUG_VM instead of DEBUG_KERNEL
  o (Mel) Use __meminitdata instead of __initdata for logging level
  o (Christoph) Get rid of FLAGS_RESERVED references
  o (Christoph) Print out flag usage information
  o (Ingo) Default do the verifications on DEBUG_VM and instead control the
           level of verbose logging with mminit_loglevel= instead of
	   mminit_debug_level=
  o (Anon) Log at KERN_DEBUG level
  o (Anon) Optimisation to the mminit_debug_printk macro

Changelog since V1
  o (Ingo) Make memory initialisation verification a DEBUG option depending on
    DEBUG_KERNEL option. By default it will then to verify structures but
    tracing can be enabled via the command-line. Without the CONFIG option,
    checks will still be made on PFN ranges passed by the architecture-specific
    code and a warning printed once if a problem is encountered
  o (Ingo) WARN_ON_ONCE when PFNs from the architecture violate SPARSEMEM
    limitations. The warning should be "harmless" as the system will boot
    regardless but it acts as a reminder that bad input is being used.
  o (Anon) Convert mminit_debug_printk() to a macro
  o (Anon) Spelling mistake corrections
  o (Anon) Use of KERN_CONT properly for multiple printks
  o (Mel) Reshuffle the patches so that the zonelist printing is at the
    end of the patchset. This is because -mm requires a different patch to
    print zonelists and this allows the end patch to be temporarily dropped
    when testing against -mm
  o (Mel) Rebase on top of Ingo's sparsemem fix for easier testing
  o (Mel) Document mminit_debug_level=
  o (Mel) Fix check on pageflags where the masks were not being shifted
  o (Mel) The zone ID should should have used page_zonenum not page_zone_id
  o (Mel) Iterate all zonelists correctly
  o (Mel) Correct typo of SECTIONS_SHIFT

-- 
Mel Gorman
Part-time Phd Student                          Linux Technology Center
University of Limerick                         IBM Dublin Software Lab

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2008-04-28 19:28 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-16 13:50 [PATCH 0/4] [RFC] Verification and debugging of memory initialisation Mel Gorman
2008-04-16 13:51 ` [PATCH 1/4] Add a basic debugging framework for " Mel Gorman
2008-04-16 14:04   ` Ingo Molnar
2008-04-16 19:30     ` Mel Gorman
2008-04-16 13:51 ` [PATCH 2/4] Verify the page links and memory model Mel Gorman
2008-04-16 19:12   ` Christoph Lameter
2008-04-16 20:16     ` Mel Gorman
2008-04-16 13:51 ` [PATCH 3/4] Print out the zonelists on request for manual verification Mel Gorman
2008-04-16 13:52 ` [PATCH 4/4] Make defencive checks around PFN values registered for memory usage Mel Gorman
2008-04-16 14:02   ` Ingo Molnar
2008-04-16 14:00 ` [PATCH 0/4] [RFC] Verification and debugging of memory initialisation Ingo Molnar
  -- strict thread matches above, loose matches on Subject: below --
2008-04-17  0:06 [PATCH 0/4] Verification and debugging of memory initialisation V2 Mel Gorman
2008-04-17  0:06 ` [PATCH 1/4] Add a basic debugging framework for memory initialisation Mel Gorman
2008-04-21 15:14   ` Ingo Molnar
2008-04-22 11:21     ` Mel Gorman
2008-04-22 18:31 [PATCH 0/4] Verification and debugging of memory initialisation V3 Mel Gorman
2008-04-22 18:31 ` [PATCH 1/4] Add a basic debugging framework for memory initialisation Mel Gorman
2008-04-26  6:10   ` Andrew Morton
2008-04-28  9:34     ` Mel Gorman
2008-04-28 19:28 [PATCH 0/4] Verification and debugging of memory initialisation V4 Mel Gorman
2008-04-28 19:28 ` [PATCH 1/4] Add a basic debugging framework for memory initialisation Mel Gorman

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).