lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Tue, 21 Jun 2022 10:21:16 +0100
From:   Mel Gorman <mgorman@...hsingularity.net>
To:     Andrew Morton <akpm@...ux-foundation.org>
Cc:     Marek Szyprowski <m.szyprowski@...sung.com>,
        Yu Zhao <yuzhao@...gle.com>,
        Nicolas Saenz Julienne <nsaenzju@...hat.com>,
        Marcelo Tosatti <mtosatti@...hat.com>,
        Vlastimil Babka <vbabka@...e.cz>,
        Michal Hocko <mhocko@...nel.org>,
        Hugh Dickins <hughd@...gle.com>,
        LKML <linux-kernel@...r.kernel.org>,
        Linux-MM <linux-mm@...ck.org>
Subject: Re: [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@...sung.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ