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 44CD81F542C; Tue, 21 Jan 2025 17:56:15 +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=1737482175; cv=none; b=tLEcZC5h3x64hxNFEnKv83Lzu+lG/8TUsTo4yxqJ3OAkfBI6bnmBeXqdEDkqZMwPvV7KVclb6Bahkt2AHfJV+FmToLqWqrr6wxWOv6LpnhMymj1u5tpAfImRpRo/WkghqcfAu56pkflyT51KGvuS+kAta5KCyey4SndQgYd8ZdQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737482175; c=relaxed/simple; bh=HvDTkC9KkoGMORhrQXavJ6HW2DkR4AXKm0692BCdmcI=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=u5K6C5iRS+2WuB8u8DdUvpvmHdMt6FScXG4PPEMbV04KsoxKQA7A6leXWw9a8vOO93S0JR8MUFg8lebdbF7pTULxcVrrUW+ciijm2pcaujeWBBPQA9b9Ll3uuCMzwLC1oST29DkCUEv62I0IwaE0d6aaohJXLsz1pok0Ggr8FgA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=HhIumPlW; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="HhIumPlW" Received: by smtp.kernel.org (Postfix) with ESMTPSA id BF745C4CEDF; Tue, 21 Jan 2025 17:56:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1737482175; bh=HvDTkC9KkoGMORhrQXavJ6HW2DkR4AXKm0692BCdmcI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HhIumPlWPs3iA69C1ptTJlnND2gisbBaI3xCns4gsojvn2+nzIAEQpIlgavANMoae nC7lYciUFkCKHPcktaBhLC5ojyU3efHg8Y27LvV7ZB7YDfbl5en0t/eyGnsmkgJ3mK QWF2Klxz0DQXHBJnk5+N4/C1J7Eg9uPSxKvu1K5s= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Rik van Riel , Breno Leitao , Baoquan He , Dave Young , Vivek Goyal , Andrew Morton Subject: [PATCH 6.6 52/72] fs/proc: fix softlockup in __read_vmcore (part 2) Date: Tue, 21 Jan 2025 18:52:18 +0100 Message-ID: <20250121174525.434324681@linuxfoundation.org> X-Mailer: git-send-email 2.48.1 In-Reply-To: <20250121174523.429119852@linuxfoundation.org> References: <20250121174523.429119852@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rik van Riel commit cbc5dde0a461240046e8a41c43d7c3b76d5db952 upstream. Since commit 5cbcb62dddf5 ("fs/proc: fix softlockup in __read_vmcore") the number of softlockups in __read_vmcore at kdump time have gone down, but they still happen sometimes. In a memory constrained environment like the kdump image, a softlockup is not just a harmless message, but it can interfere with things like RCU freeing memory, causing the crashdump to get stuck. The second loop in __read_vmcore has a lot more opportunities for natural sleep points, like scheduling out while waiting for a data write to happen, but apparently that is not always enough. Add a cond_resched() to the second loop in __read_vmcore to (hopefully) get rid of the softlockups. Link: https://lkml.kernel.org/r/20250110102821.2a37581b@fangorn Fixes: 5cbcb62dddf5 ("fs/proc: fix softlockup in __read_vmcore") Signed-off-by: Rik van Riel Reported-by: Breno Leitao Cc: Baoquan He Cc: Dave Young Cc: Vivek Goyal Cc: Signed-off-by: Andrew Morton Signed-off-by: Greg Kroah-Hartman --- fs/proc/vmcore.c | 2 ++ 1 file changed, 2 insertions(+) --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -404,6 +404,8 @@ static ssize_t __read_vmcore(struct iov_ if (!iov_iter_count(iter)) return acc; } + + cond_resched(); } return acc;