[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <Z/aDckdBFPfg2h/P@li-008a6a4c-3549-11b2-a85c-c5cc2836eea2.ibm.com>
Date: Wed, 9 Apr 2025 16:25:54 +0200
From: Alexander Gordeev <agordeev@...ux.ibm.com>
To: Andrey Ryabinin <ryabinin.a.a@...il.com>
Cc: Andrew Morton <akpm@...ux-foundation.org>, Hugh Dickins <hughd@...gle.com>,
Nicholas Piggin <npiggin@...il.com>,
Guenter Roeck <linux@...ck-us.net>, Juergen Gross <jgross@...e.com>,
Jeremy Fitzhardinge <jeremy@...p.org>, linux-kernel@...r.kernel.org,
linux-mm@...ck.org, kasan-dev@...glegroups.com,
sparclinux@...r.kernel.org, xen-devel@...ts.xenproject.org,
linuxppc-dev@...ts.ozlabs.org, linux-s390@...r.kernel.org,
stable@...r.kernel.org
Subject: Re: [PATCH v2 1/3] kasan: Avoid sleepable page allocation from
atomic context
On Wed, Apr 09, 2025 at 04:10:58PM +0200, Andrey Ryabinin wrote:
Hi Andrey,
> > @@ -301,7 +301,7 @@ static int kasan_populate_vmalloc_pte(pte_t *ptep, unsigned long addr,
> > if (likely(!pte_none(ptep_get(ptep))))
> > return 0;
> >
> > - page = __get_free_page(GFP_KERNEL);
> > + page = __get_free_page(GFP_ATOMIC);
> > if (!page)
> > return -ENOMEM;
> >
>
> I think a better way to fix this would be moving out allocation from atomic context. Allocate page prior
> to apply_to_page_range() call and pass it down to kasan_populate_vmalloc_pte().
I think the page address could be passed as the parameter to kasan_populate_vmalloc_pte().
> Whenever kasan_populate_vmalloc_pte() will require additional page we could bail out with -EAGAIN,
> and allocate another one.
When would it be needed? kasan_populate_vmalloc_pte() handles just one page.
Thanks!
Powered by blists - more mailing lists