Received: by 2002:ad5:4acb:0:0:0:0:0 with SMTP id n11csp2262052imw; Wed, 6 Jul 2022 02:57:29 -0700 (PDT) X-Google-Smtp-Source: AGRyM1s+HDdYAEFox7dIj1eKZjUY6rLnKDA2aPkLeIF6zL5PFwF4hELZxkLem1+2BkUDgFMzJOIY X-Received: by 2002:a05:6a00:804:b0:528:bafb:ec91 with SMTP id m4-20020a056a00080400b00528bafbec91mr2361675pfk.57.1657101448870; Wed, 06 Jul 2022 02:57:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1657101448; cv=none; d=google.com; s=arc-20160816; b=ru+e2GxLZMwVSKSy8X52C8E9L6WZmoWYhL2mvj3I6FfzzffJ9BiA/GcIZsAOXi/l8e wbn1oCJKPu5irxfnXa5cHEofaZfV0hNKgrhvrv+vWU+7mtsHNEvzTCKsU/GcxOVccdBU fFXusqwI2wJyGiOM8dR/LmNzimLE1xkv6mQppUdEuh3SxqZxw0Y22egem+SWAkc6Mmw4 ZkU45RZkngLdlAS30VqWcRbDiSG6R6ujVkikPZR2MAibkCBXoBG81e4QFNkujRV56VDN 25eYB49YgTXy4GwPpVfMpl5Y56GRu/U4q3R7cbk4UqQTbGl4dKkuCSmFhNqK4164bwmo iigg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=pS50gD/9iwYY9N8MTFdA23ODvNCk4vkyKCmBj5bPpKA=; b=Brv58owtxdVEMhPMQ4XSD9v9zz2iyxzqlTaiHreC2M137pFvzFlXDSZc0djrSp2Zpf /o/Kks5CwECuzMSuYEwVqLra5sYAwyqJ8ThUumHhP04eGwM7lBhz7BJ6jSWy1YCS3h/T n+9jBWDiKxUmNo+aGkrKCP0gWrOxG7lNRZiyTtHCu15lOB/ohmBohyU7aF1gi/fPNhkl nfs4wZTA3ye85CAaq1oTD51vuQ3jRbo6w+pqm0OzZ2MguUqC446ctQcN+kwCymqQQtOY gQgyWEYJ72k1XCiw/iM8jwCcgM3RdeMzWbJJzcBzANC6/XSxcKwcEteweOCkhgsvVbDI unEA== ARC-Authentication-Results: i=1; mx.google.com; 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 o11-20020a65458b000000b0040cf043ed35si33076474pgq.814.2022.07.06.02.57.16; Wed, 06 Jul 2022 02:57:28 -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; 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 S232733AbiGFJ4j (ORCPT + 99 others); Wed, 6 Jul 2022 05:56:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232644AbiGFJ4Q (ORCPT ); Wed, 6 Jul 2022 05:56:16 -0400 Received: from outbound-smtp40.blacknight.com (outbound-smtp40.blacknight.com [46.22.139.223]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5A964252A8 for ; Wed, 6 Jul 2022 02:55:38 -0700 (PDT) Received: from mail.blacknight.com (pemlinmail04.blacknight.ie [81.17.254.17]) by outbound-smtp40.blacknight.com (Postfix) with ESMTPS id D4D111C3C34 for ; Wed, 6 Jul 2022 10:55:36 +0100 (IST) Received: (qmail 18395 invoked from network); 6 Jul 2022 09:55:36 -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); 6 Jul 2022 09:55:36 -0000 Date: Wed, 6 Jul 2022 10:55:35 +0100 From: Mel Gorman To: Oliver Sang Cc: Andrew Morton , 0day robot , LKML , linux-mm@kvack.org, lkp@lists.01.org, Nicolas Saenz Julienne , Marcelo Tosatti , Vlastimil Babka , Michal Hocko , Hugh Dickins Subject: Re: [mm/page_alloc] 2bd8eec68f: BUG:sleeping_function_called_from_invalid_context_at_mm/gup.c Message-ID: <20220706095535.GD27531@techsingularity.net> References: <20220613125622.18628-8-mgorman@techsingularity.net> <20220703132209.875b823d1cb7169a8d51d56d@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,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 Tue, Jul 05, 2022 at 09:51:25PM +0800, Oliver Sang wrote: > Hi Andrew Morton, > > On Sun, Jul 03, 2022 at 01:22:09PM -0700, Andrew Morton wrote: > > On Sun, 3 Jul 2022 17:44:30 +0800 kernel test robot wrote: > > > > > FYI, we noticed the following commit (built with gcc-11): > > > > > > commit: 2bd8eec68f740608db5ea58ecff06965228764cb ("[PATCH 7/7] mm/page_alloc: Replace local_lock with normal spinlock") > > > url: https://github.com/intel-lab-lkp/linux/commits/Mel-Gorman/Drain-remote-per-cpu-directly/20220613-230139 > > > base: https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git b13baccc3850ca8b8cccbf8ed9912dbaa0fdf7f3 > > > patch link: https://lore.kernel.org/lkml/20220613125622.18628-8-mgorman@techsingularity.net > > > > > > > Did this test include the followup patch > > mm-page_alloc-replace-local_lock-with-normal-spinlock-fix.patch? > > no, we just fetched original patch set and test upon it. > > now we applied the patch you pointed to us upon 2bd8eec68f and found the issue > still exist. > (attached dmesg FYI) > Thanks Oliver. The trace is odd in that it hits in GUP when the page allocator is no longer active and the context is a syscall. First, is this definitely the first patch the problem occurs? Second, it's possible for IRQs to be enabled and an IRQ delivered before preemption is enabled. It's not clear why that would be a problem other than lacking symmetry or how it could result in the reported BUG but might as well rule it out. This is build tested only diff --git a/mm/page_alloc.c b/mm/page_alloc.c index 934d1b5a5449..d0141e51e613 100644 --- a/mm/page_alloc.c +++ b/mm/page_alloc.c @@ -192,14 +192,14 @@ static DEFINE_MUTEX(pcp_batch_high_lock); #define pcpu_spin_unlock(member, ptr) \ ({ \ - spin_unlock(&ptr->member); \ pcpu_task_unpin(); \ + spin_unlock(&ptr->member); \ }) #define pcpu_spin_unlock_irqrestore(member, ptr, flags) \ ({ \ - spin_unlock_irqrestore(&ptr->member, flags); \ pcpu_task_unpin(); \ + spin_unlock_irqrestore(&ptr->member, flags); \ }) /* struct per_cpu_pages specific helpers. */