Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp1634669rwb; Mon, 7 Nov 2022 04:08:20 -0800 (PST) X-Google-Smtp-Source: AMsMyM7xh6cqRYR3HmRbJu35Vp1oEVuxAPlDZwgztDQ2QQCGQ7fGGSIftgzuSXT6oD3dZEyZ6MgB X-Received: by 2002:a05:6402:5296:b0:461:b6e5:ea63 with SMTP id en22-20020a056402529600b00461b6e5ea63mr49605723edb.248.1667822900005; Mon, 07 Nov 2022 04:08:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667822900; cv=none; d=google.com; s=arc-20160816; b=Uy3wyZW8/EBaigKLxiIPKi3UpD4u2YYZtVVy38ibBCOCLPC/7lst0C3uL/CDqEOiBj g8z2bKH0a+5s9sGcnuhHVtowOelU9jl24Woih8c4pk78VHRg/dAoXSZ/oa7vHRpj1q5d iPbuOqfik7Iu9JbEfiRIe1wDZ+3O/9LJssd7PAHgLYeilLaI+pcCEAeSognfouTPLGlj Hmps8aGhigQVvFtZSxPG0Q6R0PXnXiMgcOlPQNqZfLx5DHOlUtwe29Y1N8jmHj2Qs+Ek 5U7CCNncx03rsx66Fp2oH9MkAzgqPwirNc4rFNIL7ew5vmi5UujGbbPizvIl4EI7SHbu mOwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=eFft468Y14iRbPn66NpGTaTxzNFjNZfsr6wR50dvfJU=; b=k/biU8WWFAZ0Yp1hTQvJEv6xOIQ+oGO1B2gO0u2+wb07loXwvqIpGluGBd87ugWhY+ mcuYHImutzO3HfTn29Up0j/RTzqH34NAVLw+jERTiUpitC6uK5my/qXa7xAdR2zXf1d7 WXq7sc88Mwwr/aREu77Fvk61Ng0EyWkiEJGPbracIjHZ/nnJJABiCAOW78ziemVTJbRX q2GDmh3U0NyJWwRS+W0lW630CXfjRt3/RSqPLLMhe0crwWaBaq5NDPMdSpwbYM/p+smK ilOZ0vgD1dEeuiQrDQFr8IJ/pt3WZ8F9+ZdpbZO+X5LNiZ/ofVMP6SCi/Hq4CSDBWmQA sO9A== 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 s4-20020a056402520400b00461d97e5287si10576580edd.344.2022.11.07.04.07.57; Mon, 07 Nov 2022 04:08:19 -0800 (PST) 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 S231888AbiKGLRB (ORCPT + 93 others); Mon, 7 Nov 2022 06:17:01 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231688AbiKGLQy (ORCPT ); Mon, 7 Nov 2022 06:16:54 -0500 Received: from outbound-smtp27.blacknight.com (outbound-smtp27.blacknight.com [81.17.249.195]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A5B0BC9C for ; Mon, 7 Nov 2022 03:16:52 -0800 (PST) Received: from mail.blacknight.com (pemlinmail01.blacknight.ie [81.17.254.10]) by outbound-smtp27.blacknight.com (Postfix) with ESMTPS id 0D8A7CAB8F for ; Mon, 7 Nov 2022 11:16:51 +0000 (GMT) Received: (qmail 22850 invoked from network); 7 Nov 2022 11:16:50 -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); 7 Nov 2022 11:16:50 -0000 Date: Mon, 7 Nov 2022 11:16:49 +0000 From: Mel Gorman To: Hugh Dickins Cc: Andrew Morton , Yu Zhao , Vlastimil Babka , Nicolas Saenz Julienne , Marcelo Tosatti , Michal Hocko , Marek Szyprowski , LKML , Linux-MM Subject: Re: [PATCH v2] mm/page_alloc: Leave IRQs enabled for per-cpu page allocations Message-ID: <20221107111649.rzfgqk3ebvicsuyw@techsingularity.net> References: <20221104142259.5hohev5hzvwanbi2@techsingularity.net> <97b7ae87-797c-4ebb-d2d3-9415975188@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <97b7ae87-797c-4ebb-d2d3-9415975188@google.com> X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS 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 Sun, Nov 06, 2022 at 08:42:32AM -0800, Hugh Dickins wrote: > On Fri, 4 Nov 2022, Mel Gorman wrote: > > > Changelog since v1 > > o Use trylock in free_unref_page_list due to IO completion from softirq > > context > > > > The pcp_spin_lock_irqsave protecting the PCP lists is IRQ-safe as a task > > allocating from the PCP must not re-enter the allocator from IRQ context. > > In each instance where IRQ-reentrancy is possible, the lock is acquired using > > pcp_spin_trylock_irqsave() even though IRQs are disabled and re-entrancy > > is impossible. > > > > Demote the lock to pcp_spin_lock avoids an IRQ disable/enable in the common > > case at the cost of some IRQ allocations taking a slower path. If the PCP > > lists need to be refilled, the zone lock still needs to disable IRQs but > > that will only happen on PCP refill and drain. If an IRQ is raised when > > a PCP allocation is in progress, the trylock will fail and fallback to > > using the buddy lists directly. Note that this may not be a universal win > > if an interrupt-intensive workload also allocates heavily from interrupt > > context and contends heavily on the zone->lock as a result. > > > > [yuzhao@google.com: Reported lockdep issue on IO completion from softirq] > > Signed-off-by: Mel Gorman > > Hi Mel, I think you Cc'ed me for the purpose of giving this patch a > run, and reporting if it's not good. That is the case, I'm afraid. > Thanks for testing and yes, you were cc'd in the hope you'd run it through a stress test of some sort. A lot of the test I run are performance orientated and relatively few target functional issues. > I first tried it on a v6.1-rc3, and very soon crashed under load with > something about PageBuddy in the output. When I reverted, no problem; > I thought maybe it's dependent on other commits in akpm's tree. > Can you tell me what sort of load it's under? I would like to add something similar to the general battery of tests I run all patches affecting the page allocator through. Even if this is just a crude shell script, it would be enough for me to work with and incorporate into mmtests. If it's there and I find mm-unstable has its own problems, bisection can brute force the problem. > Later I tried on current mm-unstable: which is living up to the name > in other ways, but when other issues patched, it soon crashed under > load, GPF probably for non-canonical address 0xdead0000000000f8 > in compact_zone < compact_zone_order < try_to_compact_pages < > .... < shmem_alloc_hugefolio < ... > 0xdead000* looks like ILLEGAL_POINTER_VALUE which is used as a poison value so a full list of debugging options you apply for the stress test would also be useful. > I do try to exercise compaction as hard as I can, even to the point > of having a hack in what used to be called shmem_getpage_gfp(), > reverting to the stronger attempt to get huge pages, before Rik > weakened the effect of huge=always with vma_thp_gfp_mask() in 5.12: > so shmem is probably applying stronger flags for compaction than it > would in your tree - I'm using > GFP_TRANSHUGE_LIGHT | __GFP_RECLAIM | __GFP_NORETRY there. > > Sorry for not giving you more info, I'm rather hoping that compaction > is relevant, and will give you a clue (maybe that capture code, which > surprised us once before??). While capture is a possibility, it's a bad fit for this patch because pages are captured under task context. > What I'm really trying to do is fix > the bug in Linus's rmap/TLB series, and its interaction with my > rmap series, and report back on his series (asking for temporary > drop), before next-20221107 goes down in flames. > > I'd advocate for dropping this patch of yours too; but if it's giving > nobody else any trouble, I can easily continue to patch it out. > Given that you tested the patch against v6.1-rc3, it's clear that the patch on its own causes problems. Having a reproduction case will help me figure out why. -- Mel Gorman SUSE Labs