Re: [PATCH] add alloc_pages_exact_node()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi, Bob.

On Sat, Apr 10, 2010 at 8:49 PM, Bob Liu <lliubbo@xxxxxxxxx> wrote:
> Add alloc_pages_exact_node() to allocate pages from exact
> node.
>
> Signed-off-by: Bob Liu <lliubbo@xxxxxxxxx>
> ---
>  arch/powerpc/platforms/cell/ras.c |    4 ++--
>  include/linux/gfp.h               |    7 +++++++
>  mm/mempolicy.c                    |    2 +-
>  mm/migrate.c                      |    3 +--
>  4 files changed, 11 insertions(+), 5 deletions(-)
>
> diff --git a/arch/powerpc/platforms/cell/ras.c b/arch/powerpc/platforms/cell/ras.c
> index 6d32594..93a5afd 100644
> --- a/arch/powerpc/platforms/cell/ras.c
> +++ b/arch/powerpc/platforms/cell/ras.c
> @@ -123,8 +123,8 @@ static int __init cbe_ptcal_enable_on_node(int nid, int order)
>
>        area->nid = nid;
>        area->order = order;
> -       area->pages = alloc_pages_from_valid_node(area->nid,
> -                       GFP_KERNEL | GFP_THISNODE, area->order);
> +       area->pages = alloc_pages_exact_node(area->nid, GFP_KERNEL,
> +                               area->order);
>
>        if (!area->pages) {
>                printk(KERN_WARNING "%s: no page on node %d\n",
> diff --git a/include/linux/gfp.h b/include/linux/gfp.h
> index c94f2ed..70cf2ae 100644
> --- a/include/linux/gfp.h
> +++ b/include/linux/gfp.h
> @@ -296,6 +296,13 @@ static inline struct page *alloc_pages_from_valid_node(int nid, gfp_t gfp_mask,
>        return __alloc_pages(gfp_mask, order, node_zonelist(nid, gfp_mask));
>  }
>
> +static inline struct page *alloc_pages_exact_node(int nid, gfp_t gfp_mask,
> +                                               unsigned int order)
> +{
> +       return alloc_pages_from_valid_node(nid, gfp_mask | GFP_THISNODE,
> +                       order);
> +}
> +
>  #ifdef CONFIG_NUMA
>  extern struct page *alloc_pages_current(gfp_t gfp_mask, unsigned order);
>
> diff --git a/mm/mempolicy.c b/mm/mempolicy.c
> index 6838cd8..08f40a2 100644
> --- a/mm/mempolicy.c
> +++ b/mm/mempolicy.c
> @@ -842,7 +842,7 @@ static void migrate_page_add(struct page *page, struct list_head *pagelist,
>
>  static struct page *new_node_page(struct page *page, unsigned long node, int **x)
>  {
> -       return alloc_pages_from_valid_node(node, GFP_HIGHUSER_MOVABLE, 0);
> +       return alloc_pages_exact_node(node, GFP_HIGHUSER_MOVABLE, 0);
>  }

It's behavior change. Please, write down why you want to change
behavior in log.
Although I knew it, you need to explain it for others and git log,

-- 
Kind regards,
Minchan Kim

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

[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]