Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1049080rdb; Wed, 6 Dec 2023 07:20:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IFdDqIs510Z268zoXd3G01AanYpIi0wUIKjof4Oj/yAVNkyGdjqMPzRlsyHPK817Yjd1b64 X-Received: by 2002:a05:6a20:9144:b0:18b:30d1:8140 with SMTP id x4-20020a056a20914400b0018b30d18140mr912816pzc.6.1701876004803; Wed, 06 Dec 2023 07:20:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701876004; cv=none; d=google.com; s=arc-20160816; b=qI5phvZiWRC8humWv6P1+m1xDxlKHmpXUPddgc52h7wzl0i9PSc7hqUaJrliRhkO10 iq8ZqxIk9OH+K4xQESk7XEEYbyP/DI1TPxQp371QniYFKtG51YfNr705MA7dwGfTyPAF HmwruMQBS4YdCeUn11gIiOTXhCX8RM0TbZ0M0tjqql7H62EICLITrfB8eEYKVGleRsV4 SoqfvpfQyWVxiAm0jqCGxTNjpnA+3Ktl+LVGslim+BE4yF4f9KG6xx2vF6QI+0+iHQVo 0TKJCKgHP0YFknXXc4cfUiehXwl4csCi4iPD8ICiIxOJQ9Cv5pcIApV7HaLwhRIPwYvu dSsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date; bh=pZJNJAq8ABHxbAssAuacvr91EjPHtn91zqCTQII+cVY=; fh=AF/GNKLETtuuLtVva22KlNkBTGpMF1rKTxlkiXTVRuQ=; b=tuV8xFBq8beexTtlXenf3RpGtmGBfaAQ9+U71kSVbytd7t+0bzWGrwM/5WIE9/asJ9 ODzhxQLpSsoa9Bkl0C2JaL7YnXCNMxkf2a5sRtEuZOMwxFuSzoaQlWLS7a6LDReLxp9u jnIbWpSWMh84TRuuZglu8liEyS6xye40gKIM8RAvrhb01d3CE2qdY89eyhNg2TpHM05E rXPfKdhWWFQmgSCODJ5VENJDP4yVHTr/H69RckXHh81swSBB9O+kEA4GNaEepp0q7+aQ gcEjvtCXTe4C77VG7FAEqvU1S03LJq2ql5w6pKVdSDPM1qb+4is02hDUWYDskFsl6YzV sLXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id 80-20020a630153000000b005c66b0c7676si51508pgb.256.2023.12.06.07.20.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 07:20:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id A0368802A81F; Wed, 6 Dec 2023 07:20:03 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379285AbjLFPTw (ORCPT + 99 others); Wed, 6 Dec 2023 10:19:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36644 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379088AbjLFPTw (ORCPT ); Wed, 6 Dec 2023 10:19:52 -0500 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.223.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 077F8C6 for ; Wed, 6 Dec 2023 07:19:58 -0800 (PST) Received: from imap1.dmz-prg2.suse.org (imap1.dmz-prg2.suse.org [IPv6:2a07:de40:b281:104:10:150:64:97]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 14FB521E97; Wed, 6 Dec 2023 15:19:56 +0000 (UTC) Received: from imap1.dmz-prg2.suse.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by imap1.dmz-prg2.suse.org (Postfix) with ESMTPS id ED5A2136CD; Wed, 6 Dec 2023 15:19:55 +0000 (UTC) Received: from dovecot-director2.suse.de ([2a07:de40:b281:106:10:150:64:167]) by imap1.dmz-prg2.suse.org with ESMTPSA id wubtNhuRcGUjSgAAD6G6ig (envelope-from ); Wed, 06 Dec 2023 15:19:55 +0000 Date: Wed, 6 Dec 2023 16:19:51 +0100 From: Michal Hocko To: Philipp Rudo Cc: Baoquan He , Donald Dutile , Jiri Bohac , Pingfan Liu , Tao Liu , Vivek Goyal , Dave Young , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, David Hildenbrand Subject: Re: [PATCH 0/4] kdump: crashkernel reservation from CMA Message-ID: References: <20231201123353.2b3db7fa@rotkaeppchen> <20231201165113.43211a48@rotkaeppchen> <20231206120805.4fdcb8ab@rotkaeppchen> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Rspamd-Queue-Id: 14FB521E97 X-Spam-Score: 15.00 X-Spamd-Result: default: False [15.00 / 50.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; R_SPF_FAIL(1.00)[-all]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; MID_RHS_NOT_FQDN(0.50)[]; DMARC_POLICY_QUARANTINE(1.50)[suse.com : No valid SPF, No valid DKIM,quarantine]; RCVD_COUNT_THREE(0.00)[3]; MX_GOOD(-0.01)[]; RCPT_COUNT_SEVEN(0.00)[11]; FUZZY_BLOCKED(0.00)[rspamd.com]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_ALL(0.00)[]; BAYES_HAM(-0.00)[39.47%] X-Spamd-Bar: +++++++++++++++ Authentication-Results: smtp-out1.suse.de; dkim=none; dmarc=fail reason="No valid SPF, No valid DKIM" header.from=suse.com (policy=quarantine); spf=fail (smtp-out1.suse.de: domain of mhocko@suse.com does not designate 2a07:de40:b281:104:10:150:64:97 as permitted sender) smtp.mailfrom=mhocko@suse.com X-Rspamd-Server: rspamd1 X-Spam: Yes X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (snail.vger.email [0.0.0.0]); Wed, 06 Dec 2023 07:20:03 -0800 (PST) On Wed 06-12-23 14:49:51, Michal Hocko wrote: > On Wed 06-12-23 12:08:05, Philipp Rudo wrote: [...] > > If I understand Documentation/core-api/pin_user_pages.rst correctly you > > missed case 1 Direct IO. In that case "short term" DMA is allowed for > > pages without FOLL_LONGTERM. Meaning that there is a way you can > > corrupt the CMA and with that the crash kernel after the production > > kernel has panicked. > > Could you expand on this? How exactly direct IO request survives across > into the kdump kernel? I do understand the RMDA case because the IO is > async and out of control of the receiving end. OK, I guess I get what you mean. You are worried that there is DIO request program DMA controller to read into CMA memory boot into crash kernel backed by CMA DMA transfer is done. DIO doesn't migrate the pinned memory because it is considered a very quick operation which doesn't block the movability for too long. That is why I have considered that a non-problem. RDMA on the other might pin memory for transfer for much longer but that case is handled by migrating the memory away. Now I agree that there is a chance of the corruption from DIO. The question I am not entirely clear about right now is how big of a real problem that is. DMA transfers should be a very swift operation. Would it help to wait for a grace period before jumping into the kdump kernel? > Also if direct IO is a problem how come this is not a problem for kexec > in general. The new kernel usually shares all the memory with the 1st > kernel. This is also more clear now. Pure kexec is shutting down all the devices which should terminate the in-flight DMA transfers. -- Michal Hocko SUSE Labs