Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2096230rdh; Sat, 25 Nov 2023 13:27:38 -0800 (PST) X-Google-Smtp-Source: AGHT+IGnovDVuW/vg51fX7fHpOSy2pUojVuSoBw1KyGeiY/g0Nz1NlohxZc2XmCULv0xEhC1vY96 X-Received: by 2002:a92:d7cc:0:b0:35c:695e:5420 with SMTP id g12-20020a92d7cc000000b0035c695e5420mr5925021ilq.18.1700947658083; Sat, 25 Nov 2023 13:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1700947658; cv=none; d=google.com; s=arc-20160816; b=YGZphvMox9l30whheKK/f1vmJDt4gM0ZH/ceyzyw/kdf+Uu3H3FEkv8ymiG9vOK6fM g2t0wQQDZYD/V3uVvCx6g192dVP8nrgw0Ukqxi0p0zX1xt0FFSjmly7dgjGrMBHnTLYi RGswsLA9OMdq/AyN4XIf/Dzq+Fw1wCLLW1ZUB+s6kArK3MSslNohmFOaUFQUcHIy5GWu WU+VuP0cx5ym3GA2NiDZjxVD+COjm3Daep8LPkHLLX0NRLAySSJQcXHR5JdhM9It9DVQ ltFcCKaBqnY6iZ/cMogI25adV+VpQQ6rK6l+1mDS+Ym6aObUuVfm0STl4ahc4Iq3GWOP ugbw== 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=RA59w9vvytJ/JDi6+2N9orGF24snpm6HMKOCxF3aF9I=; fh=NwNwuqJFhFdN1x7x2Vtyn7Wq/jVzjBcIVl9V7igeRaE=; b=KvddiRPiWLPsu+PPKJmpVM/VT7og/1Gf/+/ZFd75WhjtHmtXHvbL5QyT2HYhemGBiT eviG7lhGj4DEZW7qH/jc60+VYBwFS+evK3M7miJpiUiihXha9yZzuNesq6PU59mgVOtV neGuWglr9QOCDLaCzLAWsiiPKD0sSp3X/VCzsbwO5K+ggO7hgXlTBUQvTy1F9rXwHIMa asfqUlmdvVgo8f3R5C7JOe1OOtwnTqGpVJcG0fizA12Ki/hB9AuMi+WbJAEgczP+qwmH zzaT/51X39Gciiwny+7/r0n5GtrC7h2/bULO/iFt41Bbkx1pHB1Uke6Nct/XPinLwByM YkVQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f19-20020a056a00229300b006cb4f0aaec6si6524147pfe.232.2023.11.25.13.27.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 25 Nov 2023 13:27:38 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 8DFF180952C4; Sat, 25 Nov 2023 13:27:33 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229511AbjKYVWZ (ORCPT + 99 others); Sat, 25 Nov 2023 16:22:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41696 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjKYVWY (ORCPT ); Sat, 25 Nov 2023 16:22:24 -0500 Received: from smtp-out2.suse.de (smtp-out2.suse.de [IPv6:2a07:de40:b251:101:10:150:64:2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 811F7DB for ; Sat, 25 Nov 2023 13:22:31 -0800 (PST) Received: from relay2.suse.de (unknown [149.44.160.134]) by smtp-out2.suse.de (Postfix) with ESMTP id 180801FD26; Sat, 25 Nov 2023 21:22:30 +0000 (UTC) Received: from localhost (dwarf.suse.cz [10.100.12.32]) by relay2.suse.de (Postfix) with ESMTP id 3868B2C142; Sat, 25 Nov 2023 21:22:29 +0000 (UTC) Date: Sat, 25 Nov 2023 22:22:29 +0100 From: Jiri Bohac To: Tao Liu Cc: Baoquan He , Vivek Goyal , Dave Young , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, mhocko@suse.cz Subject: Re: [PATCH 0/4] kdump: crashkernel reservation from CMA Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Authentication-Results: smtp-out2.suse.de; none X-Rspamd-Server: rspamd1 X-Spam-Level: X-Rspamd-Queue-Id: 180801FD26 X-Spam-Score: -4.00 X-Spamd-Result: default: False [-4.00 / 50.00]; REPLY(-4.00)[] X-Spam-Status: No, score=-0.8 required=5.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email 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 (fry.vger.email [0.0.0.0]); Sat, 25 Nov 2023 13:27:33 -0800 (PST) Hi Tao, On Sat, Nov 25, 2023 at 09:51:54AM +0800, Tao Liu wrote: > Thanks for the idea of using CMA as part of memory for the 2nd kernel. > However I have a question: > > What if there is on-going DMA/RDMA access on the CMA range when 1st > kernel crash? There might be data corruption when 2nd kernel and > DMA/RDMA write to the same place, how to address such an issue? The crash kernel CMA area(s) registered via cma_declare_contiguous() are distinct from the dma_contiguous_default_area or device-specific CMA areas that dma_alloc_contiguous() would use to reserve memory for DMA. Kernel pages will not be allocated from the crash kernel CMA area(s), because they are not GFP_MOVABLE. The CMA area will only be used for user pages. User pages for RDMA, should be pinned with FOLL_LONGTERM and that would migrate them away from the CMA area. But you're right that DMA to user pages pinned without FOLL_LONGTERM would still be possible. Would this be a problem in practice? Do you see any way around it? Thanks, -- Jiri Bohac SUSE Labs, Prague, Czechia