Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp3553608rdh; Mon, 27 Nov 2023 18:11:58 -0800 (PST) X-Google-Smtp-Source: AGHT+IFAFzBI6TOiaDkwShYU+V2DatcBkLGgzZYDxgXzE7qfHF+n0RQ5W3Ng0vplJmZh+guOdfWP X-Received: by 2002:a05:6870:9120:b0:1f9:eb8b:fda6 with SMTP id o32-20020a056870912000b001f9eb8bfda6mr16725635oae.40.1701137516147; Mon, 27 Nov 2023 18:11:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701137516; cv=none; d=google.com; s=arc-20160816; b=NBFm+JN3zwFm8B+O62uQQu/ymZgA7ZDDbFNwchxTL76R6m+wN8MwaU2IioGYwZGvpY ASArbEJLf9bXf1xIixnY0BShTu5yU2t5i6dKvKRtGlvycNTUJIfwYyQoTRsmwOu40U/9 PU9AwzLGLwceF6LbKK5sRCUzy3I3aHeXKXhwTa65IaloKOW6eY7SXt16upa5j9Rkabt0 WV17VzjLjSXKNRxDwgwkhYjskyx9UXxGTa991QuxnMG+VXl2hVMd12TqDExha65AIul4 fEqziaMUY3y/3R5zGoDJCYO8HIq7VbZshfd1GNFrYlCn5B/fK6ExMrZb7nw/krU/kF+6 sjfw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=26ylPeTUKwauoxaVi1z6xco5xaOkWba8wbcA5nPLGlY=; fh=vxUyyXM/8NMPpJt2vF/uiwKHKyjg30BWJlIXcIJYuMo=; b=mXKEMdc9HG60l04Bmk3rBVIJ9VOIOjIBNnm+LS1i4DaFxOfNMjUTNlJnloedxbXM1C tUtDTu+JSXhvegyHPOlVlbiDrLJzfUHnsS2nTpOa8+lO/FfvchUtpnjCD+1cZzcXIPQW AsMaC4j1zbh+qlH9aGjx+BWK6pi0vGjf/xoSySuoK04qNOLETL9DQsHY3nd9uv+UFpYN 41zNKVhnLaRUMmzQx79UVSUx9Lnln4BQKdSxcB+x8rBMFwxJK+vt1/tX1kHbR+Q5UuX4 TkXEmJN6yoJaJGudLQDZ5CGNNF+oEGc3sX1DGPpYbRHnEIEyXKe+9Bi19TNz7fxNBzpR 86eA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xwi6xBms; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id d11-20020a631d4b000000b0055be9543340si10392863pgm.872.2023.11.27.18.11.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 18:11:56 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Xwi6xBms; 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=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by snail.vger.email (Postfix) with ESMTP id 60D1E80A8B77; Mon, 27 Nov 2023 18:11:46 -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 S231623AbjK1CHR (ORCPT + 99 others); Mon, 27 Nov 2023 21:07:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39596 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234367AbjK1CHQ (ORCPT ); Mon, 27 Nov 2023 21:07:16 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9D96A1B1 for ; Mon, 27 Nov 2023 18:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701137241; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=26ylPeTUKwauoxaVi1z6xco5xaOkWba8wbcA5nPLGlY=; b=Xwi6xBmsWf+cGkiQYvW2D+8DGpctYsxNmf5kkFyfzbCxgmCx4RpqUvIg+uioDE0yJEe/t0 E7vpGJUr3T+H+3Prm2mAwVJxpquX5caF2c0UkVMtAfEsUPyLOTcfF0uikcYOJAoulbAUjq 3KdW9XD1+Nt8jLO/mwcmN59ofCRiSEM= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-629-f-boATXjOW2vq0AyQxrXlQ-1; Mon, 27 Nov 2023 21:07:20 -0500 X-MC-Unique: f-boATXjOW2vq0AyQxrXlQ-1 Received: by mail-qv1-f70.google.com with SMTP id 6a1803df08f44-67804869762so60035426d6.0 for ; Mon, 27 Nov 2023 18:07:20 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701137239; x=1701742039; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=26ylPeTUKwauoxaVi1z6xco5xaOkWba8wbcA5nPLGlY=; b=u2I/JhG8Q2z2z+3pl0o94Lfnq4bVvOVcVmn4l+LekaQmiddCnZy4OnnAWoTPETqmo3 osKAIbCl+Y4MtJqd3i6bst5ihodwAf+3RZNVZlYUH/dOLEzm5bmIO7r7AvjCiDPQC6NW XxqZGK6/i7/NBu758ikDCWBGwUlYmFNCa8azeOkH2Cu32HY10yqQ202nyNMEeragp0PN doeyf9XtF9+A7ycbbEoBSY6PJTMMqqcyL5r7JECZMSD/dU/BszEtAGRX5nFD+rjiZVKR /3Zv5TnR9U+cXoYatjvjDO//vEGfBZwEclhBi+WmaCGaWQvLlBm1Ylw5PUkWrkDwFQRo bHJw== X-Gm-Message-State: AOJu0YzoH20b6x1A2HlJ5SjzDcIKIm9oLuFwntMIKfRUazRwOgLpO+Zw plPY561O+rGtmiJ7vO5BuvR2u+CfODF0Gg0bhnzhPvLx1gYJxzuU1CgnvoScRvFswQP2oTtiN5m IgXNLEVmzDmz435FtjseRyxcMuS+iJh4nrjmmnZwk4eSVK2bwI8nhsQ== X-Received: by 2002:ad4:4582:0:b0:67a:2c28:ce06 with SMTP id x2-20020ad44582000000b0067a2c28ce06mr8365654qvu.63.1701137239593; Mon, 27 Nov 2023 18:07:19 -0800 (PST) X-Received: by 2002:ad4:4582:0:b0:67a:2c28:ce06 with SMTP id x2-20020ad44582000000b0067a2c28ce06mr8365639qvu.63.1701137239401; Mon, 27 Nov 2023 18:07:19 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: Pingfan Liu Date: Tue, 28 Nov 2023 10:07:08 +0800 Message-ID: Subject: Re: [PATCH 0/4] kdump: crashkernel reservation from CMA To: Jiri Bohac Cc: Tao Liu , Baoquan He , Vivek Goyal , Dave Young , kexec@lists.infradead.org, linux-kernel@vger.kernel.org, mhocko@suse.cz Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H4,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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]); Mon, 27 Nov 2023 18:11:46 -0800 (PST) On Sun, Nov 26, 2023 at 5:24=E2=80=AFAM Jiri Bohac wrote: > > 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? > I have not a real case in mind. But this problem has kept us from using the CMA area in kdump for years. Most importantly, this method will introduce an uneasy tracking bug. For a way around, maybe you can introduce a specific zone, and for any GUP, migrate the pages away. I have doubts about whether this approach is worthwhile, considering the trade-off between benefits and complexity. Thanks, Pingfan