From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A5C1E269831 for ; Wed, 26 Feb 2025 22:02:08 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740607328; cv=none; b=eCv+wRBeK+y5ZGbwdA2TqsRL6p3/+QKNgI2dfoT4zBAeTRk552XVU7j2TRdje/hfqJ035/mwPmpki/BzxgpszH9ygfdifiFZs1EsORBm3ToLItCIZlf+55IUxSgaMoazS0xIf+dyUkB8udNgxzctRX6ijUU5KxaxwX5l+XNOINM= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1740607328; c=relaxed/simple; bh=p5epPjMWWNEfnHqX83pP7X4RcsBho4prTB3XhuWpmI8=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=GMz4iY3YaGhJDDS329i+hNVA0A0YOu26hCaVhnUiZ5Hea0m9zgGYn+tcG9vKKmHAje9H5g+t3rvEH50JFZp2BsG1FCkju1EsWgiHoyxNRk9hAWq49CkqlfLr6eaQqWSiVIcWjzpgtD0M9bMlXCywNAHFaOqgU5F1SRUKRUAAqGc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=OaR0KTYA; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="OaR0KTYA" Received: by smtp.kernel.org (Postfix) with ESMTPSA id D2DDDC4CED6; Wed, 26 Feb 2025 22:02:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1740607328; bh=p5epPjMWWNEfnHqX83pP7X4RcsBho4prTB3XhuWpmI8=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OaR0KTYAHvedbhScdD1MKnXCwZN8HR/UB4CG9w1EFxa9RQXBYPX0va8XjlC5iOwtX LN/6IWqMM58WRi9lUqoBuE7WrkJ7bMGULHINgQ0r27m12oYgbOu/tgCFTWa8rz5gw0 9Mh2g8XpRS+P7fKT6w6eA7TFzppUF5lrce42syUQ= Date: Wed, 26 Feb 2025 14:02:07 -0800 From: Andrew Morton To: Christoph Hellwig Cc: Mike Snitzer , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH for-akpm for-6.14-rcX] NFS: fix nfs_release_folio() to not call nfs_wb_folio() from kcompactd Message-Id: <20250226140207.90cc614ca22db560f19638ca@linux-foundation.org> In-Reply-To: References: <20250225003301.25693-1-snitzer@kernel.org> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-nfs@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Wed, 26 Feb 2025 06:58:11 -0800 Christoph Hellwig wrote: > On Mon, Feb 24, 2025 at 07:33:01PM -0500, Mike Snitzer wrote: > > Add PF_KCOMPACTD flag and current_is_kcompactd() helper to check for > > it so nfs_release_folio() can skip calling nfs_wb_folio() from > > kcompactd. > > > > Otherwise NFS can deadlock waiting for kcompactd enduced writeback > > which recurses back to NFS (which triggers writeback to NFSD via > > NFS loopback mount on the same host, NFSD blocks waiting for XFS's > > call to __filemap_get_folio): > > Having a flag for a specific kernel thread feels wrong. Why do you think this? We are getting a bit short of space in tsk->flags. Five PF__HOLE__'s remain. For this patch and for kswapd I guess we could simply record the task_struct*'s in a static array, something like static struct task_struct nice_name[max nodes]; ... if (current == nice_name[my node]) ... It's something we can look at if we start getting really tight on PF_ space.