On Thu, 2005-11-17 at 13:02 -0800, Andrew Morton wrote:
> Jens Axboe <[email protected]> wrote:
> >
> > does zonelist->zones change further down the path
> > and we need the revalidation before after restarting?
> >
>
> err, yeah. Like this, I think?
>
>
Good catch Jens. The zone variables (and their initialization) got
slightly changed because we moved the zone_statistics part from
_alloc_pages to get_page_from_freelist function.
Andrew's patch below is the right fix.
-rohit
>
> We modify local variable `z' while walking across the zones. So we need to
> restore it if we do the `goto restart' thing in the rare case where the
> oom-killer was called.
>
>
> Signed-off-by: Andrew Morton <[email protected]>
> ---
>
> mm/page_alloc.c | 9 ++++-----
> 1 files changed, 4 insertions(+), 5 deletions(-)
>
> diff -puN mm/page_alloc.c~alloc_pages-oops-fix mm/page_alloc.c
> --- 25/mm/page_alloc.c~alloc_pages-oops-fix Thu Nov 17 12:58:38 2005
> +++ 25-akpm/mm/page_alloc.c Thu Nov 17 12:59:19 2005
> @@ -845,13 +845,12 @@ __alloc_pages(gfp_t gfp_mask, unsigned i
>
> might_sleep_if(wait);
>
> - z = zonelist->zones; /* the list of zones suitable for gfp_mask */
> +restart:
> + z = zonelist->zones; /* the list of zones suitable for gfp_mask */
>
> - if (unlikely(*z == NULL)) {
> - /* Should this ever happen?? */
> + if (unlikely(*z == NULL)) /* Should this ever happen?? */
> return NULL;
> - }
> -restart:
> +
> page = get_page_from_freelist(gfp_mask|__GFP_HARDWALL, order,
> zonelist, ALLOC_CPUSET);
> if (page)
> _
>
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]