All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: yinghai@kernel.org, linux-mm@kvack.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Weirdness in __alloc_bootmem_node_high
Date: Fri, 20 Apr 2012 11:29:07 -0700	[thread overview]
Message-ID: <20120420182907.GG32324@google.com> (raw)
In-Reply-To: <20120417155502.GE22687@tiehlicka.suse.cz>

On Tue, Apr 17, 2012 at 05:55:02PM +0200, Michal Hocko wrote:
> Hi,
> I just come across the following condition in __alloc_bootmem_node_high
> which I have hard times to understand. I guess it is a bug and we need
> something like the following. But, to be honest, I have no idea why we
> care about those 128MB above MAX_DMA32_PFN.
> ---
>  mm/bootmem.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/bootmem.c b/mm/bootmem.c
> index 0131170..5adb072 100644
> --- a/mm/bootmem.c
> +++ b/mm/bootmem.c
> @@ -737,7 +737,7 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
>  	/* update goal according ...MAX_DMA32_PFN */
>  	end_pfn = pgdat->node_start_pfn + pgdat->node_spanned_pages;
>  
> -	if (end_pfn > MAX_DMA32_PFN + (128 >> (20 - PAGE_SHIFT)) &&
> +	if (end_pfn > MAX_DMA32_PFN + (128 << (20 - PAGE_SHIFT)) &&
>  	    (goal >> PAGE_SHIFT) < MAX_DMA32_PFN) {
>  		void *ptr;
>  		unsigned long new_goal;

Regardless of x86 not using it, this is a bug fix and this code path
seems to be used by mips at least.  Michal, can you please post proper
signed-off patch?  The code is simply trying to use memory above DMA32
limit if there seems to be enough space (128M) to avoid unnecessarily
using DMA32 memory.

Thanks.

-- 
tejun

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

WARNING: multiple messages have this Message-ID (diff)
From: Tejun Heo <tj@kernel.org>
To: Michal Hocko <mhocko@suse.cz>
Cc: yinghai@kernel.org, linux-mm@kvack.org,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: Weirdness in __alloc_bootmem_node_high
Date: Fri, 20 Apr 2012 11:29:07 -0700	[thread overview]
Message-ID: <20120420182907.GG32324@google.com> (raw)
In-Reply-To: <20120417155502.GE22687@tiehlicka.suse.cz>

On Tue, Apr 17, 2012 at 05:55:02PM +0200, Michal Hocko wrote:
> Hi,
> I just come across the following condition in __alloc_bootmem_node_high
> which I have hard times to understand. I guess it is a bug and we need
> something like the following. But, to be honest, I have no idea why we
> care about those 128MB above MAX_DMA32_PFN.
> ---
>  mm/bootmem.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/bootmem.c b/mm/bootmem.c
> index 0131170..5adb072 100644
> --- a/mm/bootmem.c
> +++ b/mm/bootmem.c
> @@ -737,7 +737,7 @@ void * __init __alloc_bootmem_node_high(pg_data_t *pgdat, unsigned long size,
>  	/* update goal according ...MAX_DMA32_PFN */
>  	end_pfn = pgdat->node_start_pfn + pgdat->node_spanned_pages;
>  
> -	if (end_pfn > MAX_DMA32_PFN + (128 >> (20 - PAGE_SHIFT)) &&
> +	if (end_pfn > MAX_DMA32_PFN + (128 << (20 - PAGE_SHIFT)) &&
>  	    (goal >> PAGE_SHIFT) < MAX_DMA32_PFN) {
>  		void *ptr;
>  		unsigned long new_goal;

Regardless of x86 not using it, this is a bug fix and this code path
seems to be used by mips at least.  Michal, can you please post proper
signed-off patch?  The code is simply trying to use memory above DMA32
limit if there seems to be enough space (128M) to avoid unnecessarily
using DMA32 memory.

Thanks.

-- 
tejun

  parent reply	other threads:[~2012-04-20 18:29 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 15:55 Weirdness in __alloc_bootmem_node_high Michal Hocko
2012-04-17 15:55 ` Michal Hocko
2012-04-17 17:12 ` Yinghai Lu
2012-04-17 17:12   ` Yinghai Lu
2012-04-17 17:32   ` Michal Hocko
2012-04-17 17:32     ` Michal Hocko
2012-04-17 18:07     ` Yinghai Lu
2012-04-17 18:07       ` Yinghai Lu
2012-04-17 18:30       ` Sam Ravnborg
2012-04-17 18:30         ` Sam Ravnborg
2012-04-17 21:33         ` Tejun Heo
2012-04-17 21:33           ` Tejun Heo
2012-04-19 12:50       ` Michal Hocko
2012-04-19 12:50         ` Michal Hocko
2012-04-20 18:29 ` Tejun Heo [this message]
2012-04-20 18:29   ` Tejun Heo
2012-04-20 19:14   ` Sam Ravnborg
2012-04-20 19:14     ` Sam Ravnborg
2012-04-20 19:29     ` Michal Hocko
2012-04-20 19:29       ` Michal Hocko
2012-04-20 19:32       ` Yinghai Lu
2012-04-20 19:32         ` Yinghai Lu
2012-04-20 19:41         ` Michal Hocko
2012-04-20 19:41           ` Michal Hocko
2012-04-20 19:30     ` Yinghai Lu
2012-04-20 19:30       ` Yinghai Lu
2012-04-20 19:43       ` Sam Ravnborg
2012-04-20 19:43         ` Sam Ravnborg
2012-04-22 19:22         ` David Miller
2012-04-22 19:22           ` David Miller
2012-04-22 20:05           ` Sam Ravnborg
2012-04-22 20:05             ` Sam Ravnborg
2012-04-23  2:00             ` David Miller
2012-04-23  2:00               ` David Miller
2012-04-23  5:12               ` Sam Ravnborg
2012-04-23  5:12                 ` Sam Ravnborg
2012-04-24  6:32               ` Sam Ravnborg
2012-04-24  6:32                 ` Sam Ravnborg
2012-04-24  7:00                 ` David Miller
2012-04-24  7:00                   ` David Miller
2012-04-27  3:32                   ` David Miller
2012-04-27  3:32                     ` David Miller

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=20120420182907.GG32324@google.com \
    --to=tj@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@suse.cz \
    --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 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.