Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp20662pxb; Wed, 30 Mar 2022 21:43:18 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxtWsfhMguBZKSiPBHA6GD0wBWFqvt3B1sFuF4rp47P5HPHdRWW5mUQFkF3eIz1k4I/Em2e X-Received: by 2002:a17:90a:fa95:b0:1bc:509f:c668 with SMTP id cu21-20020a17090afa9500b001bc509fc668mr3973738pjb.189.1648701798128; Wed, 30 Mar 2022 21:43:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1648701798; cv=none; d=google.com; s=arc-20160816; b=lDrx0biGHPMqe6TQH839m6CkIGtx/d9zmWH2OB0Dr7GV0Me7F7c1gC1VyITJYLjlUR V5meCQJdlZhyqOoe6EHBGXC1TTsOt4J4A33McdDT7lHzQ+W75lWo6ciLmGdJETmd9kYn +t6jObHMuGqKD/IH7u755y5h0+9Goudpwr0Aem/mbWyz0cA5S+Aqt7stZfwMeIbSkK75 oh68Oh9OGl2MUhaDlC9tfeePXMsi+Ob/TYT1v6XtQgv8AM3M0oU9UbWrywBmzyBsH3sQ 9YNN2Ssh/YX3s8/2ZIA5X1DSCxGPzvPKB5pp1L9bhDob/f4n7Mc140g4zWhcfgHPxl9r 7VbQ== 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:dkim-signature; bh=FsXi28gMtdis5Jj9MbJiJRd8qiKWr77s/dYvW4iZVqk=; b=AInC5hjqcYxtOYEt9Tx/MK50fYziCoim8EWFmLqYCYJ8EfPopRENQ+RvqibsdtxpNP 4S6YNAsWLT8/iZI2AGPsA2FHmOYAxe/AIsN6vwXs7rumQl4IyiDOCLIVZsTC9PbBH0ya cp5hfbaknQvemx/GxAk7mjLn6qrb6RwSffeDRKsdROrRJ2W7BI//0z2ISbI5up2i+JSP j0FeW1s5MPpF5reualTDgsnCdBr0fQsnCXHxH/lJm+wV/XDK4l1+Qn0Nr8Mp8s7ICL+w P2nx3+QP80+Fx/HxdBfUC1g66Yu7B3xBvrzLJ1Z25driAOzJNnkv4AfbYVsVKgDePuEc 4kaA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=q35vE6HT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id z2-20020a656642000000b003816043f000si21351934pgv.501.2022.03.30.21.43.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Mar 2022 21:43:18 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=q35vE6HT; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 7B14A270876; Wed, 30 Mar 2022 20:40:11 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351324AbiC3Vqm (ORCPT + 99 others); Wed, 30 Mar 2022 17:46:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348397AbiC3Vqk (ORCPT ); Wed, 30 Mar 2022 17:46:40 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7B9846592 for ; Wed, 30 Mar 2022 14:44:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=FsXi28gMtdis5Jj9MbJiJRd8qiKWr77s/dYvW4iZVqk=; b=q35vE6HTTuQyDeuJqYmhWGFFwg Phr1RusYnMeu0U+3q9/lKXn6Rae9tnFweCN8ukLPPeBZNLB8y2ueWKJdzkf2jnbxwoWmWS1yxLaun BhIYgMyqbTzimrYjQlwERtWN3rjkD8a14giTqDBsM5kcDZT3++w03cBQR+rK3a1/58HsyLohMPZh6 eeLv7S5od/pXrK2dG3ppEaxtLrirSAmW2jq03JyVZP3vzt8KI+k3AWqd9A/QzING4Rq9pvtJZTGCg duM7Wmy+uGcrwa35k/DOBFddN20jCmK33+giroIxzUnhd+o9YDrCQZI5fNGN+9pOsJX2gjc/Krmj+ GANjxN6Q==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nZg7W-001bGh-4j; Wed, 30 Mar 2022 21:44:50 +0000 Date: Wed, 30 Mar 2022 22:44:50 +0100 From: Matthew Wilcox To: Hugh Dickins Cc: Johannes Weiner , Muchun Song , Andrew Morton , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: WARNING: mm/workingset.c:567 shadow_lru_isolate Message-ID: References: <55db706b-9bce-b820-7d88-6392374cd4fc@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55db706b-9bce-b820-7d88-6392374cd4fc@google.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, Mar 28, 2022 at 09:24:00PM -0700, Hugh Dickins wrote: > I'm not familiar with workingset.c, I'll make no guesses, over to you! I haven't been able to reproduce it, but I applied Feynman's Problem Solving Algorithm, and I think this will do the trick: diff --git a/lib/xarray.c b/lib/xarray.c index b95e92598b9c..d3b168f619b1 100644 --- a/lib/xarray.c +++ b/lib/xarray.c @@ -1079,6 +1079,7 @@ void xas_split(struct xa_state *xas, void *entry, unsigned int order) xa_mk_node(child)); if (xa_is_value(curr)) values--; + xas_update(xas, child); } else { unsigned int canon = offset - xas->xa_sibs; @@ -1093,6 +1094,7 @@ void xas_split(struct xa_state *xas, void *entry, unsigned int order) } while (offset-- > xas->xa_offset); node->nr_values += values; + xas_update(xas, node); } EXPORT_SYMBOL_GPL(xas_split); #endif (the key insight is that the update function should have removed the node from the list; the WARN_ON really means "this node should not be on the list", so there's somewhere that we're forgetting to call xas_update(), or somewhere that we're forgetting to call mapping_set_update(). I didn't find any of the latter, but I did find one of the former)