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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7242BC433FE for ; Fri, 14 Oct 2022 12:12:07 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E39506B0072; Fri, 14 Oct 2022 08:12:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id DEA396B0075; Fri, 14 Oct 2022 08:12:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CB0CF6B0078; Fri, 14 Oct 2022 08:12:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id B8F486B0072 for ; Fri, 14 Oct 2022 08:12:06 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id 8B6361A05AC for ; Fri, 14 Oct 2022 12:12:06 +0000 (UTC) X-FDA: 80019441852.24.1958675 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf30.hostedemail.com (Postfix) with ESMTP id 77C5C80021 for ; Fri, 14 Oct 2022 12:12:05 +0000 (UTC) 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> ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1665749526; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=/xUt8Y4IwTvvldIp0EcUJRzSF4xX9kwkjX2KlbgFVak=; b=f6eyPyckDMzLO0SX135ir63EK4qHDKX0cvJvz1ChowOfqvqqY2S8PHqFTvf0GEAbTDt6Du SRR2+DO4NkFtnDOMIO0u0569BZuO0kcCUSAdQ6mEwoMqxXxpamasJNWdAyoDlwoo1wcdJm Xhg86IcfGtSyxQs4Hp4Qczn5/iHYfj0= ARC-Authentication-Results: i=1; imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=IuijqRk1; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1665749526; a=rsa-sha256; cv=none; b=8S4gPYzViFIBJb/VDfWOtCeIF9V7YrRDfVdUfI5zLz2izsU9uucFxOpPh0yTmBcwWk5ytT NHsfcASL3ppfeJdwWtYEypE/NClIF1GAgPqORXsVqDNnUkBV7IiSouXWEfIifAtdV6Tamr PODaL0Iwur15kOFXTekPThHii1FxaJ4= X-Rspam-User: X-Rspamd-Server: rspam11 Authentication-Results: imf30.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=IuijqRk1; spf=none (imf30.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none X-Stat-Signature: hc6k9m3jiaht1uuns4d87fwyiaumht91 X-Rspamd-Queue-Id: 77C5C80021 X-HE-Tag: 1665749525-314281 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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.