linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jim Bos <jim876@xs4all.nl>
To: Yinghai Lu <yinghai@kernel.org>
Cc: Maarten Lankhorst <m.b.lankhorst@gmail.com>,
	Matthew Garrett <mjg59@srcf.ucam.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
	Greg KH <gregkh@suse.de>, "H. Peter Anvin" <hpa@linux.intel.com>
Subject: Re: 2.6.39.1 immediately reboots/resets on EFI system
Date: Wed, 08 Jun 2011 18:44:19 +0200	[thread overview]
Message-ID: <4DEFA6E3.6090809@xs4all.nl> (raw)
In-Reply-To: <4DEEA548.5020405@kernel.org>

[-- Attachment #1: Type: text/plain, Size: 3070 bytes --]

On 06/08/2011 12:25 AM, Yinghai Lu wrote:
> On 06/07/2011 05:22 AM, Maarten Lankhorst wrote:
>> It seems the error still occurs when calling free_bootmem_late
>> even if I only reserve blocks that haven't been reserved yet.
> 
> please check this one.
> 
> ---
>  arch/x86/platform/efi/efi.c |    2 +-
>  include/linux/mm.h          |    2 ++
>  mm/page_alloc.c             |   32 ++++++++++++++++++++++++++++++++
>  3 files changed, 35 insertions(+), 1 deletion(-)
> 
> Index: linux-2.6/arch/x86/platform/efi/efi.c
> ===================================================================
> --- linux-2.6.orig/arch/x86/platform/efi/efi.c
> +++ linux-2.6/arch/x86/platform/efi/efi.c
> @@ -368,7 +368,7 @@ static void __init efi_free_boot_service
>  		    md->type != EFI_BOOT_SERVICES_DATA)
>  			continue;
>  
> -		free_bootmem_late(start, size);
> +		free_bootmem_late_with_active_regions(start, size);
>  	}
>  }
>  
> Index: linux-2.6/include/linux/mm.h
> ===================================================================
> --- linux-2.6.orig/include/linux/mm.h
> +++ linux-2.6/include/linux/mm.h
> @@ -1322,6 +1322,8 @@ extern void get_pfn_range_for_nid(unsign
>  extern unsigned long find_min_pfn_with_active_regions(void);
>  extern void free_bootmem_with_active_regions(int nid,
>  						unsigned long max_low_pfn);
> +void free_bootmem_late_with_active_regions(unsigned long addr,
> +						unsigned long size);
>  int add_from_early_node_map(struct range *range, int az,
>  				   int nr_range, int nid);
>  u64 __init find_memory_core_early(int nid, u64 size, u64 align,
> Index: linux-2.6/mm/page_alloc.c
> ===================================================================
> --- linux-2.6.orig/mm/page_alloc.c
> +++ linux-2.6/mm/page_alloc.c
> @@ -3828,6 +3828,38 @@ void __init free_bootmem_with_active_reg
>  	}
>  }
>  
> +/**
> + * free_bootmem_late_with_active_regions - Call free_bootmem_late for each active range
> + * @addr: starting address of the range
> + * @size: size of the range in bytes
> + *
> + * this function make sure on active regions only
> + */
> +void __init free_bootmem_late_with_active_regions(unsigned long addr,
> +						unsigned long size)
> +{
> +	int i;
> +	int nid = MAX_NUMNODES;
> +	unsigned long start_pfn = PFN_UP(addr);
> +	unsigned long end_pfn = PFN_DOWN(addr + size);
> +
> +	if (start_pfn >= end_pfn)
> +		return;
> +
> +	for_each_active_range_index_in_nid(i, nid) {
> +		unsigned long common_start, common_end;
> +
> +		common_start = max(start_pfn, early_node_map[i].start_pfn);
> +		common_end = min(end_pfn, early_node_map[i].end_pfn);
> +
> +		if (common_start >= common_end)
> +			continue;
> +
> +		free_bootmem_late(common_start << PAGE_SHIFT,
> +				  (common_end - common_start) << PAGE_SHIFT);
> +	}
> +}
> +
>  #ifdef CONFIG_HAVE_MEMBLOCK
>  /*
>   * Basic iterator support. Return the last range of PFNs for a node
> 

I applied this on top of 3.0-rc1 (with offsets), kernels boots but see
now in dmesg output a new 'BUG: Bad page state in process swapper
pfn:01800' see attached dmesg output.

Jim




[-- Attachment #2: bug.txt --]
[-- Type: text/plain, Size: 1075 bytes --]

[    2.630101] BUG: Bad page state in process swapper  pfn:01800
[    2.631771] page:ffffea0000054000 count:0 mapcount:-127 mapping:          (null) index:0x0
[    2.633472] page flags: 0x4000000000000000()
[    2.635172] Pid: 1, comm: swapper Not tainted 3.0.0-rc1 #3
[    2.636856] Call Trace:
[    2.638515]  [<ffffffff8107e50d>] ? bad_page+0xd0/0xe2
[    2.640176]  [<ffffffff8107ea4c>] ? free_pages_prepare+0x67/0xa3
[    2.641846]  [<ffffffff8107db1e>] ? get_pageblock_flags_group+0x3f/0x76
[    2.643511]  [<ffffffff8107ebbf>] ? free_hot_cold_page+0x25/0x193
[    2.645177]  [<ffffffff81021ac9>] ? change_page_attr_set+0x23/0x28
[    2.646858]  [<ffffffff8101ee85>] ? free_init_pages+0xfb/0x110
[    2.648550]  [<ffffffff810001d8>] ? init_post+0xe/0xb6
[    2.650237]  [<ffffffff817b9bfc>] ? kernel_init+0x122/0x126
[    2.651926]  [<ffffffff81444564>] ? kernel_thread_helper+0x4/0x10
[    2.653602]  [<ffffffff817b9ada>] ? start_kernel+0x34f/0x34f
[    2.655268]  [<ffffffff81444560>] ? gs_change+0x13/0x13
[    2.656920] Disabling lock debugging due to kernel taint

[-- Attachment #3: dmesg-3.0.0-rc1.gz --]
[-- Type: application/gzip, Size: 14862 bytes --]

  reply	other threads:[~2011-06-08 16:49 UTC|newest]

Thread overview: 129+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-06 11:15 gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? Jim
2010-11-07 21:31 ` Andi Kleen
2010-11-07 22:41   ` Andreas Schwab
2010-11-07 23:03     ` Andi Kleen
2010-11-08 10:49       ` Richard Guenther
2010-11-08 11:20         ` Andi Kleen
2010-11-08 11:20           ` Richard Guenther
2010-11-08 11:47             ` Paul Koning
2010-11-08 11:53               ` Jakub Jelinek
2010-11-08 12:20           ` Michael Matz
2010-11-08 18:39           ` Dave Korn
2010-11-09 13:00             ` Michael Matz
2010-11-09 13:48               ` Andi Kleen
2010-11-09 13:57                 ` Andreas Schwab
2010-11-09 16:43                   ` Jim
2010-11-13 11:13                     ` [PATCH] i8k: Tell gcc that *regs gets clobbered Jim Bos
2010-11-15  0:52                     ` gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? James Cloos
2010-11-15  3:21                       ` Linus Torvalds
2010-11-15  8:56                         ` Jakub Jelinek
2010-11-15  9:12                           ` Andi Kleen
2010-11-15  9:20                           ` Jakub Jelinek
2010-11-15 10:03                           ` Jakub Jelinek
2010-11-15 10:54                             ` Andi Kleen
2010-11-15 11:16                               ` Jakub Jelinek
2010-11-15 11:37                                 ` Andi Kleen
2010-11-15 17:36                                   ` Jim Bos
2010-11-15 17:44                                     ` Jakub Jelinek
2010-11-15 18:17                                       ` Jim Bos
2010-11-15 18:26                                         ` Jakub Jelinek
2010-11-15 19:10                                           ` Jim Bos
2010-11-15 16:04                                 ` Linus Torvalds
2010-11-15 17:40                                   ` Jim Bos
2010-11-15 18:08                                     ` Linus Torvalds
2010-11-15 18:30                                       ` Jim Bos
2010-11-15 18:37                                         ` Jim Bos
2010-11-15 18:56                                         ` Linus Torvalds
2010-11-15 18:58                                         ` Jakub Jelinek
2010-11-15 19:12                                           ` Jakub Jelinek
2010-11-15 19:21                                             ` Linus Torvalds
2010-11-15 19:51                                               ` Jakub Jelinek
2010-11-15 20:22                                                 ` Jim Bos
2011-06-03 13:05                                                   ` 2.6.39.1 immediately reboots/resets on EFI system Jim Bos
2011-06-03 13:33                                                     ` Matthew Garrett
2011-06-03 14:26                                                       ` Jim Bos
2011-06-03 14:46                                                         ` Matthew Garrett
2011-06-05 10:40                                                           ` Jim Bos
2011-06-05 12:57                                                             ` Maarten Lankhorst
2011-06-06 15:01                                                           ` Maarten Lankhorst
2011-06-06 15:40                                                             ` Jim Bos
2011-06-06 15:44                                                             ` Matthew Garrett
2011-06-06 15:27                                                         ` Maarten Lankhorst
2011-06-06 16:11                                                           ` Jim Bos
2011-06-06 16:43                                                             ` Maarten Lankhorst
2011-06-07  0:19                                                               ` Yinghai Lu
2011-06-07  1:41                                                                 ` Matthew Garrett
2011-06-07  2:05                                                                   ` Yinghai Lu
2011-06-07  8:25                                                                     ` Maarten Lankhorst
2011-06-07 15:14                                                                       ` Yinghai Lu
2011-06-07  9:08                                                                     ` Maarten Lankhorst
2011-06-07 12:22                                                                       ` Maarten Lankhorst
2011-06-07 22:25                                                                         ` Yinghai Lu
2011-06-08 16:44                                                                           ` Jim Bos [this message]
2011-06-08 19:17                                                                             ` Yinghai Lu
2011-06-08 19:23                                                                               ` Matthew Garrett
2011-06-08 19:27                                                                                 ` Yinghai Lu
2011-06-08 19:29                                                                                   ` Matthew Garrett
2011-06-08 19:35                                                                                     ` Yinghai Lu
2011-06-08 19:38                                                                                       ` Matthew Garrett
2011-06-08 19:46                                                                                         ` Yinghai Lu
2011-06-08 19:52                                                                                           ` Matthew Garrett
2011-06-08 19:48                                                                                         ` Yinghai Lu
2011-06-08 19:52                                                                                           ` Matthew Garrett
2011-06-08 20:03                                                                                             ` Yinghai Lu
2011-06-08 20:09                                                                                               ` Matthew Garrett
2011-06-08 20:23                                                                                                 ` Yinghai Lu
2011-06-08 20:30                                                                                                   ` Matthew Garrett
2011-06-08 20:36                                                                                                     ` Yinghai Lu
2011-06-08 20:42                                                                                                       ` Matthew Garrett
2011-06-08 20:46                                                                                                         ` Yinghai Lu
2011-06-08 21:06                                                                                                           ` Matthew Garrett
2011-06-08 21:06                                                                                                         ` Linus Torvalds
2011-06-08 21:28                                                                                                           ` Matthew Garrett
2011-06-08 21:31                                                                                                             ` H. Peter Anvin
2011-06-08 21:36                                                                                                               ` Matthew Garrett
2011-06-08 21:31                                                                                                             ` Linus Torvalds
2011-06-08 21:42                                                                                                               ` Matthew Garrett
2011-06-08 21:51                                                                                                               ` H. Peter Anvin
2011-06-08 22:57                                                                                                                 ` Linus Torvalds
2011-06-08 23:54                                                                                                                   ` Maarten Lankhorst
2011-06-08 21:38                                                                                                             ` Yinghai Lu
2011-06-10 16:47                                                                       ` Matthew Garrett
2011-06-10 17:51                                                                         ` Maarten Lankhorst
2011-06-10 17:54                                                                           ` Matthew Garrett
2011-06-10 22:45                                                                             ` Maarten Lankhorst
2011-06-10 22:58                                                                               ` Yinghai Lu
2011-06-10 23:03                                                                                 ` Matthew Garrett
2011-06-10 23:17                                                                                   ` Greg KH
2011-06-10 23:22                                                                                     ` Maarten Lankhorst
2011-06-10 23:25                                                                                     ` H. Peter Anvin
2011-06-10 23:26                                                                                   ` Yinghai Lu
2011-06-10 23:32                                                                                     ` H. Peter Anvin
2011-06-10 23:55                                                                                       ` Yinghai Lu
2011-06-11  0:00                                                                                         ` H. Peter Anvin
2011-06-11  0:19                                                                                           ` Yinghai Lu
2011-06-14 18:06                                                                                             ` H. Peter Anvin
2011-06-11 15:29                                                                                     ` Matthew Garrett
2011-06-10 23:00                                                                               ` Yinghai Lu
2011-06-13 16:47                                                                               ` Matthew Garrett
2011-06-13 17:52                                                                                 ` Maarten Lankhorst
2011-06-13 18:00                                                                                   ` Matthew Garrett
2011-06-13 18:14                                                                                     ` Maarten Lankhorst
2011-06-13 18:17                                                                                       ` Matthew Garrett
2011-06-13 18:23                                                                                         ` Maarten Lankhorst
2011-06-13 18:33                                                                                           ` Matthew Garrett
2011-06-13 18:45                                                                                             ` Maarten Lankhorst
2011-06-14 14:34                                                                                             ` Maarten Lankhorst
2011-06-14 14:50                                                                                             ` Maarten Lankhorst
2011-06-14 14:55                                                                                               ` Matthew Garrett
2010-11-15 22:43                                                 ` gcc 4.5.1 / as 2.20.51.0.11 miscompiling drivers/char/i8k.c ? Andi Kleen
2010-11-15 22:46                                                   ` Jakub Jelinek
2010-11-15 19:53                                             ` Richard Henderson
2010-11-15 10:24                           ` Richard Guenther
2010-11-15 18:45         ` Jeff Law
2010-11-15 19:04           ` Linus Torvalds
2010-11-15 22:07           ` Richard Guenther
2010-11-15 22:58             ` Jeff Law
2010-11-15 23:07               ` Richard Guenther
2010-11-16  4:10                 ` Jeff Law
2010-11-15 18:42     ` Jeff Law

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=4DEFA6E3.6090809@xs4all.nl \
    --to=jim876@xs4all.nl \
    --cc=gregkh@suse.de \
    --cc=hpa@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m.b.lankhorst@gmail.com \
    --cc=mjg59@srcf.ucam.org \
    --cc=yinghai@kernel.org \
    /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).