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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A6C40CCA473 for ; Wed, 15 Jun 2022 23:04:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1343803AbiFOXEw (ORCPT ); Wed, 15 Jun 2022 19:04:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50604 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238604AbiFOXEt (ORCPT ); Wed, 15 Jun 2022 19:04:49 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E8E5F2497B for ; Wed, 15 Jun 2022 16:04:48 -0700 (PDT) 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 dfw.source.kernel.org (Postfix) with ESMTPS id 36BEA61946 for ; 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.