From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f44.google.com (mail-oo1-f44.google.com [209.85.161.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 120E1349B16 for ; Fri, 17 Apr 2026 16:19:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442770; cv=none; b=mDf1+qmzVcOV9YdcGshLDzCZTE8z1X34cdHlWuT9vyEdeJ3p4fJRNdrLMqLfj8gWdj9x7IW5ivziFFvP2YG6E9Uc0V8GXQKdJnQuNYV2qXR5MXCgOn4Wj47lRCkGl1k11wHppN5nQI7cfB4AOmB32fvk+xbUUWhPzq8e4SzQDFo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1776442770; c=relaxed/simple; bh=ygQv38RqJKvh1SS+IgZEKCxGBxDC/Yqv4ap6i0tZ2WE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version:Content-Type; b=dF92lugVb3A18prTjD2a/h+rI90w15EFhOmRoP3VDTkAgSY7k4P+uf1/NJAyG4vQ69QrwKsneIASZIWSYiR9MsUXd/VKlfVlWbF3+8qiD0zYcHSQ/Vazs4DKh066mrY5NcIoBZviWexy4fM2lxkvGL+13A19+8Tq5eTzclHO4jg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hammerspace.com; spf=pass smtp.mailfrom=hammerspace.com; dkim=pass (2048-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b=PSSGirqO; arc=none smtp.client-ip=209.85.161.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=hammerspace.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=hammerspace.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=hammerspace.com header.i=@hammerspace.com header.b="PSSGirqO" Received: by mail-oo1-f44.google.com with SMTP id 006d021491bc7-679b072ed3aso468170eaf.1 for ; Fri, 17 Apr 2026 09:19:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=hammerspace.com; s=google; t=1776442768; x=1777047568; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=hAZj6q0GbSybVG73tUUfRCMNiF4vqq2mbMfOFb5td1w=; b=PSSGirqOqnIpfz6dH9gyxiL04OggjZU2vnXC/DVZ+zso8SwFi2hQSEaI6TcamVUEdu eJtamUd/Mj5g7RZNCvbGsqonJIe8lWkz2F03Yjm1xh+8Vzn+IQxT3scUSdCSvvkGneJh ydq8M01cNCLBe9JyrrW0Ll4Hw5/84jfiSJbue1i/3xiPkLmjZ8+REI7Gagi95OoiiepH bEf88qYsdBCP4YmIclmd6m9uYI2gbFi+jeWxf8DQf1JvhGHxCCrmGDcW6CJMawwX35oC bdJxJemUiyCkDteSTjEaCp+CP0zicNZ2DLe1VqHpg3ayoHRGQUgLdmjb56WMEJQk5YaH q6PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776442768; x=1777047568; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=hAZj6q0GbSybVG73tUUfRCMNiF4vqq2mbMfOFb5td1w=; b=nCBy8oKNoDp9k4GtkIrnRMKCrMeMR9wBf5olLtk+ME7oTzgtS/MgynWEFdilliPhsy 417EZy0Pc4BF237yQlFAoQNx5j8dPs5I2200NEDghhH0gbQCKIdKo4vIQlhdTRAT9Kxi qhdvWLljn800cbzY/s8aMPuds2MyYgp4voOQ8X6qkWZd1b5XGaWsk6iYgqGzdOpZfXsr k/MmNzV+bwx0RPavRkVPRvnOWeBRIMrmf9k6i4za1mV/CVfGFNNsYMX7HMqK4YQbEgg4 BzVhIfZC1GFDj+c9wHa27ocBzxpUiauFUWrKZFiYpmQuT865R9BfwgIhLaREV6kzEp9R 7RTA== X-Forwarded-Encrypted: i=1; AFNElJ/So1xbSBdAV/Nj2hKH2NhCA4N4gJbqJdXP5YeYZjTJD2RNP1SEZx2pg+aZtfnsh9yMGu1O5vv8x04QOgw=@vger.kernel.org X-Gm-Message-State: AOJu0YxzQGkB4rfKNW336BpVVFs5nqMtnhcdS6MRDUKLbJo4VPY9vnOG dXINNl1HA91MmYWHxvt2/hP3CzuKR88SJ4aD2GL78mtzO6rddVtkTqyKHxsmvMS6HzHqoQHz74x gyeOv X-Gm-Gg: AeBDieu5cz98yS9re6ynHuMebaTMTjYlIzQsbGl2jutckj6K4bom4BIHvnkaKcTsBhu 4y8qRqysMBr1UJt3SR5N0iGBbnsqjc+4ru6YjENP39fhtGUl2yxguYoD+zK+GieEZvKc/iD3Qk2 HkeLsiG5nyyuUGijzceMSnG0jbbYTzaMwTFG6oovxYfuQCC1vvJFSCzVNnaPLy0POXSvYXahJPD ar4rB8Ijm22JEUd0mwVLbp6rQ8BviDlZ+OC46IGihMhF5dJGaI0NM5BkXpJJtJoDj2SnINH6MDt HabyebsJSQa0wrFWgIrIXg26u6TvaGWEA2GsSakAp0p8lUB9W4y8XMvl/6fvFo/apCXBNLPv2TR KooBdPDzNiDDLxhZL45GHAceOMtubn6vw2lecKyPwkJ1vSLqN22/aKOxYbH3FvRqJIzT2iywZji JKEnWG2HT6EwZAPODYa6x9eCr62bEoS5WkJ5HA02c57QCh75VtQg== X-Received: by 2002:a05:6820:6ae3:b0:67e:313e:22c4 with SMTP id 006d021491bc7-69462f24f03mr1991358eaf.47.1776442767886; Fri, 17 Apr 2026 09:19:27 -0700 (PDT) Received: from [192.168.37.1] ([216.9.110.1]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-42b934a2dd1sm1782252fac.9.2026.04.17.09.19.26 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 17 Apr 2026 09:19:27 -0700 (PDT) From: Benjamin Coddington X-Google-Original-From: Benjamin Coddington To: Ben Roberts Cc: Benjamin Coddington , Trond Myklebust , Anna Schumaker , linux-nfs@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] pNFS: deadlock in pnfs_send_layoutreturn Date: Fri, 17 Apr 2026 09:19:25 -0700 X-Mailer: MailMate (2.0r6272) Message-ID: <14A7BAF5-7D96-4C34-9FEE-CA929267A174@hammerspace.com> In-Reply-To: References: <20260408122534.537816-1-ben.roberts@gsacapital.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: quoted-printable On 17 Apr 2026, at 3:17, Ben Roberts wrote: > Hi Ben, > >> Did you reproduce and diagnose this problem on a recent upstream kerne= l >> version? > > I'm not able to switch the production systems to a more recent kernel a= t > this time, and don't have a reliable way to reproduce the issue in the > wild without risking production systems back on an unpatched kernel. Th= e > best evidence I have that this patch is needed, is that we were seeing > this deadlock occur repeatedly under high loads and memory pressure las= t > year before applying this patch locally. It was rolled out to all > production systems in early Jan and we have not seen a single reoccurre= nce > since. The relevant code paths look similar between the modified EL9 > kernel and the current git HEAD. > > I've spent all this week trying to devise a precise reproduction (with = a > lot of help from an LLM since I'm not that familar with kernel > development) on both 7.0.0-rc7 (9a9c8ce300cd) and 5.14.0-611.9.1 kernel= s > to definitively prove this patch is needed, but without success. The > initial analysis suggested the deadlock might be triggered from a singl= e > process via a recursive call. This theory has been ruled out; all calli= ng > paths triggered by a single process are guarded in such a way that a > recursive call does not happen. Revised theory for why this patch helps= > is that the deadlock is subject to an inter-process race, where one > process suffers a memory allocation failure, causing a second process t= o > become a victim of bad state, leading to an unserviceable RPC request. > The timing appears to be very sensitive and hard to reproduce on demand= =2E > > The LLM-assisted analysis follows, and to my non-expert eyes seems > compelling. > > Thanks, > Ben The kzalloc failure is definitely a rarely-used/tested path, so its possi= ble there's an issue there no one has seen yet, but from what I can see it lo= oks like every call to pnfs_send_layoutreturn() first calls pnfs_prepare_layoutreturn(), which already clears NFS_LAYOUT_RETURN_REQUESTED. I don't see how you can end up with another= proccess seeing the flag. There's at least one body of work in this area that your systems don't yet have: https://lore.kernel.org/linux-nfs/20240613050055.854323-1-trond.myklebust= @hammerspace.com/ Again, I strongly recommend engaging RH support here. Ben