From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id ED467C4332F for ; Fri, 14 Oct 2022 12:12:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229609AbiJNMMK (ORCPT ); Fri, 14 Oct 2022 08:12:10 -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> Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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.