Received: by 2002:a89:288:0:b0:1f7:eeee:6653 with SMTP id j8csp522155lqh; Tue, 7 May 2024 06:35:01 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWkupOJHW/Fn/1OCIB1cAGS604G5EnZfQE87OydEBcKK6xbIFr7ngm9pt8UcMOXJpQtvCF1HL3p/4tltsMdClqUgLFTu/KEQmmfOBbG2Q== X-Google-Smtp-Source: AGHT+IF+3OCF6YDj/LQ0eAJqqVIdvOaRkJOufmGNV4g981AD60XUfkslb4b2CdgR5LDqcU5VvRA4 X-Received: by 2002:a05:6a20:c89c:b0:1af:b38a:8f94 with SMTP id hb28-20020a056a20c89c00b001afb38a8f94mr6902159pzb.15.1715088900912; Tue, 07 May 2024 06:35:00 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1715088900; cv=pass; d=google.com; s=arc-20160816; b=FAG7IYPA+E/6MDX6kwVfaOusflLYV3fdRRiAPQz8gW/NTIQXQ7E2MRrboJXlaQlgCP zWUevgmfwRbzP7rqzW6QPRgok9rEJd0RXHzK2yWlPMchipiu64MczigEz7pytrnzNxEY TTPADkOJPlzkXTwFUO6eBYRQuMeSpJqf61GuWuk1GGsfI+4GJyag5ida4zKkHizhemvp MwL5epQtECUP3m+vOZ/eRg3MEliMZQTt7yJ1Ze55krj4vUAeohKCLYi3hnd+XyjLzWFf PxaOo9dyso6kvUGm2GwEYwGdGBHpmkm+mleFHSTKXyrOWuwonMIIe2QOb1Fo14tnK8r3 8z6Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:subject:cc:to:from :date; bh=PnvoQVMa7ZC3l53Blv7r5V+orl9W9AIX0kTS8HyrztM=; fh=U7RlMCxd2qnP+tJXck4kemUApm1UGYqG7WyFX8srP+4=; b=Jh3oAMudR8vdjm1wNW/jud9SfjlJVGLhrSlFsM4U5ZFK4i5Wns2v790Wfksg1kKJqf ULjw0zgjnTPM4257eEMr+49HjpkDCBmyV3YNY/MH0p4ookd+pBjBhxB1fCPO3mEKdoyj 1Y4ODszMCD1n2//MXyqxClYTCKX+yd8PboMx6ekyOHfF+gJoO8purluf7Me+hjTDxNZF NmlYWLn47VgL4dYqs1z0Y1D2+ch5TMpOcggDQoNRc5btXpveFzmVGi0WjS5WfmrWBm9U med2SXnCmBP2J/KJopcKkSXzS4XvFu6mhkQqVBrO9VBY7qB1QBI3BqNZwiXCPgy2kERM P69A==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=shelob.surriel.com); spf=pass (google.com: domain of linux-kernel+bounces-171423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171423-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id w18-20020a639352000000b0061a6efa2c93si9673723pgm.74.2024.05.07.06.35.00 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 07 May 2024 06:35:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-171423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=shelob.surriel.com); spf=pass (google.com: domain of linux-kernel+bounces-171423-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-171423-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id D41CE286CF3 for ; Tue, 7 May 2024 13:33:36 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id C79BF1C6615; Tue, 7 May 2024 13:19:56 +0000 (UTC) Received: from shelob.surriel.com (shelob.surriel.com [96.67.55.147]) (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 17C5315E5D3; Tue, 7 May 2024 13:19:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=96.67.55.147 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087996; cv=none; b=PAIQty1dNro5i6VNR1vE+9xeGZuF+UJOwTLoPq9sEO1yQTEWn0Pl2EbYRj+Qf46gtVtm2PXOIFHvdd9aoP2t3uW9VWwepDz7j5ElhHAxSRIMY5T1TOHm05LxxnKl7ZIoPj/ZvRCZI81qkys7veCGPi4tyTMRG7QeziC4shNMZS0= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1715087996; c=relaxed/simple; bh=1BoYOg1D0katMBYBO3j8/HTTrzFKSMZIdyb3qfrvQS0=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=KVXFP1Nw/3TEb6kxf+HNYMPJDKut8GGHSqUb/C9rYp8/Qhkb+tXPseIgENJHXdAQeCyQU96Xr3Zlk4USWn0eszNhG5fHyf4m2UGIGMMNCSti+JHlPmE+epVrUObgnG9T1u6Y/tA2t/DvxH7cdLQbLLXhSDpLJpsQbT0QfhlNE74= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com; spf=pass smtp.mailfrom=shelob.surriel.com; arc=none smtp.client-ip=96.67.55.147 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=surriel.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=shelob.surriel.com Received: from [2601:18c:9101:a8b6:6e0b:84ff:fee2:98bb] (helo=imladris.surriel.com) by shelob.surriel.com with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.97.1) (envelope-from ) id 1s4Kil-000000004Aa-0RLc; Tue, 07 May 2024 09:19:03 -0400 Date: Tue, 7 May 2024 09:18:58 -0400 From: Rik van Riel To: Baoquan He Cc: Vivek Goyal , Dave Young , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, kernel-team@meta.com Subject: [PATCH] fs/proc: fix softlockup in __read_vmcore Message-ID: <20240507091858.36ff767f@imladris.surriel.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: riel@surriel.com While taking a kernel core dump with makedumpfile on a larger system, softlockup messages often appear. While softlockup warnings can be harmless, they can also interfere with things like RCU freeing memory, which can be problematic when the kdump kexec image is configured with as little memory as possible. Avoid the softlockup, and give things like work items and RCU a chance to do their thing during __read_vmcore by adding a cond_resched. Signed-off-by: Rik van Riel --- fs/proc/vmcore.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/proc/vmcore.c b/fs/proc/vmcore.c index 1fb213f379a5..d06607a1f137 100644 --- a/fs/proc/vmcore.c +++ b/fs/proc/vmcore.c @@ -383,6 +383,8 @@ static ssize_t __read_vmcore(struct iov_iter *iter, loff_t *fpos) /* leave now if filled buffer already */ if (!iov_iter_count(iter)) return acc; + + cond_resched(); } list_for_each_entry(m, &vmcore_list, list) { -- 2.42.0