Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp514333rwi; Fri, 14 Oct 2022 05:21:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5HkwZ28JmES09nnI8f40NqGjAVUq5MYE7E04FQ3aizaz8+z6yq9DfvWThsb11rfV9MUhaN X-Received: by 2002:a17:906:5a4b:b0:78d:8790:d4a1 with SMTP id my11-20020a1709065a4b00b0078d8790d4a1mr3338886ejc.329.1665750098735; Fri, 14 Oct 2022 05:21:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665750098; cv=none; d=google.com; s=arc-20160816; b=Pb0nfGrPHvLWj4fM9o/tqIKqcn5k4QVpZcrmDYYF2fqKWbuExjvbYN7UBsygCSQIog dCWPVdnSCDUzK6BazSwrRNBidUhsKElNbyrqJx6BLyuwYlFvm1MSWpccaoq6iUAcZbkL aFRO6hzFCVDGTF6Y9JtmobtYc6T3ntYVTB5xROto2SL9Bu8iSXUFyOokdlQZeqZR1fYD hqY8wR8ZqMSEIaQqp7Sm/a+p0YIhDJA/RfdtXyBQavgA+73JoaBGeLTJcTjymIJhujL4 rGmbQM4i3V7GLfJoS3GMS9TtJtrxJ1yazpWPUNuZG4NQ0aDMECLSlnhA9CeL6WFBeSi7 yMCw== 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=/xUt8Y4IwTvvldIp0EcUJRzSF4xX9kwkjX2KlbgFVak=; b=T78Ieh5SFJ5uZzmEWbe32UeKEP4ZpUzqVQCoIEQiaPT2/B26743NVbQZCtcLSLM6IV P21RcAvwh7V1c4rD633j574WO0jwruRHlJcBc03vdf/3A9atDAgkSx4MbmjJCP0txw7N NhKNCGubN00t0PrnEpteNyO7CSqbHExvBnh5OgqpCRTQdJOxIwiDm/N6I/QCIPGvy9ey R10N9DrDGrydH2F1tA3ck8ewKXHfsPazV0osjYYYVhuoW4Up0KlO63UfoF1d2/9+iWJJ 7UD7KTuKzlzwdjdKZWM7paymY83pf3CmK1cYbqUGtZd8rFjzLGnvGJuYQVO340U9DPMc 6jgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=IuijqRk1; 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 oz39-20020a1709077da700b0073d581b0906si2590448ejc.278.2022.10.14.05.21.11; Fri, 14 Oct 2022 05:21:38 -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=@infradead.org header.s=casper.20170209 header.b=IuijqRk1; 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 S229944AbiJNMML (ORCPT + 99 others); Fri, 14 Oct 2022 08:12:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229867AbiJNMMJ (ORCPT ); Fri, 14 Oct 2022 08:12:09 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 60F591B76ED; Fri, 14 Oct 2022 05:12:05 -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=/xUt8Y4IwTvvldIp0EcUJRzSF4xX9kwkjX2KlbgFVak=; b=IuijqRk1+kAIPSVBfC5zxk0m/r hLuzS2HAvJVHGGTadOrvNRfpkb1wmSG/wqcu9uJwv3DxpXkWqacOU3qo+WEXMQTLH8zNHEvHAqBJg 30yIjM8Fp+bOkGe9aJGWgxaLcNa2huQK5f8BuUdi4KKx1xoR8lpyGk8tH1ai4+JlIjEtSjqc8/s88 h6bZyTj+4p+q5t4pwbiZlhTLn1AbNAsg48GuGjvHjEtgs2342hjrwAnAIo8wNaJ3hMfTy6z+D1VxG kt5J9Dvfm5RjN0v/gWkb9dVBGLZRkFyQ99lN2k18S4hkGVp657c3JwPRkoHsPLWQYXGzHcylnKKZe ZTbKU4Eg==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1ojJXe-007biS-Fv; Fri, 14 Oct 2022 12:11:54 +0000 Date: Fri, 14 Oct 2022 13:11:54 +0100 From: Matthew Wilcox To: "zhaoyang.huang" Cc: Andrew Morton , Zhaoyang Huang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, ke.wang@unisoc.com, steve.kang@unisoc.com, baocong.liu@unisoc.com, linux-fsdevel@vger.kernel.org Subject: Re: [RFC PATCH] mm: move xa forward when run across zombie page Message-ID: References: <1665725448-31439-1-git-send-email-zhaoyang.huang@unisoc.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1665725448-31439-1-git-send-email-zhaoyang.huang@unisoc.com> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE 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 Fri, Oct 14, 2022 at 01:30:48PM +0800, zhaoyang.huang wrote: > From: Zhaoyang Huang > > Bellowing RCU stall is reported where kswapd traps in a live lock when shrink > superblock's inode list. The direct reason is zombie page keeps staying on the > xarray's slot and make the check and retry loop permanently. The root cause is unknown yet > and supposed could be an xa update without synchronize_rcu etc. I would like to > suggest skip this page to break the live lock as a workaround. No, the underlying bug should be fixed. > if (!folio || xa_is_value(folio)) > return folio; > > - if (!folio_try_get_rcu(folio)) > + if (!folio_try_get_rcu(folio)) { > + xas_advance(xas, folio->index + folio_nr_pages(folio) - 1); > goto reset; > + } You can't do this anyway. To call folio_nr_pages() and to look at folio->index, you must have a refcount on the page, and this is the path where we failed to get the refcount.