lkml.org 
[lkml]   [2022]   [Jun]   [21]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock
On Wed, Jun 15, 2022 at 04:04:46PM -0700, Andrew Morton wrote:
> On Thu, 16 Jun 2022 00:48:55 +0200 Marek Szyprowski <m.szyprowski@samsung.com> wrote:
>
> > In the logs I see lots of errors like:
> >
> > BUG: sleeping function called from invalid context at
> > ./include/linux/sched/mm.h:274
> >
> > BUG: scheduling while atomic: systemd-udevd/288/0x00000002
> >
> > BUG: sleeping function called from invalid context at mm/filemap.c:2647
> >
> > however there are also a fatal ones like:
> >
> > Unable to handle kernel paging request at virtual address 00000000017a87b4
> >
> >
> > The issues seems to be a bit random. Looks like memory trashing.
> > Reverting $subject on top of current linux-next fixes all those issues.
> >
> >
>
> This?
>
> --- a/mm/page_alloc.c~mm-page_alloc-replace-local_lock-with-normal-spinlock-fix
> +++ a/mm/page_alloc.c
> @@ -183,8 +183,10 @@ static DEFINE_MUTEX(pcp_batch_high_lock)
> type *_ret; \
> pcpu_task_pin(); \
> _ret = this_cpu_ptr(ptr); \
> - if (!spin_trylock_irqsave(&_ret->member, flags)) \
> + if (!spin_trylock_irqsave(&_ret->member, flags)) { \
> + pcpu_task_unpin(); \
> _ret = NULL; \
> + } \
> _ret; \
> })
>

This is the correct fix. I *had* a fix for this but in a patch that was
not posted that drops irqsave :(

--
Mel Gorman
SUSE Labs

\
 
 \ /
  Last update: 2022-06-21 11:22    [W:0.146 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site