From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id CA873C43334 for ; Tue, 21 Jun 2022 09:21:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3378A6B0072; Tue, 21 Jun 2022 05:21:21 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2E83C6B0073; Tue, 21 Jun 2022 05:21:21 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1D7026B0074; Tue, 21 Jun 2022 05:21:21 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 0EC886B0072 for ; Tue, 21 Jun 2022 05:21:21 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id CA88D4A8 for ; Tue, 21 Jun 2022 09:21:20 +0000 (UTC) X-FDA: 79601699520.06.1B47A2C Received: from outbound-smtp01.blacknight.com (outbound-smtp01.blacknight.com [81.17.249.7]) by imf18.hostedemail.com (Postfix) with ESMTP id 2500D1C000E for ; Tue, 21 Jun 2022 09:21:20 +0000 (UTC) Received: from mail.blacknight.com (pemlinmail05.blacknight.ie [81.17.254.26]) by outbound-smtp01.blacknight.com (Postfix) with ESMTPS id B408450037 for ; Tue, 21 Jun 2022 10:21:18 +0100 (IST) Received: (qmail 19133 invoked from network); 21 Jun 2022 09:21:18 -0000 Received: from unknown (HELO techsingularity.net) (mgorman@techsingularity.net@[84.203.198.246]) by 81.17.254.9 with ESMTPSA (AES256-SHA encrypted, authenticated); 21 Jun 2022 09:21:18 -0000 Date: Tue, 21 Jun 2022 10:21:16 +0100 From: Mel Gorman To: Andrew Morton Cc: Marek Szyprowski , Yu Zhao , Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , Hugh Dickins , LKML , Linux-MM Subject: Re: [PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock Message-ID: <20220621092116.GC15453@techsingularity.net> References: <20220613125622.18628-1-mgorman@techsingularity.net> <20220613125622.18628-8-mgorman@techsingularity.net> <20220615160446.be1f75fd256d67e57b27a9fc@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20220615160446.be1f75fd256d67e57b27a9fc@linux-foundation.org> User-Agent: Mutt/1.10.1 (2018-07-13) ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655803280; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=PUH52Z4onm5Tkw4f6oop1GRWD2PpqMFZxqzHdO+bULs=; b=QVqnihwjV0LLWVvamusoGE3wJIAJwmKIqz9v2/wTOGY+s+Xhg9v0pOlm246UOSaq8cbKHf K5oj006pcQGPk1vFBWqU/3XPK9+GZYUytVzQAUDZkA0RHgyHrgUl8r1Pxey6/CF6jc6iaa 7ltTo4iN2W6lGQUNXV/fhGlIWBpdzEY= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655803280; a=rsa-sha256; cv=none; b=unXk8UfhCK6o0W+W+VIbP8WpnqnHcMn/KZZUlmf3RnmwvPZYLBZNNbsqta6anLXav//iYM R4iB+w8XNNefISVwDUsMgD/EOrxYkrkDgYWU8d97vhB0gpmAXjT7/1uqzC3BCig0lIc7b+ QRgGRzr2Vf1IgfKUB4xmcXg9//OOlkA= ARC-Authentication-Results: i=1; imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.7 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net Authentication-Results: imf18.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf18.hostedemail.com: domain of mgorman@techsingularity.net designates 81.17.249.7 as permitted sender) smtp.mailfrom=mgorman@techsingularity.net X-Rspamd-Server: rspam12 X-Rspam-User: X-Stat-Signature: cxrhpwbbp1sydguzw1qipuu9r537k6q3 X-Rspamd-Queue-Id: 2500D1C000E X-HE-Tag: 1655803280-351152 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Wed, Jun 15, 2022 at 04:04:46PM -0700, Andrew Morton wrote: > On Thu, 16 Jun 2022 00:48:55 +0200 Marek Szyprowski 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