Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp1743774ybk; Mon, 11 May 2020 03:14:37 -0700 (PDT) X-Google-Smtp-Source: APiQypJ6w865xyKfEgPcK1jqBUmjpuSyWA1zJzuwusAxpbkfP1H/UYZAk1JWCd4J/AVDX5nqmjxc X-Received: by 2002:aa7:dd91:: with SMTP id g17mr7314372edv.374.1589192077607; Mon, 11 May 2020 03:14:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589192077; cv=none; d=google.com; s=arc-20160816; b=JxAbfg0j3BDnebfgsF829p590rh536oHfUup32yvHzb0q8YIdN9TPA7CguVC7Ij944 5kEIpR5HV/ESMHEiJ0Pkn9a/dQDXAhDm9c9HdqJdixAs1RmAsoQ7ZYzPR4xBxDOYfztH Hz30T++p3j//ZFKsY8tw/YtNEkWX6LSKEDPvhwWpupdyWu91Ea9VFw1yTwsJDy1e3KUm IL3M6tVLt7f2uAlgryNMmlLOQmPlqYQSji41IEbaNcT+Q+RVspU9dbc7v2rlFwxY+/we Mq+oD98sEV37XIvf5NK5V4MY7Rd430ah5diuE0zyblVm9pCxLiFuaJguiplTdmDlYCsU FubQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=8dqwlRs0MIbbYYZ5cTiHH12yPXOUWNjjWHMIX42DRKA=; b=sZgJmC+SpVvPX25yOwXxOcVwzMPLdwzTiwE9nW4LzuykmTJ5nXfAKkZ5vNoMEpqy+C LABR1DJyWoHH0n5j/v/MbIjPVwnnrk5T8hVS0ZkkPWgkD9Kw0lsZ+YNw9Mv4WEfxWsfc WySnh6U+8pNBNcJ9UW2SHQLJz9D75OPzgq7LHSgQRFt2Xnto33JyiOEFgpHQDYinAfyn c1fyE84HmJe8J/rKa3euFYVZlyjvSr6HRr02nr+eANm5hkaLZReWxSey1SYCPyEV44Kn bj1fHDqURy6X33qztBBvPscPT5oZiY71pwxPFzerjqtrGd4l5G0XPmVvaMqBmB0YAv+9 xYHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cwlZ+Ifw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 21si628251ejx.150.2020.05.11.03.14.14; Mon, 11 May 2020 03:14:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=cwlZ+Ifw; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729184AbgEKKLy (ORCPT + 99 others); Mon, 11 May 2020 06:11:54 -0400 Received: from us-smtp-delivery-1.mimecast.com ([207.211.31.120]:42862 "EHLO us-smtp-1.mimecast.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725983AbgEKKLy (ORCPT ); Mon, 11 May 2020 06:11:54 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1589191912; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc; bh=8dqwlRs0MIbbYYZ5cTiHH12yPXOUWNjjWHMIX42DRKA=; b=cwlZ+Ifw6MBmt+FAw1LUQpacznpsSltr+VZONPUZhD0iYRUu9kOFG72N4rEeGDn22UvfaR TRUeOLLNnMxef57BZVshptldOXbMubwlD7rnNXccpJJSHIOoVC3OwerGWBhkea3jmUderU TEAAran2UvYxR3TYmmv3RTdueMtAENg= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-507-fJZyUoPWO7GK1IaZhRqhWA-1; Mon, 11 May 2020 06:11:48 -0400 X-MC-Unique: fJZyUoPWO7GK1IaZhRqhWA-1 Received: by mail-pg1-f200.google.com with SMTP id b131so1371410pga.9 for ; Mon, 11 May 2020 03:11:47 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=8dqwlRs0MIbbYYZ5cTiHH12yPXOUWNjjWHMIX42DRKA=; b=dK8guA1LuDimQXsDmXpDams6Ziy+/mMyMxSB29HHh00Ub5bqYd6jzszYJL7wSPKjtU lamr/9ZsSDVGWYB0nb+eFl1N9JKH5g/hPWRVjZzsn0rIYhGAxQx6n2EveQDWK+86LgT1 NZk2UBrZ3M9kk70JhhHQ54mwWzRPE1HA3ruEQHIsFBFdZS9zsY/dtdz56I0Fq/HiZkCL pWMinYb6lMz7OlfvLUaRGycwDGwyT9xTIpu4sjJWsK5A/PlgIvI7JclrQZRWv1Qs6n37 eAprHfswgXoD5lPcAUBWSHnWbjTWnADobC3CQBoufwc+wb8H8TtbaB8r06tG7hRa62g7 erSQ== X-Gm-Message-State: AGi0PuaAI1jNCRvpjGCEd7PKzQ6BAE8cZ9ZcrdTUrCJKYw1JgfjTL+QR oM4Om7ZMGhR3TbZsMk+QV6ObB9Er8T8RI5f1S8ISWJ4e19qvj8G5OSnrfU527ER1m86eqQFOWID T9vwXGNSBekXCG8vCCLfkK4sg X-Received: by 2002:a17:90a:2344:: with SMTP id f62mr19416883pje.152.1589191907144; Mon, 11 May 2020 03:11:47 -0700 (PDT) X-Received: by 2002:a17:90a:2344:: with SMTP id f62mr19416853pje.152.1589191906709; Mon, 11 May 2020 03:11:46 -0700 (PDT) Received: from localhost ([223.235.87.110]) by smtp.gmail.com with ESMTPSA id h13sm7567956pgm.69.2020.05.11.03.11.45 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 11 May 2020 03:11:46 -0700 (PDT) From: Bhupesh Sharma To: netdev@vger.kernel.org Cc: bhsharma@redhat.com, bhupesh.linux@gmail.com, kexec@lists.infradead.org, linux-kernel@vger.kernel.org, aelior@marvell.com, GR-everest-linux-l2@marvell.com, manishc@marvell.com, davem@davemloft.net, irusskikh@marvell.com Subject: [PATCH v2 0/2] net: Optimize the qed* allocations inside kdump kernel Date: Mon, 11 May 2020 15:41:40 +0530 Message-Id: <1589191902-958-1-git-send-email-bhsharma@redhat.com> X-Mailer: git-send-email 2.7.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Changes since v1: ---------------- - v1 can be seen here: http://lists.infradead.org/pipermail/kexec/2020-May/024935.html - Addressed review comments received on v1: * Removed unnecessary paranthesis. * Used a different macro for minimum RX/TX ring count value in kdump kernel. Since kdump kernel(s) run under severe memory constraint with the basic idea being to save the crashdump vmcore reliably when the primary kernel panics/hangs, large memory allocations done by a network driver can cause the crashkernel to panic with OOM. The qed* drivers take up approximately 214MB memory when run in the kdump kernel with the default configuration settings presently used in the driver. With an usual crashkernel size of 512M, this allocation is equal to almost half of the total crashkernel size allocated. See some logs obtained via memstrack tool (see [1]) below: dracut-pre-pivot[676]: ======== Report format module_summary: ======== dracut-pre-pivot[676]: Module qed using 149.6MB (2394 pages), peak allocation 149.6MB (2394 pages) dracut-pre-pivot[676]: Module qede using 65.3MB (1045 pages), peak allocation 65.3MB (1045 pages) This patchset tries to reduce the overall memory allocation profile of the qed* driver when they run in the kdump kernel. With these optimization we can see a saving of approx 85M in the kdump kernel: dracut-pre-pivot[671]: ======== Report format module_summary: ======== dracut-pre-pivot[671]: Module qed using 124.6MB (1993 pages), peak allocation 124.7MB (1995 pages) <..snip..> dracut-pre-pivot[671]: Module qede using 4.6MB (73 pages), peak allocation 4.6MB (74 pages) And the kdump kernel can save vmcore successfully via both ssh and nfs interfaces. This patchset contains two patches: [PATCH 1/2] - Reduces the default TX and RX ring count in kdump kernel. [PATCH 2/2] - Disables qed SRIOV feature in kdump kernel (as it is normally not a supported kdump target for saving vmcore). [1]. Memstrack tool: https://github.com/ryncsn/memstrack Bhupesh Sharma (2): net: qed*: Reduce RX and TX default ring count when running inside kdump kernel net: qed: Disable SRIOV functionality inside kdump kernel drivers/net/ethernet/qlogic/qed/qed_sriov.h | 10 +++++++--- drivers/net/ethernet/qlogic/qede/qede.h | 2 ++ drivers/net/ethernet/qlogic/qede/qede_main.c | 13 ++++++++++--- 3 files changed, 19 insertions(+), 6 deletions(-) -- 2.7.4