Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4406564rdh; Tue, 28 Nov 2023 23:58:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IEF2bpcpqO3mTmjHyOq4U02zxGYsZ7hSod+WvApy2qTEy/vYUL+cEhIFeV4w9adFDpORVsY X-Received: by 2002:a05:6808:1188:b0:3ab:83fe:e18f with SMTP id j8-20020a056808118800b003ab83fee18fmr21862248oil.35.1701244701473; Tue, 28 Nov 2023 23:58:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701244701; cv=none; d=google.com; s=arc-20160816; b=CX9jRS73TWf+9MSYnJnI5in6eL2qm57v6R80eBA8xCUhOvNyX4R8cGk+k2fMwD9+RD 0EzYUOUWQIY9mYesmfQYN4/fJIcU7PikHwXtm1esCwRPLfAkKLW0OeTA+984pfBhKtDu VDZ7ynv8DjbKTNNFf0/4HPnROfyrpSHV5ECiIUQYfsw+/B72rzXzVolblZ32qk3jrnjx pGj37nK53LAgcTF6aeZUSSoNFuyHVkAqsoMgWzI+vFLWD6IJTvqhLnjAyZpHYGfwY+5N ovXdGF4PJY9NO55BaIhcJCL2taeGwuaWqO20iwjncEI6UcpaQOWQqpsmO5Bk2+jo7sKt SX0g== 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:dkim-signature; bh=8g8v5NESvRdEm67kdhAr+zNdrT8GqKRlUvJtdOuI41I=; fh=JJT9NTPZpdyYRfisKVfBlcRWUzVtYJGea5NGLKWFboU=; b=oKhW5ZZ6nVaboymPsTrYya/RsGrosExMFZOBW4FA25Hlq9KS8NSPHboMcckHKPP/TN SdY+ni+qlSu3jYVHLmjnrbelwfx55OGBF9g5U3jzo6Klpi4AjTox1DrP1xk3jjRyRu4y l4lHxXgQUbakHre0XS+GXl1gDJ9nsX3B0rvuMeQH0QhgHbeKVdZu5WjSj87xxvHl8t1o sB3JmZ6EU4s2JCPwkrgvPMXv8L9rzY4ZgMhnJsyMcDNPLSErOUYBfXT8Akl5hpDBkzxm RoMymc9PYIQ4uh8MDR+wVrwfP4gMeHXIe1s4StDprO35ZQthLapuCMNrOLZXzRzo4Oic xmXA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="c/Aw02zr"; 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 d6-20020a056a0010c600b006cb63c97b37si14126653pfu.146.2023.11.28.23.58.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 28 Nov 2023 23:58:21 -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="c/Aw02zr"; 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 E161C804750B; Tue, 28 Nov 2023 23:58:18 -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 S229686AbjK2H6D (ORCPT + 99 others); Wed, 29 Nov 2023 02:58:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35208 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229464AbjK2H6C (ORCPT ); Wed, 29 Nov 2023 02:58:02 -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 064A11710 for ; Tue, 28 Nov 2023 23:58:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1701244687; 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: in-reply-to:in-reply-to:references:references; bh=8g8v5NESvRdEm67kdhAr+zNdrT8GqKRlUvJtdOuI41I=; b=c/Aw02zrtWtnfPahmjwKwtPwNOR7B0hYgMTUS1dyYXW6xZyB9ZNJNEMw1owXwH51y/sDas t/ZV9QIo8IZ99BycemWMuwzBOktzBHWr6BOiRh6qWDVRsI5I4dIBHH2SuhXLmCujL2S4uB ShUXw9Kq24jTmralkQCVqL4yEwbT/zY= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-662-m1DTePDEO8qKOmsP5YTK1Q-1; Wed, 29 Nov 2023 02:58:03 -0500 X-MC-Unique: m1DTePDEO8qKOmsP5YTK1Q-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 56053811E7D; Wed, 29 Nov 2023 07:58:03 +0000 (UTC) Received: from localhost (unknown [10.72.112.30]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 84923C1596F; Wed, 29 Nov 2023 07:58:02 +0000 (UTC) Date: Wed, 29 Nov 2023 15:57:59 +0800 From: Baoquan He To: Michal Hocko Cc: Jiri Bohac , Pingfan Liu , Tao Liu , Vivek Goyal , Dave Young , kexec@lists.infradead.org, linux-kernel@vger.kernel.org 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: X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.8 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]); Tue, 28 Nov 2023 23:58:19 -0800 (PST) On 11/28/23 at 10:08am, Michal Hocko wrote: > On Tue 28-11-23 10:11:31, Baoquan He wrote: > > On 11/28/23 at 09:12am, Tao Liu wrote: > [...] > > Thanks for the effort to bring this up, Jiri. > > > > I am wondering how you will use this crashkernel=,cma parameter. I mean > > the scenario of crashkernel=,cma. Asking this because I don't know how > > SUSE deploy kdump in SUSE distros. In SUSE distros, kdump kernel's > > driver will be filter out? If latter case, It's possibly having the > > on-flight DMA issue, e.g NIC has DMA buffer in the CMA area, but not > > reset during kdump bootup because the NIC driver is not loaded in to > > initialize. Not sure if this is 100%, possible in theory? > > NIC drivers do not allocation from movable zones (that includes CMA > zone). In fact kernel doesn't use GFP_MOVABLE for non-user requests. > RDMA drivers might and do transfer from user backed memory but for that > purpose they should be pinning memory (have a look at > __gup_longterm_locked and its callers) and that will migrate away from > the any zone. OK, in that case, we don't need to worry about the risk of DMA. > > [...] > > The crashkernel=,cma requires no userspace data dumping, from our > > support engineers' feedback, customer never express they don't need to > > dump user space data. Assume a server with huge databse deployed, and > > the database often collapsed recently and database provider claimed that > > it's not database's fault, OS need prove their innocence. What will you > > do? > > Don't use CMA backed crash memory then? This is an optional feature. Guess so. As I said earlier, this is more like a nice-to-have feature, can suggest user to try by themselves. Since Jiri didn't give how he will use it. > > > So this looks like a nice to have to me. At least in fedora/rhel's > > usage, we may only back port this patch, and add one sentence in our > > user guide saying "there's a crashkernel=,cma added, can be used with > > crashkernel= to save memory. Please feel free to try if you like". > > Unless SUSE or other distros decides to use it as default config or > > something like that. Please correct me if I missed anything or took > > anything wrong. > > Jiri will know better than me but for us a proper crash memory > configuration has become a real nut. You do not want to reserve too much > because it is effectively cutting of the usable memory and we regularly > hit into "not enough memory" if we tried to be savvy. The more tight you > try to configure the easier to fail that is. Even worse any in kernel > memory consumer can increase its memory demand and get the overall > consumption off the cliff. So this is not an easy to maintain solution. > CMA backed crash memory can be much more generous while still usable. Hmm, Redhat could go in a different way. We have been trying to: 1) customize initrd for kdump kernel specifically, e.g exclude unneeded devices's driver to save memory; 2) monitor device and kenrel memory usage if they begin to consume much more memory than before. We have CI testing cases to watch this. We ever found one NIC even eat up GB level memory, then this need be investigated and fixed. With these effort, our default crashkernel values satisfy most of cases, surely not call cases. Only rare cases need be handled manually, increasing crashkernel. The crashkernel=,high was added in this case, a small low memory under 4G for DMA with crashkernel=,low, a big chunk of high memory above 4G with crashkernel=,high. I can't see where needs are not met. Wondering how you will use this crashkernel=,cma syntax. On normal machines and virt guests, not much meomry is needed, usually 256M or a little more is enough. On those high end systems with hundreds of Giga bytes, even Tera bytes of memory, I don't think the saved memory with crashkernel=,cma make much sense. Taking out 1G memory above 4G as crashkernel won't impact much. So with my understanding, crashkernel=,cma adds an option user can take besides the existing crashkernel=,high. As I have said earlier, in Redhat, we may rebase it to fedora/RHEL and add one sentence into our user guide saying "one another crashkernel=,cma can be use to save memory, please feel free to try if you like." Then that's it. Guess SUSE will check user's configuration, e.g the dump level of makedumpfile, if no user space data needed, crashkernel=,cma is taken, otherwise the normal crashkernel=xM will be chosen? Thanks Baoquan