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 764A7C433EF for ; Wed, 15 Jun 2022 23:04:52 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D4B726B0071; Wed, 15 Jun 2022 19:04:51 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id CFA426B0072; Wed, 15 Jun 2022 19:04:51 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B9BAE6B0074; Wed, 15 Jun 2022 19:04:51 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id A72706B0071 for ; Wed, 15 Jun 2022 19:04:51 -0400 (EDT) Received: from smtpin23.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 7A11C11D8 for ; Wed, 15 Jun 2022 23:04:51 +0000 (UTC) X-FDA: 79582001982.23.EABC81D Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf22.hostedemail.com (Postfix) with ESMTP id F3384C00A3 for ; Wed, 15 Jun 2022 23:04:50 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id EFC9CB821A6; Wed, 15 Jun 2022 23:04:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 32B04C3411A; Wed, 15 Jun 2022 23:04:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1655334287; bh=NBWqMBdjUVKz+Ds4bsB0MdOwkR+I5F9aFtUm/9YqTLI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=mr3Sz0ZzyOLpWYyTHQCRVgagCRsFMv3ptOdTtUstikuhnDCWGslvviwlBIHDF9tZe TwvgB3lTazuFL44KNId2LrkgHyZKY4yM2NXGOyPx9SxcwPVjfXvEMQp84N9jQfpTeH G4tzzSjjxKo9ACt0KnumE9mZDwZc84gqU91nHCBI= Date: Wed, 15 Jun 2022 16:04:46 -0700 From: Andrew Morton To: Marek Szyprowski , Yu Zhao Cc: Mel Gorman , 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: <20220615160446.be1f75fd256d67e57b27a9fc@linux-foundation.org> In-Reply-To: References: <20220613125622.18628-1-mgorman@techsingularity.net> <20220613125622.18628-8-mgorman@techsingularity.net> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1655334291; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/6ozg5jX+wE2YfQoAzFqSw9DecXWOdKt9Ka3gEneBxg=; b=8fmlGUJ49XzhvVVnkUz4WcIkJbUHJ1ITl0YGlMELrrlB/dea8ClF8KHUopG31jFsojV0WE PWZzB55DsvH2IFd+qOniRYriRp/YHiW/+X0lMHuI16aTEWvvaLu/XgJUmADLypqFRBxS5n 9fVuwN3pD7kRP9lK1gLNgxjk637NdJQ= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1655334291; a=rsa-sha256; cv=none; b=46DTa86hEDnsJeUvnFJiWVLFkdQ8Nf5lOaiSmNXi+a8KR75XyEJIPfXnB+aqwlpblLQneV +gZXPQzw62sXlJUYZAREVQ6B3PTktj5WkJ6ylPqHxj555yD2hBVSGxXqGfaT9EExFHL2/x +Qp6f2mFQAtJsIjcnQbeHLaqcczDImI= ARC-Authentication-Results: i=1; imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=mr3Sz0Zz; dmarc=none; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=mr3Sz0Zz; dmarc=none; spf=pass (imf22.hostedemail.com: domain of akpm@linux-foundation.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-Rspamd-Server: rspam12 X-Rspam-User: X-Stat-Signature: 5onba8waea4hj1szux931y34u5kuaw8f X-Rspamd-Queue-Id: F3384C00A3 X-HE-Tag: 1655334290-539568 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 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; \ }) I'll drop Mel's patch for next -next.