All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexander Potapenko <glider@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "Huang, Ying" <ying.huang@intel.com>,
	Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>,
	 syzbot <syzbot+ece2915262061d6e0ac1@syzkaller.appspotmail.com>,
	 syzkaller-bugs@googlegroups.com,
	Mel Gorman <mgorman@techsingularity.net>,
	 Vlastimil Babka <vbabka@suse.cz>,
	Andrey Konovalov <andreyknvl@gmail.com>,
	 Dmitry Vyukov <dvyukov@google.com>,
	Andrey Ryabinin <ryabinin.a.a@gmail.com>,
	 Vincenzo Frascino <vincenzo.frascino@arm.com>,
	Marco Elver <elver@google.com>,
	 kasan-dev <kasan-dev@googlegroups.com>,
	linux-mm <linux-mm@kvack.org>
Subject: Re: [PATCH] kasan,kmsan: remove __GFP_KSWAPD_RECLAIM usage from kasan/kmsan
Date: Wed, 21 Jun 2023 17:37:09 +0200	[thread overview]
Message-ID: <CAG_fn=W5-+3Xz2LcJW=kbbV+91U8W5MLfAFtR+eNLYXG0v=zKQ@mail.gmail.com> (raw)
In-Reply-To: <20230609153124.11905393c03660369f4f5997@linux-foundation.org>

On Sat, Jun 10, 2023 at 12:31 AM Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> On Wed, 31 May 2023 15:31:53 +0200 Alexander Potapenko <glider@google.com> wrote:
>
> > On Mon, May 29, 2023 at 3:08 AM Huang, Ying <ying.huang@intel.com> wrote:
> > >
> > > ? Handa <penguin-kernel@I-love.SAKURA.ne.jp> writes:
> > >
> > > > syzbot is reporting lockdep warning in __stack_depot_save(), for
> > > > the caller of __stack_depot_save() (i.e. __kasan_record_aux_stack() in
> > > > this report) is responsible for masking __GFP_KSWAPD_RECLAIM flag in
> > > > order not to wake kswapd which in turn wakes kcompactd.
> > > >
> > > > Since kasan/kmsan functions might be called with arbitrary locks held,
> > > > mask __GFP_KSWAPD_RECLAIM flag from all GFP_NOWAIT/GFP_ATOMIC allocations
> > > > in kasan/kmsan.
> > > >
> > > > Note that kmsan_save_stack_with_flags() is changed to mask both
> > > > __GFP_DIRECT_RECLAIM flag and __GFP_KSWAPD_RECLAIM flag, for
> > > > wakeup_kswapd() from wake_all_kswapds() from __alloc_pages_slowpath()
> > > > calls wakeup_kcompactd() if __GFP_KSWAPD_RECLAIM flag is set and
> > > > __GFP_DIRECT_RECLAIM flag is not set.
> > > >
> > > > Reported-by: syzbot <syzbot+ece2915262061d6e0ac1@syzkaller.appspotmail.com>
> > > > Closes: https://syzkaller.appspot.com/bug?extid=ece2915262061d6e0ac1
> > > > Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
> > >
> > > This looks good to me.  Thanks!
> > >
> > > Reviewed-by: "Huang, Ying" <ying.huang@intel.com>
> >
> > Sorry for the late reply, but maybe it would be better to mask this
> > flag in __stack_depot_save() (lib/stackdepot.c) instead?
> > We are already masking out a number of flags there, and the problem
> > seems quite generic.
>
>
> Tetsuo?

Reviewed-by: Alexander Potapenko <glider@google.com>

Andrew, please accept this patch. As noted in the other thread, no
changes to stackdepot are needed.

-- 
Alexander Potapenko
Software Engineer

Google Germany GmbH
Erika-Mann-Straße, 33
80636 München

Geschäftsführer: Paul Manicle, Liana Sebastian
Registergericht und -nummer: Hamburg, HRB 86891
Sitz der Gesellschaft: Hamburg


  parent reply	other threads:[~2023-06-21 15:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-20  8:26 [syzbot] [kernel?] possible deadlock in scheduler_tick (2) syzbot
2023-05-20 11:02 ` Tetsuo Handa
2023-05-20 11:33   ` [PATCH] lib/stackdepot: stackdepot: don't use __GFP_KSWAPD_RECLAIM from __stack_depot_save() if atomic context Tetsuo Handa
2023-05-20 13:14     ` Tetsuo Handa
2023-05-20 22:44       ` Tetsuo Handa
2023-05-22  2:13         ` Huang, Ying
2023-05-22  2:47           ` Tetsuo Handa
2023-05-22  3:07             ` Huang, Ying
2023-05-22 11:33               ` Tetsuo Handa
2023-05-23  0:07                 ` Huang, Ying
2023-05-23  0:45                   ` Tetsuo Handa
2023-05-23  1:10                     ` Huang, Ying
2023-05-24 12:09             ` Michal Hocko
2023-05-27 15:25     ` [PATCH] kasan,kmsan: remove __GFP_KSWAPD_RECLAIM usage from kasan/kmsan Tetsuo Handa
2023-05-29  1:07       ` Huang, Ying
2023-05-31 13:31         ` Alexander Potapenko
2023-06-09 22:31           ` Andrew Morton
     [not found]             ` <19d6c965-a9cf-16a5-6537-a02823d67c0a@I-love.SAKURA.ne.jp>
2023-06-12  1:30               ` [PATCH v3] lib/stackdepot: fix gfp flags manipulation in __stack_depot_save() Huang, Ying
2023-06-21 12:56               ` Alexander Potapenko
2023-06-21 14:07                 ` Tetsuo Handa
2023-06-21 14:42                   ` Alexander Potapenko
2023-06-21 14:54                     ` Tetsuo Handa
2023-06-21 15:37             ` Alexander Potapenko [this message]
2023-05-27 21:01 ` [syzbot] [ntfs3?] possible deadlock in scheduler_tick (2) syzbot

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='CAG_fn=W5-+3Xz2LcJW=kbbV+91U8W5MLfAFtR+eNLYXG0v=zKQ@mail.gmail.com' \
    --to=glider@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=andreyknvl@gmail.com \
    --cc=dvyukov@google.com \
    --cc=elver@google.com \
    --cc=kasan-dev@googlegroups.com \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=ryabinin.a.a@gmail.com \
    --cc=syzbot+ece2915262061d6e0ac1@syzkaller.appspotmail.com \
    --cc=syzkaller-bugs@googlegroups.com \
    --cc=vbabka@suse.cz \
    --cc=vincenzo.frascino@arm.com \
    --cc=ying.huang@intel.com \
    /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.