Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp940989iog; Wed, 15 Jun 2022 16:16:01 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t7dbFoFy3eldse0jerheJg/hqThJUlmNgztl8NUN4TmG+81kJo4wyTjomFJMherMxtj44J X-Received: by 2002:a17:902:edd7:b0:168:b0b2:f0a3 with SMTP id q23-20020a170902edd700b00168b0b2f0a3mr1955755plk.20.1655334961332; Wed, 15 Jun 2022 16:16:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655334961; cv=none; d=google.com; s=arc-20160816; b=mNm+vUvsEvpQB7kzyEJtt7l39cEk41PfjLODpn82BZjT2whtrSEYU9/jWUMoZm42Ig K8EBii7CsZmRLrkREYhL15dUz08qFnXMaNpy+XLcjwLXnleT6WkID5UU8X2Jhs6xaEa1 0DKqSJNrtjDmZ622HIE03i5++2eGdNjdPmxeg0VRYBipF7IZcNtt4rRyBO02I4eaR00E zRvKPqAFrH5kOajQYTUxydIW77IcyNUjJkv8F8FXsRjE9EFdfJuUjI8V0CY1FH+18npT 7HCt0fAxokdlUZjMwbprknH+g+OsbI2XLaghS1M0QreE1k+GlUQCTiCano9q8UgPUtq+ ggcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=/6ozg5jX+wE2YfQoAzFqSw9DecXWOdKt9Ka3gEneBxg=; b=0e+gNxbXs8rlGcniiUahCvUumNcutBPFwQRG2vf1bIWE8Te8syOoQ+ca0Lq0fKsBVz be4E9tMoJE/PioEUTQVGcpnWQehthbifmmIndidrWkwYbaRZGYszGp7qrOaZECqrTQHX kWqd9By5kWPF34LCNbpkUP7Fi26hYPxSTEXsFJGs4NcETNCbvWaUtdVfXRSgJ3Q7fvd4 aCVgELj+hLseuA1/ok89y4v0qXJOIo689a4MINASdbA7is81QkaoZlDQSSXJuf9zCdq9 7uqXQF0JjXd5HwxFiAno687wgriBJqbTVpUrwvJbvsndliaxH5snX/hhY8lNr50ytC1I XDSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=mr3Sz0Zz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t6-20020a17090ae50600b001e34551c962si378427pjy.80.2022.06.15.16.15.49; Wed, 15 Jun 2022 16:16:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=mr3Sz0Zz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344915AbiFOXEv (ORCPT + 99 others); Wed, 15 Jun 2022 19:04:51 -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 X-Spam-Status: No, score=-8.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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.