From: Johannes Weiner <hannes@saeurebad.de>
To: David Miller <davem@davemloft.net>
Cc: akpm@linux-foundation.org, sparclinux@vger.kernel.org,
bugme-daemon@bugzilla.kernel.org, lomp0101@gmx.net,
linux-kernel@vger.kernel.org
Subject: Re: [Bug 11046] New: Kernel bug in mm/bootmem.c on Sparc machines
Date: Thu, 24 Jul 2008 21:32:06 +0000 [thread overview]
Message-ID: <873alz55pl.fsf@saeurebad.de> (raw)
In-Reply-To: <20080723.204247.114065226.davem@davemloft.net> (David Miller's message of "Wed, 23 Jul 2008 20:42:47 -0700 (PDT)")
Hi,
David Miller <davem@davemloft.net> writes:
> From: Andrew Morton <akpm@linux-foundation.org>
> Date: Wed, 23 Jul 2008 20:38:36 -0700
>
>> So if we're going to change it in 2.6.26, we'll need a separate patch.
>
> Here is the 2.6.26 version:
>
> bootmem: Allow zero length reserve and free.
>
> It's either this or all the call sites explicitly check
> when such a case is possible and sometimes expected.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> diff --git a/mm/bootmem.c b/mm/bootmem.c
> index 8d9f60e..e540f7a 100644
> --- a/mm/bootmem.c
> +++ b/mm/bootmem.c
> @@ -153,7 +153,8 @@ static void __init reserve_bootmem_core(bootmem_data_t *bdata,
> unsigned long sidx, eidx;
> unsigned long i;
>
> - BUG_ON(!size);
> + if (!size)
> + return;
>
> /* out of range */
> if (addr + size < bdata->node_boot_start ||
> @@ -187,7 +188,8 @@ static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
> unsigned long sidx, eidx;
> unsigned long i;
>
> - BUG_ON(!size);
> + if (!size)
> + return;
>
> /* out range */
> if (addr + size < bdata->node_boot_start ||
Sorry, Dave, I missed that before: there is still the BUG_ON() in
can_reserve_bootmem_core(), which should just return 0 instead.
Other than that, yes, Andrew, this introduces the same behaviour the
bootmem rewrite.
Hannes
WARNING: multiple messages have this Message-ID (diff)
From: Johannes Weiner <hannes@saeurebad.de>
To: David Miller <davem@davemloft.net>
Cc: akpm@linux-foundation.org, sparclinux@vger.kernel.org,
bugme-daemon@bugzilla.kernel.org, lomp0101@gmx.net,
linux-kernel@vger.kernel.org
Subject: Re: [Bug 11046] New: Kernel bug in mm/bootmem.c on Sparc machines
Date: Thu, 24 Jul 2008 23:32:06 +0200 [thread overview]
Message-ID: <873alz55pl.fsf@saeurebad.de> (raw)
In-Reply-To: <20080723.204247.114065226.davem@davemloft.net> (David Miller's message of "Wed, 23 Jul 2008 20:42:47 -0700 (PDT)")
Hi,
David Miller <davem@davemloft.net> writes:
> From: Andrew Morton <akpm@linux-foundation.org>
> Date: Wed, 23 Jul 2008 20:38:36 -0700
>
>> So if we're going to change it in 2.6.26, we'll need a separate patch.
>
> Here is the 2.6.26 version:
>
> bootmem: Allow zero length reserve and free.
>
> It's either this or all the call sites explicitly check
> when such a case is possible and sometimes expected.
>
> Signed-off-by: David S. Miller <davem@davemloft.net>
>
> diff --git a/mm/bootmem.c b/mm/bootmem.c
> index 8d9f60e..e540f7a 100644
> --- a/mm/bootmem.c
> +++ b/mm/bootmem.c
> @@ -153,7 +153,8 @@ static void __init reserve_bootmem_core(bootmem_data_t *bdata,
> unsigned long sidx, eidx;
> unsigned long i;
>
> - BUG_ON(!size);
> + if (!size)
> + return;
>
> /* out of range */
> if (addr + size < bdata->node_boot_start ||
> @@ -187,7 +188,8 @@ static void __init free_bootmem_core(bootmem_data_t *bdata, unsigned long addr,
> unsigned long sidx, eidx;
> unsigned long i;
>
> - BUG_ON(!size);
> + if (!size)
> + return;
>
> /* out range */
> if (addr + size < bdata->node_boot_start ||
Sorry, Dave, I missed that before: there is still the BUG_ON() in
can_reserve_bootmem_core(), which should just return 0 instead.
Other than that, yes, Andrew, this introduces the same behaviour the
bootmem rewrite.
Hannes
next prev parent reply other threads:[~2008-07-24 21:32 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <bug-11046-27@http.bugzilla.kernel.org/>
2008-07-06 20:20 ` [Bug 11046] New: Kernel bug in mm/bootmem.c on Sparc machines Andrew Morton
2008-07-24 3:25 ` David Miller
2008-07-24 3:25 ` David Miller
2008-07-24 3:38 ` Andrew Morton
2008-07-24 3:38 ` Andrew Morton
2008-07-24 3:42 ` David Miller
2008-07-24 3:42 ` David Miller
2008-07-24 21:32 ` Johannes Weiner [this message]
2008-07-24 21:32 ` Johannes Weiner
2008-07-24 21:59 ` David Miller
2008-07-24 21:59 ` David Miller
2008-07-24 12:09 ` Johannes Weiner
2008-07-24 12:09 ` Johannes Weiner
2008-07-24 18:37 ` Andrew Morton
2008-07-24 18:37 ` Andrew Morton
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=873alz55pl.fsf@saeurebad.de \
--to=hannes@saeurebad.de \
--cc=akpm@linux-foundation.org \
--cc=bugme-daemon@bugzilla.kernel.org \
--cc=davem@davemloft.net \
--cc=linux-kernel@vger.kernel.org \
--cc=lomp0101@gmx.net \
--cc=sparclinux@vger.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.