Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp903354rdb; Wed, 6 Dec 2023 03:23:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IGneCo9qFX6kUQWyMhQLBGruM7+1cQ957Wh6qHo1HqzizntB6Zmn6nF3JNVxDEdgUgtDDx4 X-Received: by 2002:a05:6359:6181:b0:170:6675:a50c with SMTP id sb1-20020a056359618100b001706675a50cmr465960rwb.37.1701861824572; Wed, 06 Dec 2023 03:23:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701861824; cv=none; d=google.com; s=arc-20160816; b=MMTJuencBsotS35/D4m231/TGGHGXI/ECLBQX8hpOZcD9n+EID9E9TqYsbS72YL9Rm uAvAIgkrvAv6Y54ZmTD7Y4w86wZA3/W4r94bqO+FtmrHVhpAU42U4aVl/jWtpIXprW7S itSN4j2Ltt1OQle23xucbTiNn+DBnSL5H5JgFDshaCH553QUPRlUNc/DuSs86M5Tq760 XA4R7Pv7Y9wMYQaBq2PEC6EOfpj1diQcIqr9UO7/lf2rXDdp7w1wl4EKIPikMwyvrr6R 4LHFMfKHwKBfeYc6H5EfuugFJTsBFbVBwYoUQsbKNDwVPXcPPqA+8kM2TT9GvFuyCxsf w6Ww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:autocrypt:from:references:cc:to:content-language :subject:user-agent:mime-version:date:message-id:dkim-signature; bh=dTdzAM2G0G6A3InngHk4xwKmBZnIONVNmg6lQUrZqnI=; fh=IGgZajHSG3dzRcJG9sv9X3V77W9UEtqMuL+kYctwRqE=; b=AxN3ljakwhD1NYZuQMnQo8/twrer4yttpoFOLDCIdn/CfaPm/2/WIq3IIBGJbet0kK CYIdTAnE44mKLbJaTJZs1A6kAltfsoszRdgswvJ2Uzo57q7+7eSw5h6TvJZqfNM0A6aR KOo0FbixkfkAjTJBWTWNEI13dDQbqXo1L2ML+pj5Pjx5TC4qJaKQsQCd94MdUxEgWabO dwTIqOXMU69xLgGGdJb2Eaoalts96ZblBZg69I6age4jNbem1vh/5Ws2oQyTRQi0sAkb LwV0hbeviXrFb8BiyCZVK2JSnzzrL7RK3lyHvTUgsYF9Wg4IezCpMa9GMsYh4PEUcIZD X+vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bXwrJeLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id x24-20020aa793b8000000b006ce4d21cc78si5506615pff.170.2023.12.06.03.23.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 03:23:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bXwrJeLW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 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 agentk.vger.email (Postfix) with ESMTP id B7F9080321FA; Wed, 6 Dec 2023 03:23:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1378181AbjLFLX1 (ORCPT + 99 others); Wed, 6 Dec 2023 06:23:27 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378173AbjLFLX0 (ORCPT ); Wed, 6 Dec 2023 06:23:26 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 421DA10A for ; Wed, 6 Dec 2023 03:23:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701861811; 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:autocrypt:autocrypt; bh=dTdzAM2G0G6A3InngHk4xwKmBZnIONVNmg6lQUrZqnI=; b=bXwrJeLWn9OIUjS2ao+6e/qigYTCVLi44okk/2Himy1VDY0VDJzt+yptuydVlsFHjPEmux 5ZXFfA6nwHr1t41oTDWyw9ikibPcwqLimVCap5CfKO2DIT7DTf+tsx2vP1Zbr0G5llrSFz HZxWEhKJbov/uEXXdG8Ckx7YNJqFo1g= Received: from mail-pf1-f200.google.com (mail-pf1-f200.google.com [209.85.210.200]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-490-GW1vRLvuN-63LfC79x39jw-1; Wed, 06 Dec 2023 06:23:30 -0500 X-MC-Unique: GW1vRLvuN-63LfC79x39jw-1 Received: by mail-pf1-f200.google.com with SMTP id d2e1a72fcca58-6ce939ed0f7so353215b3a.1 for ; Wed, 06 Dec 2023 03:23:30 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701861809; x=1702466609; h=content-transfer-encoding:in-reply-to:organization:autocrypt:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=dTdzAM2G0G6A3InngHk4xwKmBZnIONVNmg6lQUrZqnI=; b=rUzpeA/1KmXJD1KaNR4yqXgSatFFsbFhJ57N6eYWV6UixF7TjokFAHq4S/Iv63DY0a dnOvWO0HwURuOkvRsX52zD5CLhB538vuScIOI8d6NYI3dUUuUevxQEGkLVmD9He8CX1A H14xvFsB0cnnoCXlPO3zYj5yPw7ZWWPyli6Ry5ZpBXJn9QNqzBFqnpwZWzzRtllbe8ik kBpHEXFkw4cKJnn3bsd03ghOQAVo/pJdGCFTx146fLeCBHyPNrJZsYfSZsv2j7jl90dp xXRlqLbM2SLjl0J/WK+YXiPAl5BAeDjq9i67GK0tdx4KisenfnuR3GV7sdw/IKQA5qdw vqog== X-Gm-Message-State: AOJu0YywQ47MsLxXXIgSAFnDA6+oilyHhaOMSi7zxlXQDLHzDh84NXjp sdTcjWSgtlQm+dfy9o33YG5hfiWyC1Hunp/cWpdnMZuBtKkkWx2zx13GBYPJC2uAbZktR7VoNG8 AqJZYRikcw7Q+VPsIPnOiRUBY X-Received: by 2002:a05:6a00:218e:b0:6cb:4c60:7398 with SMTP id h14-20020a056a00218e00b006cb4c607398mr357906pfi.13.1701861808921; Wed, 06 Dec 2023 03:23:28 -0800 (PST) X-Received: by 2002:a05:6a00:218e:b0:6cb:4c60:7398 with SMTP id h14-20020a056a00218e00b006cb4c607398mr357899pfi.13.1701861808392; Wed, 06 Dec 2023 03:23:28 -0800 (PST) Received: from ?IPV6:2a09:80c0:192:0:5dac:bf3d:c41:c3e7? ([2a09:80c0:192:0:5dac:bf3d:c41:c3e7]) by smtp.gmail.com with ESMTPSA id x4-20020aa784c4000000b006ce69a70254sm3095744pfn.56.2023.12.06.03.23.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Dec 2023 03:23:27 -0800 (PST) Message-ID: Date: Wed, 6 Dec 2023 12:23:23 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 0/4] kdump: crashkernel reservation from CMA Content-Language: en-US To: Philipp Rudo , Michal Hocko 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 References: <91a31ce5-63d1-7470-18f7-92b039fda8e6@redhat.com> <20231201123353.2b3db7fa@rotkaeppchen> <20231201165113.43211a48@rotkaeppchen> <20231206120805.4fdcb8ab@rotkaeppchen> From: David Hildenbrand Autocrypt: addr=david@redhat.com; keydata= xsFNBFXLn5EBEAC+zYvAFJxCBY9Tr1xZgcESmxVNI/0ffzE/ZQOiHJl6mGkmA1R7/uUpiCjJ dBrn+lhhOYjjNefFQou6478faXE6o2AhmebqT4KiQoUQFV4R7y1KMEKoSyy8hQaK1umALTdL QZLQMzNE74ap+GDK0wnacPQFpcG1AE9RMq3aeErY5tujekBS32jfC/7AnH7I0v1v1TbbK3Gp XNeiN4QroO+5qaSr0ID2sz5jtBLRb15RMre27E1ImpaIv2Jw8NJgW0k/D1RyKCwaTsgRdwuK Kx/Y91XuSBdz0uOyU/S8kM1+ag0wvsGlpBVxRR/xw/E8M7TEwuCZQArqqTCmkG6HGcXFT0V9 PXFNNgV5jXMQRwU0O/ztJIQqsE5LsUomE//bLwzj9IVsaQpKDqW6TAPjcdBDPLHvriq7kGjt WhVhdl0qEYB8lkBEU7V2Yb+SYhmhpDrti9Fq1EsmhiHSkxJcGREoMK/63r9WLZYI3+4W2rAc UucZa4OT27U5ZISjNg3Ev0rxU5UH2/pT4wJCfxwocmqaRr6UYmrtZmND89X0KigoFD/XSeVv jwBRNjPAubK9/k5NoRrYqztM9W6sJqrH8+UWZ1Idd/DdmogJh0gNC0+N42Za9yBRURfIdKSb B3JfpUqcWwE7vUaYrHG1nw54pLUoPG6sAA7Mehl3nd4pZUALHwARAQABzSREYXZpZCBIaWxk ZW5icmFuZCA8ZGF2aWRAcmVkaGF0LmNvbT7CwZgEEwEIAEICGwMGCwkIBwMCBhUIAgkKCwQW AgMBAh4BAheAAhkBFiEEG9nKrXN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RMe2tRL06BGiRZr jPrnvUsUUsjRoRNJjKKA/REq+sAnhkNPPZ/NNMjaZ5b8Tovi8C0tmxiCHaQYqj7G2rgnT0kt WNyWQQ== Organization: Red Hat In-Reply-To: <20231206120805.4fdcb8ab@rotkaeppchen> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,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 agentk.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 (agentk.vger.email [0.0.0.0]); Wed, 06 Dec 2023 03:23:42 -0800 (PST) On 06.12.23 12:08, Philipp Rudo wrote: > On Fri, 1 Dec 2023 17:59:02 +0100 > Michal Hocko wrote: > >> On Fri 01-12-23 16:51:13, Philipp Rudo wrote: >>> On Fri, 1 Dec 2023 12:55:52 +0100 >>> Michal Hocko wrote: >>> >>>> On Fri 01-12-23 12:33:53, Philipp Rudo wrote: >>>> [...] >>>>> And yes, those are all what-if concerns but unfortunately that is all >>>>> we have right now. >>>> >>>> Should theoretical concerns without an actual evidence (e.g. multiple >>>> drivers known to be broken) become a roadblock for this otherwise useful >>>> feature? >>> >>> Those concerns aren't just theoretical. They are experiences we have >>> from a related feature that suffers exactly the same problem regularly >>> which wouldn't exist if everybody would simply work "properly". >> >> What is the related feature? > > kexec > >>> And yes, even purely theoretical concerns can become a roadblock for a >>> feature when the cost of those theoretical concerns exceed the benefit >>> of the feature. The thing is that bugs will be reported against kexec. >>> So _we_ need to figure out which of the shitty drivers caused the >>> problem. That puts additional burden on _us_. What we are trying to >>> evaluate at the moment is if the benefit outweighs the extra burden >>> with the information we have at the moment. >> >> I do understand your concerns! But I am pretty sure you do realize that >> it is really hard to argue theoreticals. Let me restate what I consider >> facts. Hopefully we can agree on these points >> - the CMA region can be used by user space memory which is a >> great advantage because the memory is not wasted and our >> experience has shown that users do care about this a lot. We >> _know_ that pressure on making those reservations smaller >> results in a less reliable crashdump and more resources spent >> on tuning and testing (especially after major upgrades). A >> larger reservation which is not completely wasted for the >> normal runtime is addressing that concern. >> - There is no other known mechanism to achieve the reusability >> of the crash kernel memory to stop the wastage without much >> more intrusive code/api impact (e.g. a separate zone or >> dedicated interface to prevent any hazardous usage like RDMA). >> - implementation wise the patch has a very small footprint. It >> is using an existing infrastructure (CMA) and it adds a >> minimal hooking into crashkernel configuration. >> - The only identified risk so far is RDMA acting on this memory >> without using proper pinning interface. If it helps to have a >> statement from RDMA maintainers/developers then we can pull >> them in for a further discussion of course. >> - The feature requires an explicit opt-in so this doesn't bring >> any new risk to existing crash kernel users until they decide >> to use it. AFAIU there is no way to tell that the crash kernel >> memory used to be CMA based in the primary kernel. If you >> believe that having that information available for >> debugability would help then I believe this shouldn't be hard >> to add. I think it would even make sense to mark this feature >> experimental to make it clear to users that this needs some >> time before it can be marked production ready. >> >> I hope I haven't really missed anything important. The final > > 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. > > With that I don't see a chance this series can be included unless > someone can explain me that that the documentation is wrong or I > understood it wrong. I think you are right. We'd have to disallow any FOLL_PIN on these CMA pages, or find other ways of handling that (detect that there are no short-term pins any). But, I'm also wondering how MMU-notifier-based approaches might interfere, where CMA pages might be transparently mapped into secondary MMUs, possibly having DMA going on. Are we sure that all these secondary MMUs are inactive as soon as we kexec? -- Cheers, David / dhildenb