Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 2046012

Summary: crash: "ps -t" option consumes huge memory and time
Product: Red Hat Enterprise Linux 9 Reporter: lijiang
Component: crashAssignee: lijiang
Status: CLOSED ERRATA QA Contact: xiaoying yan <yiyan>
Severity: medium Docs Contact:
Priority: medium    
Version: 9.0CC: kazuhito.hagio, ruyang, xiawu, yiyan
Target Milestone: rcKeywords: Triaged
Target Release: 9.0Flags: yiyan: needinfo-
pm-rhel: mirror+
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: crash-8.0.0-5.el9 Doc Type: No Doc Update
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-17 13:14:18 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description lijiang 2022-01-26 07:46:46 UTC
Description of problem:

    With some vmlinux e.g. RHEL9 ones, the first execution of the gdb ptype
    command heavily consumes memory and time.  The "ps -t" option uses it in
    start_time_timespec(), and it can be replaced with the crash macros.
    
    This can reduce about 1.4 GB memory and 6 seconds time comsumption in
    the following test:
    
      $ echo "ps -t" | time crash vmlinux vmcore
    
      Without the patch:
      11.60user 0.43system 0:11.94elapsed 100%CPU (0avgtext+0avgdata 1837964maxresident)k
      0inputs+400outputs (0major+413636minor)pagefaults 0swaps
    
      With the patch:
      5.40user 0.16system 0:05.46elapsed 101%CPU (0avgtext+0avgdata 417896maxresident)k
      0inputs+384outputs (0major+41528minor)pagefaults 0swaps


Link: https://www.mail-archive.com/crash-utility@redhat.com/msg08942.html

Version-Release number of selected component (if applicable):


How reproducible:
Always.

Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 lijiang 2022-01-26 07:55:32 UTC
Hi, Kazu

Could you please add additional comments or any concerns about this issue? I will make a scratch build for QE with the following commit, and eventually QE will evaluate if the patch is introduced into RHEL9 this time. Thanks.


Upstream patch:

commit 2ebd8c5ecf1f077975b82325a38dd777b594d0a9 (origin/master, origin/HEAD)
Author: Kazuhito Hagio <k-hagio-ab>
Date:   Wed Jan 19 16:24:49 2022 +0900

    Remove ptype command from "ps -t" option to reduce memory and time
    
    With some vmlinux e.g. RHEL9 ones, the first execution of the gdb ptype
    command heavily consumes memory and time.  The "ps -t" option uses it in
    start_time_timespec(), and it can be replaced with the crash macros.
    
    This can reduce about 1.4 GB memory and 6 seconds time comsumption in
    the following test:
    
      $ echo "ps -t" | time crash vmlinux vmcore
    
      Without the patch:
      11.60user 0.43system 0:11.94elapsed 100%CPU (0avgtext+0avgdata 1837964maxresident)k
      0inputs+400outputs (0major+413636minor)pagefaults 0swaps
    
      With the patch:
      5.40user 0.16system 0:05.46elapsed 101%CPU (0avgtext+0avgdata 417896maxresident)k
      0inputs+384outputs (0major+41528minor)pagefaults 0swaps
    
    Although the ptype command and similar ones cannot be fully removed,
    but removing some of them will make the use of crash safer, especially
    for an automatic crash reporter.

Comment 2 Kazuhito Hagio 2022-01-26 08:09:20 UTC
(In reply to lijiang from comment #1)
> Could you please add additional comments or any concerns about this issue? I
> will make a scratch build for QE with the following commit, and eventually
> QE will evaluate if the patch is introduced into RHEL9 this time. Thanks.

Thank you for creating this bz.

The problem is that the "ps -t" command needlessly executes "ptype" and takes time,
so I've changed the bz subject.

Thanks,
Kazu

Comment 11 errata-xmlrpc 2022-05-17 13:14:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: crash), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2479