Received: by 2002:ac0:a679:0:0:0:0:0 with SMTP id p54csp541994imp; Wed, 20 Feb 2019 04:53:23 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia/DmdL4+mmL6Qv4vVyMnbeomlskRWIMm4TmpOxNbDBf8Qbd3AorWEpJv+7kMWLjRm8U40U X-Received: by 2002:a17:902:9341:: with SMTP id g1mr10524857plp.80.1550667203910; Wed, 20 Feb 2019 04:53:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550667203; cv=none; d=google.com; s=arc-20160816; b=ZHW4JDCqGheMU4nYAdrFlH64XzW1aZ86OA+6HmziDKt0VccjrTUUuesDs0k+vL3Kwv FAWk++isIG7wxPjNIywKgjjwBR/ghSZJI7pEtercHBMajY02WfHQZy3Zz72dtC8WuPR3 G/+SX64YDQshV1t/DoeYlbKzCzC3BH0apFFqDH9nTuJgi4jDl/nmlJiRs7f8rEeOOJuW dFnmVH7pQzKrdH3b14vY/aw3h1hJ0r+2DAOApcWet6BHYCY/iopsndnMo5RLdJj6K2HO ZgMY2fd9muHIS9drMPbOD93ax6HZ6OkpUqZCcgZncFRYIrCzRuwbvcpNW/Jh6moX8oa4 P5Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=0OShJ4IKPAZAJ1bKiE/tE2b7iqayfrWeOVFDf6LYzjg=; b=z+qeq2eDjG8qGwai0golacqll04fbPcyxim9l0S+M7aucAsJhkmELiZrGaFEA06ra5 0iMSJVO+IU1ySPMq6cTRZH3ym4NRgeiuLa14GdOZeWL1cLJYs0Cl8jPbSKpn2Yk9rras 2ozJfySFZ3hXvlUx/VQqmbNo/ouBJki2q0A2MXoFSQU7CdG5u2CsVNGhHdoUY2pBxUwF W4CUM35Cta45SHMCVoq5L++J4+0MsKxviesCnZ2lEeElgo7lp1VwM8nAvEys/QriXI/6 gGlUKKNRWL1H9WXYKVWPkYEMXSQKEn16kHpZZZ6AC0gOFVJVTw++9XxThZDIILUNEf/B Lh9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H5MFkkrc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g129si18576616pgc.593.2019.02.20.04.53.08; Wed, 20 Feb 2019 04:53:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=H5MFkkrc; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728129AbfBTMwH (ORCPT + 99 others); Wed, 20 Feb 2019 07:52:07 -0500 Received: from mail-it1-f193.google.com ([209.85.166.193]:39912 "EHLO mail-it1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727409AbfBTMwG (ORCPT ); Wed, 20 Feb 2019 07:52:06 -0500 Received: by mail-it1-f193.google.com with SMTP id l15so15096620iti.4 for ; Wed, 20 Feb 2019 04:52:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=0OShJ4IKPAZAJ1bKiE/tE2b7iqayfrWeOVFDf6LYzjg=; b=H5MFkkrcBxtFGXzmeHE0xTfEKwy3Obb8KqNDiQfH6fHzwV0B/T6BI0Bu7PQlCr91KS nkxH3y3/wVNmdVY7jGF54QCYJPA8/2WLwpZz6LOF12z13J3oYdNH3qr8rMPEV6BZ6KW+ oQdzNXLOCoaJrYwXu5CUya40sBtV/Cfy0FINPR6xud9Ul401wBY3oiyDeO86RtooFUtF NgQuaRpQaD377zOUizUMGcxr/CSvZ33TGdLvUAwCY7Pf5UnVOK/elXP99lxRkk7fQIW0 ecAEHud9UqGNUB2w9tzJ5SYczMY4rNTET8Pz9xBZ3u2DZCGIt0beO10d/1kCSSlQrZVW kCrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=0OShJ4IKPAZAJ1bKiE/tE2b7iqayfrWeOVFDf6LYzjg=; b=ZwjF3Q7SL8fP2eRxCfzmYZuJNQepQ5utErbSRE8OqxBVsmVj5whhAwwHbB+VQOEA1D NNYOV6izyGe8sl7ljUuT7Qks+dDEwQFxFBnzGmCmBVXR4mQNnr3OAG2f0ZBZG3DdsM0q M/eiMCgBwdWer6ENhcBwcuaKvFqN2AyVoFJx3uYme95QmKKg3XfSbzRE74BQDbfrpDl2 n3fLh6FOEDPFLabEH/yBcb/sE8ejOQ5QepZ/fssVKBsRpDFdwsM429L/n4KBVS+z2/Ju VnfhVjNdtxJsN3LsaSvUTxN0OBKWQ8Iaf5XE/tpDKNtvoytjzEpC0gFI8Y2z6LPYd8Ol iQhg== X-Gm-Message-State: AHQUAua02V/XLAOtxhh3tA7+oFrb21CTDMDHUbJe+prd9ohvsgNMnwb2 N1cnd2BEPVBzVRLrB1a3rp0b6YPczRXHJGg6og== X-Received: by 2002:a6b:1583:: with SMTP id 125mr19483027iov.102.1550667125498; Wed, 20 Feb 2019 04:52:05 -0800 (PST) MIME-Version: 1.0 References: <20190131105732.GC6749@zn.tnic> <20190131222732.GA946@anatevka> <20190131234740.GO6749@zn.tnic> <20190204223016.GB11986@anatevka> <20190205081552.GG21801@zn.tnic> <20190206120804.GC10062@dhcp-128-65.nay.redhat.com> <20190211204816.GB21473@dhcp-128-65.nay.redhat.com> <20190215102458.GD10433@zn.tnic> <20190218014820.GA10711@dhcp-128-65.nay.redhat.com> <20190220083241.GA3447@zn.tnic> <20190220094146.GA8597@dhcp-128-65.nay.redhat.com> In-Reply-To: <20190220094146.GA8597@dhcp-128-65.nay.redhat.com> From: Pingfan Liu Date: Wed, 20 Feb 2019 20:51:53 +0800 Message-ID: Subject: Re: [PATCHv7] x86/kdump: bugfix, make the behavior of crashkernel=X consistent with kaslr To: Dave Young Cc: Borislav Petkov , Baoquan He , Jerry Hoemann , x86@kernel.org, Randy Dunlap , kexec@lists.infradead.org, LKML , Mike Rapoport , Andrew Morton , Yinghai Lu , vgoyal@redhat.com, iommu@lists.linux-foundation.org, konrad.wilk@oracle.com, Joerg Roedel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 20, 2019 at 5:41 PM Dave Young wrote: > > On 02/20/19 at 09:32am, Borislav Petkov wrote: > > On Mon, Feb 18, 2019 at 09:48:20AM +0800, Dave Young wrote: > > > It is ideal if kernel can do it automatically, but I'm not sure if > > > kernel can predict the swiotlb reserved size automatically. > > > > Do you see how even more absurd this gets? > > > > If the kernel cannot know the swiotlb reserved size automatically, how > > is the normal user even supposed to know?! > > I think swiotlb is bounce-buffer, if we enlarge it, we can get better performance. Default size should be enough for platform to work. But in case of reserving low memory for crashkernel, things are different. The reserve low memory = swiotlb_size_or_default() + DMA32 memory for devices. And the 2nd item in the right of the equation varies, based on machine type and dynamic payload > > I see swiotlb_size_or_default() so we have a sane default which we fall > > back to. Now where's the problem with that? > > Good question, I expect some answer from people who know more about the > background. It would be good to have some actual test results, Pingfan > is trying to do some tests. > Not following the idea, I do not think the following test result can tell much. (We need various type of machine to get a final result.) I do a quick test on "HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10", command line "crashkernel=180M,high crashkernel=64M,low" can work for the 2nd kernel. Although it complained some memory shortage issue: [ 7.655591] fbcon: mgadrmfb (fb0) is primary device [ 7.655639] Console: switching to colour frame buffer device 128x48 [ 7.660609] systemd-udevd: page allocation failure: order:0, mode:0x280d4 [ 7.660611] CPU: 0 PID: 180 Comm: systemd-udevd Not tainted 3.10.0-957.el7.x86_64 #1 [ 7.660612] Hardware name: HPE ProLiant DL380 Gen10/ProLiant DL380 Gen10, BIOS U30 06/20/2018 [ 7.660612] Call Trace: [ 7.660621] [] dump_stack+0x19/0x1b [ 7.660625] [] warn_alloc_failed+0x110/0x180 [ 7.660628] [] __alloc_pages_slowpath+0x6b6/0x724 [ 7.660631] [] __alloc_pages_nodemask+0x405/0x420 [ 7.660633] [] alloc_pages_current+0x98/0x110 [ 7.660638] [] ttm_pool_populate+0x3d2/0x4b0 [ttm] [ 7.660641] [] ttm_tt_populate+0x7d/0x90 [ttm] [ 7.660644] [] ttm_bo_kmap+0x124/0x240 [ttm] [ 7.660648] [] ? __wake_up_sync_key+0x4f/0x60 [ 7.660650] [] mga_dirty_update+0x25e/0x310 [mgag200] [ 7.660653] [] mga_imageblit+0x2f/0x40 [mgag200] [ 7.660657] [] soft_cursor+0x1ba/0x260 [ 7.660659] [] bit_cursor+0x663/0x6a0 [ 7.660662] [] ? console_trylock+0x19/0x70 [ 7.660664] [] fbcon_cursor+0x13d/0x1c0 [ 7.660665] [] ? bit_clear+0x120/0x120 [ 7.660668] [] hide_cursor+0x2e/0xa0 [ 7.660669] [] redraw_screen+0x188/0x270 [ 7.660671] [] do_bind_con_driver+0x316/0x340 [ 7.660672] [] do_take_over_console+0x49/0x60 [ 7.660674] [] do_fbcon_takeover+0x63/0xd0 [ 7.660675] [] fbcon_event_notify+0x61d/0x730 [ 7.660678] [] notifier_call_chain+0x4f/0x70 [ 7.660681] [] __blocking_notifier_call_chain+0x4d/0x70 [ 7.660683] [] blocking_notifier_call_chain+0x16/0x20 [ 7.660684] [] fb_notifier_call_chain+0x1b/0x20 [ 7.660686] [] register_framebuffer+0x1f6/0x340 [ 7.660690] [] __drm_fb_helper_initial_config_and_unlock+0x252/0x3e0 [drm_kms_helper] [ 7.660694] [] drm_fb_helper_initial_config+0x3e/0x50 [drm_kms_helper] [ 7.660697] [] mgag200_fbdev_init+0xe3/0x100 [mgag200] [ 7.660699] [] mgag200_modeset_init+0x154/0x1d0 [mgag200] [ 7.660701] [] mgag200_driver_load+0x41d/0x5b0 [mgag200] [ 7.660708] [] drm_dev_register+0x15f/0x1f0 [drm] [ 7.660711] [] ? pci_enable_device_flags+0xe8/0x140 [ 7.660718] [] drm_get_pci_dev+0x8a/0x1a0 [drm] [ 7.660720] [] mga_pci_probe+0x9b/0xc0 [mgag200] [ 7.660722] [] local_pci_probe+0x4a/0xb0 [ 7.660723] [] pci_device_probe+0x109/0x160 [ 7.660726] [] driver_probe_device+0xc5/0x3e0 [ 7.660727] [] __driver_attach+0x93/0xa0 [ 7.660728] [] ? __device_attach+0x50/0x50 [ 7.660730] [] bus_for_each_dev+0x75/0xc0 [ 7.660731] [] driver_attach+0x1e/0x20 [ 7.660733] [] bus_add_driver+0x200/0x2d0 [ 7.660734] [] driver_register+0x64/0xf0 [ 7.660735] [] __pci_register_driver+0xa5/0xc0 [ 7.660737] [] ? 0xffffffffc012cfff [ 7.660739] [] mgag200_init+0x39/0x1000 [mgag200] [ 7.660742] [] do_one_initcall+0xba/0x240 [ 7.660745] [] load_module+0x272c/0x2bc0 [ 7.660748] [] ? ddebug_proc_write+0x100/0x100 [ 7.660750] [] SyS_init_module+0xef/0x140 [ 7.660752] [] system_call_fastpath+0x22/0x27 [ 7.660753] Mem-Info: [ 7.660756] active_anon:3364 inactive_anon:6661 isolated_anon:0 [ 7.660756] active_file:0 inactive_file:0 isolated_file:0 [ 7.660756] unevictable:0 dirty:0 writeback:0 unstable:0 [ 7.660756] slab_reclaimable:1492 slab_unreclaimable:3116 [ 7.660756] mapped:1223 shmem:8449 pagetables:179 bounce:0 [ 7.660756] free:20626 free_pcp:0 free_cma:0 [ 7.660761] Node 0 DMA free:0kB min:4kB low:4kB high:4kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:564kB managed:448kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes [ 7.660762] lowmem_reserve[]: 0 0 152 152 [ 7.660766] Node 0 DMA32 free:0kB min:0kB low:0kB high:0kB active_anon:0kB inactive_anon:0kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:65536kB managed:0kB mlocked:0kB dirty:0kB writeback:0kB mapped:0kB shmem:0kB slab_reclaimable:0kB slab_unreclaimable:0kB kernel_stack:0kB pagetables:0kB unstable:0kB bounce:0kB free_pcp:0kB local_pcp:0kB free_cma:0kB writeback_tmp:0kB pages_scanned:0 all_unreclaimable? yes [ 7.660767] lowmem_reserve[]: 0 0 152 152 [ 7.660771] Node 0 Normal free:82504kB min:1572kB low:1964kB high:2356kB active_anon:13456kB inactive_anon:26644kB active_file:0kB inactive_file:0kB unevictable:0kB isolated(anon):0kB isolated(file):0kB present:183740kB managed:158716kB mlocked:0kB dirty:0kB writeback:0kB mapped:4892kB shmem:33796kB slab_reclaimable:5968kB slab_unreclaimable:12464kB kernel_stack:784kB pagetables:716kB unstable:0kB bounce:0kB free_pcp:[ 8.722693] Microsemi PQI Driver (v1.1.4-115) > Previously Joerg posted below patch, maybe he has some idea. Joerg? > > commit 94fb9334182284e8e7e4bcb9125c25dc33af19d4 > Author: Joerg Roedel > Date: Wed Jun 10 17:49:42 2015 +0200 > > x86/crash: Allocate enough low memory when crashkernel=high > > Thanks > Dave