Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1412881

Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0

Path csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod
From Geert Uytterhoeven <geert@linux-m68k.org>
Newsgroups linux.kernel
Subject Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0
Date Fri, 03 Jun 2016 10:00:02 +0200
Message-ID <rFSbo-od-27@gated-at.bofh.it> (permalink)
References <rEvgS-4GH-23@gated-at.bofh.it> <rExLH-6b9-7@gated-at.bofh.it> <rEZHY-7YV-17@gated-at.bofh.it> <rFatH-6x6-13@gated-at.bofh.it> <rFbg5-74G-7@gated-at.bofh.it> <rFycG-4ML-31@gated-at.bofh.it> <rFzBM-5Mk-41@gated-at.bofh.it> <rFzLr-5Px-3@gated-at.bofh.it> <rFFQR-1d1-7@gated-at.bofh.it>
X-Original-To Andrew Morton <akpm@linux-foundation.org>, Mel Gorman <mgorman@techsingularity.net>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=up08diILDeTuRIk8GqShbXk9baub05Xd3BYongeYCX8=; b=An/ZFsc8jhpFRFPD8woOjq8ZnUMa51tg6DTrFkvuJPeWlc608c0WsuAzjeKLmgbnnO 87J5whUJ6kxHt2FNBicI9ELEzQaMfY46PerRybLs3zgpLWtAfpirnK9UWRJO0xJ1ma5l 7wfJ7NZOycxDmWH6Cll1JXQ2BlJwpt1nOmmRvQdCaWG+7exiAATtj5f9ury2A+AdbqSU fXdG0ukSrAuzqip8z6cUAVOa+xKpJFxVsvEkT5rYpfsOf047UITR8b8aKWfCMqJ4MqcD 5j+godfRjyDB/EfYhIxcDPJOHkehLs/hoFtTHhwRyx2J64pkWEIu0wYsDQVVjCjV+XNv OesQ==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=up08diILDeTuRIk8GqShbXk9baub05Xd3BYongeYCX8=; b=MdMgx8DipxbWlhuJs+QKmgyF3FfVu0GCIjQmKjcZRBULodTbg0Jl6OElEfulxWzEPq f6xb0oLENAfmuXEdKO8GQV6bTwaXjmZ9u57rSgDD1OlSr/9nN4QvDDY8Oa4E2hggr5T1 2Hbweb0jqyQDd9Amyz/xRUGglGp92dslAjcjTqHxvA82h9Vvh3lKdKOHDRgCps0ARI3s DCqfgXjZiHka0Y2r7DL3Ysl36XvuN0NyMKfTRlA2gPSxqjIMLyyQwBWjmAsx49wY71uP 07HUHDqKsU92lUoQcsm+EVkyQYh4bzeiM+YiLSTQs30Aje8eRIMkQ09IajtbNz3mc6cN F+aw==
X-Gm-Message-State ALyK8tKLkabCmkAd9SiRCZS+b9v0NiSh/f1pKIHBkZYjwk0jK4sQIJVlp/sLBudRm7JzqbkpFHQzDfF22XyuHA==
X-Received by 10.36.222.137 with SMTP id d131mr8334079itg.4.1464940642611; Fri, 03 Jun 2016 00:57:22 -0700 (PDT)
MIME-Version 1.0
X-Google-Sender-Auth kcPcvXBDSgQoKFvAws65UueukuU
Content-Type text/plain; charset=UTF-8
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 117
Organization linux.* mail to news gateway
X-Original-Cc Vlastimil Babka <vbabka@suse.cz>, Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, Linux MM <linux-mm@kvack.org>, linux-m68k <linux-m68k@vger.kernel.org>
X-Original-Date Fri, 3 Jun 2016 09:57:22 +0200
X-Original-Message-ID <CAMuHMdX07bUE+3QTbFmbxrjkXPBzFLoLQbupL=WAbLXTuN+6Ww@mail.gmail.com>
X-Original-References <CAMuHMdV00vJJxoA7XABw+mFF+2QUd1MuQbPKKgkmGnK_NySZpg@mail.gmail.com> <20160530155644.GP2527@techsingularity.net> <574E05B8.3060009@suse.cz> <20160601091921.GT2527@techsingularity.net> <574EB274.4030408@suse.cz> <20160602103936.GU2527@techsingularity.net> <0eb1f112-65d4-f2e5-911e-697b21324b9f@suse.cz> <20160602121936.GV2527@techsingularity.net> <20160602114341.e3b974640fc3f8cbcb54898b@linux-foundation.org>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1412881

Show key headers only | View raw


Hi Andrew, Mel,

On Thu, Jun 2, 2016 at 8:43 PM, Andrew Morton <akpm@linux-foundation.org> wrote:
> On Thu, 2 Jun 2016 13:19:36 +0100 Mel Gorman <mgorman@techsingularity.net> wrote:
>> > >Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
>> >
>> > Acked-by: Vlastimil Babka <vbabka@suse.cz>
>> >
>>
>> Thanks.
>
> I queued this.  A tested-by:Geert would be nice?
>
>
> From: Mel Gorman <mgorman@techsingularity.net>
> Subject: mm, page_alloc: recalculate the preferred zoneref if the context can ignore memory policies
>
> The optimistic fast path may use cpuset_current_mems_allowed instead of of
> a NULL nodemask supplied by the caller for cpuset allocations.  The
> preferred zone is calculated on this basis for statistic purposes and as a
> starting point in the zonelist iterator.
>
> However, if the context can ignore memory policies due to being atomic or
> being able to ignore watermarks then the starting point in the zonelist
> iterator is no longer correct.  This patch resets the zonelist iterator in
> the allocator slowpath if the context can ignore memory policies.  This
> will alter the zone used for statistics but only after it is known that it
> makes sense for that context.  Resetting it before entering the slowpath
> would potentially allow an ALLOC_CPUSET allocation to be accounted for
> against the wrong zone.  Note that while nodemask is not explicitly set to
> the original nodemask, it would only have been overwritten if
> cpuset_enabled() and it was reset before the slowpath was entered.
>
> Link: http://lkml.kernel.org/r/20160602103936.GU2527@techsingularity.net
> Fixes: c33d6c06f60f710 ("mm, page_alloc: avoid looking up the first zone in a zonelist twice")

My understanding was that this was an an additional patch, not fixing
the problem in-se?

Indeed, after applying this patch (without the other one that added
"z = ac->preferred_zoneref;" to the reset_fair block of
get_page_from_freelist()) I still get crashes...

Now testing with both applied...

> Signed-off-by: Mel Gorman <mgorman@techsingularity.net>
> Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
> Acked-by: Vlastimil Babka <vbabka@suse.cz>
> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> ---
>
>  mm/page_alloc.c |   23 ++++++++++++++++-------
>  1 file changed, 16 insertions(+), 7 deletions(-)
>
> diff -puN mm/page_alloc.c~mm-page_alloc-recalculate-the-preferred-zoneref-if-the-context-can-ignore-memory-policies mm/page_alloc.c
> --- a/mm/page_alloc.c~mm-page_alloc-recalculate-the-preferred-zoneref-if-the-context-can-ignore-memory-policies
> +++ a/mm/page_alloc.c
> @@ -3604,6 +3604,17 @@ retry:
>          */
>         alloc_flags = gfp_to_alloc_flags(gfp_mask);
>
> +       /*
> +        * Reset the zonelist iterators if memory policies can be ignored.
> +        * These allocations are high priority and system rather than user
> +        * orientated.
> +        */
> +       if ((alloc_flags & ALLOC_NO_WATERMARKS) || !(alloc_flags & ALLOC_CPUSET)) {
> +               ac->zonelist = node_zonelist(numa_node_id(), gfp_mask);
> +               ac->preferred_zoneref = first_zones_zonelist(ac->zonelist,
> +                                       ac->high_zoneidx, ac->nodemask);
> +       }
> +
>         /* This is the last chance, in general, before the goto nopage. */
>         page = get_page_from_freelist(gfp_mask, order,
>                                 alloc_flags & ~ALLOC_NO_WATERMARKS, ac);
> @@ -3612,12 +3623,6 @@ retry:
>
>         /* Allocate without watermarks if the context allows */
>         if (alloc_flags & ALLOC_NO_WATERMARKS) {
> -               /*
> -                * Ignore mempolicies if ALLOC_NO_WATERMARKS on the grounds
> -                * the allocation is high priority and these type of
> -                * allocations are system rather than user orientated
> -                */
> -               ac->zonelist = node_zonelist(numa_node_id(), gfp_mask);
>                 page = get_page_from_freelist(gfp_mask, order,
>                                                 ALLOC_NO_WATERMARKS, ac);
>                 if (page)
> @@ -3816,7 +3821,11 @@ retry_cpuset:
>         /* Dirty zone balancing only done in the fast path */
>         ac.spread_dirty_pages = (gfp_mask & __GFP_WRITE);
>
> -       /* The preferred zone is used for statistics later */
> +       /*
> +        * The preferred zone is used for statistics but crucially it is
> +        * also used as the starting point for the zonelist iterator. It
> +        * may get reset for allocations that ignore memory policies.
> +        */
>         ac.preferred_zoneref = first_zones_zonelist(ac.zonelist,
>                                         ac.high_zoneidx, ac.nodemask);
>         if (!ac.preferred_zoneref) {
> _
>



-- 
Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 (was: Re: mm,  page_alloc: avoid looking up the first zone in a zonelist twice) Vlastimil Babka <vbabka@suse.cz> - 2016-05-31 23:50 +0200
  Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 (was: Re: mm,  page_alloc: avoid looking up the first zone in a zonelist twice) Mel Gorman <mgorman@techsingularity.net> - 2016-06-01 11:20 +0200
    Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Vlastimil Babka <vbabka@suse.cz> - 2016-06-01 12:10 +0200
      Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Mel Gorman <mgorman@techsingularity.net> - 2016-06-02 12:40 +0200
        Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Vlastimil Babka <vbabka@suse.cz> - 2016-06-02 14:10 +0200
          Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Mel Gorman <mgorman@techsingularity.net> - 2016-06-02 14:20 +0200
            Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Andrew Morton <akpm@linux-foundation.org> - 2016-06-02 20:50 +0200
              Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Stephen Rothwell <sfr@canb.auug.org.au> - 2016-06-03 06:00 +0200
              Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-03 10:00 +0200
                Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Mel Gorman <mgorman@techsingularity.net> - 2016-06-03 10:50 +0200
                Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Geert Uytterhoeven <geert@linux-m68k.org> - 2016-06-03 11:10 +0200
                Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Andrew Morton <akpm@linux-foundation.org> - 2016-06-03 18:40 +0200
                Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Mel Gorman <mgorman@techsingularity.net> - 2016-06-03 18:50 +0200
                Re: BUG: scheduling while atomic: cron/668/0x10c9a0c0 Andrew Morton <akpm@linux-foundation.org> - 2016-06-03 19:00 +0200

csiph-web