From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id CE79CA053D; Tue, 4 Aug 2020 01:23:05 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 16E82F64; Tue, 4 Aug 2020 01:23:05 +0200 (CEST) Received: from EUR03-VE1-obe.outbound.protection.outlook.com (mail-eopbgr50060.outbound.protection.outlook.com [40.107.5.60]) by dpdk.org (Postfix) with ESMTP id D2856255 for ; Tue, 4 Aug 2020 01:23:03 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UnyDriFTSm8bdpljRdFWKRNhSdXeyq3MGl6zpNL9QKE=; b=zmIZt9G4UMbSuud36vOWvlC0g3vYz+StgQ13C35unEFoYQlxK6TE8Sf43tyJFNLQpGOv1/01ByLfNgLAP3KycwTr7jiE27lB1dDsppQu+LSgnudjQG7V5Mg62aORrEPCvC2PUSzQ1C4GCyDQIu0u/feEWyH2hslVviM7IGx38j0= Received: from AM0PR04CA0141.eurprd04.prod.outlook.com (2603:10a6:208:55::46) by PR3PR08MB5740.eurprd08.prod.outlook.com (2603:10a6:102:87::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20; Mon, 3 Aug 2020 23:22:59 +0000 Received: from AM5EUR03FT017.eop-EUR03.prod.protection.outlook.com (2603:10a6:208:55:cafe::74) by AM0PR04CA0141.outlook.office365.com (2603:10a6:208:55::46) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.17 via Frontend Transport; Mon, 3 Aug 2020 23:22:59 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 63.35.35.123) smtp.mailfrom=arm.com; dpdk.org; dkim=pass (signature was verified) header.d=armh.onmicrosoft.com;dpdk.org; dmarc=bestguesspass action=none header.from=arm.com; Received-SPF: Pass (protection.outlook.com: domain of arm.com designates 63.35.35.123 as permitted sender) receiver=protection.outlook.com; client-ip=63.35.35.123; helo=64aa7808-outbound-1.mta.getcheckrecipient.com; Received: from 64aa7808-outbound-1.mta.getcheckrecipient.com (63.35.35.123) by AM5EUR03FT017.mail.protection.outlook.com (10.152.16.89) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.20 via Frontend Transport; Mon, 3 Aug 2020 23:22:59 +0000 Received: ("Tessian outbound a0fc03de1592:v63"); Mon, 03 Aug 2020 23:22:58 +0000 X-CR-MTA-TID: 64aa7808 Received: from 2ee7a02c5240.2 by 64aa7808-outbound-1.mta.getcheckrecipient.com id EAF67CE1-304F-41E7-B6C4-C7E0860DA69A.1; Mon, 03 Aug 2020 23:22:53 +0000 Received: from EUR05-VI1-obe.outbound.protection.outlook.com by 64aa7808-outbound-1.mta.getcheckrecipient.com with ESMTPS id 2ee7a02c5240.2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384); Mon, 03 Aug 2020 23:22:53 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SBBaDsoZ5tPojCqWhYTevTegzaYhbUaQ6IHVOSmiyqLRJ5kkds02UWWKhBKbmgtFR3jqJ7f+vPfX8xjTJjHdY71aqL1BuSggnFVzyaQmYcZoGen18mfz0+cRfqXDHdkWMav46PoWdk2lr25rGBh0b9gy+Z1ECYIGdSjqXRnss0/Hf6T++KLgyIKbT5KqALAAajYloCravfcCXbhuBfQikqCPUC71uPpDRE6UdRmmaSQ7llR12f/kLbimgXGUyh+bKHilwbKRPAxu8xRdDehDeDkgqJGaV7gbu1i163fINgFv1+P606vzuHBVrMfpaIpLRtRDc/OwFRY6I8DTrh0H0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UnyDriFTSm8bdpljRdFWKRNhSdXeyq3MGl6zpNL9QKE=; b=X8kzO8epPVejrfqlb5yqv984j+MvhHnue0tBsaN9wELtHGYFaZsXYHFMuPSy4BEFD4ktcB+t6x+qPHmd4U0SEO+5rvUdPJG0juUvCGdyME0Tb50INZkm2jXZRGcZOIm8errwS+spf1TqDG+Hj3kCE97p7awYntp3jz/6xzWcPriaonJO43PcHy1VOVGtEivvYQIw0mKnNFlyvCrUcaI5ASfJiI8Dav+ufifpMoe35lLLdNylFmLwT8/opFWrJjoZ+d9PLO0geURllTzEyrwvHPxaW5r/TQIfr3UrGXjsKX+kb/Slwp1cn/Y+mwZcXSt3qaRtwYGmnhXYhs8Lc4BMqw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=arm.com; dmarc=pass action=none header.from=arm.com; dkim=pass header.d=arm.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=armh.onmicrosoft.com; s=selector2-armh-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=UnyDriFTSm8bdpljRdFWKRNhSdXeyq3MGl6zpNL9QKE=; b=zmIZt9G4UMbSuud36vOWvlC0g3vYz+StgQ13C35unEFoYQlxK6TE8Sf43tyJFNLQpGOv1/01ByLfNgLAP3KycwTr7jiE27lB1dDsppQu+LSgnudjQG7V5Mg62aORrEPCvC2PUSzQ1C4GCyDQIu0u/feEWyH2hslVviM7IGx38j0= Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com (2603:10a6:4:85::9) by DB8PR08MB5017.eurprd08.prod.outlook.com (2603:10a6:10:ef::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.3239.16; Mon, 3 Aug 2020 23:22:51 +0000 Received: from DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d]) by DB6PR0802MB2216.eurprd08.prod.outlook.com ([fe80::9d1d:207b:e89d:199d%10]) with mapi id 15.20.3239.021; Mon, 3 Aug 2020 23:22:51 +0000 From: Honnappa Nagarahalli To: Lewis Donzis , "dev@dpdk.org" CC: nd , Honnappa Nagarahalli , nd Thread-Topic: CPU hog & memory leak on FreeBSD Thread-Index: AdZp7P9+CjpV23lCQQe6r8EkeLpQjA== Date: Mon, 3 Aug 2020 23:22:51 +0000 Message-ID: References: <1748858460.2301535.1596483785377.JavaMail.zimbra@donzis.com> In-Reply-To: <1748858460.2301535.1596483785377.JavaMail.zimbra@donzis.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ts-tracking-id: 848d5971-6244-47d1-aaaa-4f8580e36f5c.0 x-checkrecipientchecked: true Authentication-Results-Original: perftech.com; dkim=none (message not signed) header.d=none; perftech.com; dmarc=none action=none header.from=arm.com; x-originating-ip: [217.140.110.7] x-ms-publictraffictype: Email X-MS-Office365-Filtering-HT: Tenant X-MS-Office365-Filtering-Correlation-Id: d946b69e-81d4-4e6b-2407-08d8380428f4 x-ms-traffictypediagnostic: DB8PR08MB5017:|PR3PR08MB5740: x-ms-exchange-transport-forked: True X-Microsoft-Antispam-PRVS: x-checkrecipientrouted: true nodisclaimer: true x-ms-oob-tlc-oobclassifiers: OLM:10000;OLM:10000; X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Untrusted: BCL:0; X-Microsoft-Antispam-Message-Info-Original: GhPf5Zjl+zoMQyl03SQJn47oJ7kCwNc2ucA4Rlh1FeiBXMbio+K9oDMwhXCf/6MdXn2ZV4KDMpvwxBX1UbXuUW6KyVjR4Xf2K5Sda+jD/tGo/9dN9nHc+od6c4mrTYYtRzJdDtuaAe1Kmrt+j5j2Hd83tNvwU3xp4DmHp6G95FYD84rjMyKZOWnNq+VneeSF6QBTxpsqsQIXmJeMFdWUDmjHBs8605g+49xBuTN0xaIJjrudmjJ1suMfGlZoh9x5Zuf7XDpRYKOMQ/imfdVZQIzyWTgv42e6IyQtMxr7dRmaUlixPwimofmz8v5K0F+7Up0CjtpxPsc0xE5Sz3uy1Q== X-Forefront-Antispam-Report-Untrusted: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DB6PR0802MB2216.eurprd08.prod.outlook.com; PTR:; CAT:NONE; SFTY:; SFS:(4636009)(366004)(39860400002)(136003)(376002)(396003)(346002)(8676002)(316002)(186003)(53546011)(71200400001)(66946007)(33656002)(478600001)(2906002)(110136005)(54906003)(6506007)(7696005)(64756008)(66446008)(66556008)(66476007)(86362001)(4326008)(76116006)(26005)(5660300002)(83380400001)(52536014)(9686003)(8936002)(55016002); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata: sfi6PICd8UkZOaqV5dELuPn0w8OU04yh3kzy4zw/tP3rGYoI1k7inYPp8f6BHRLnI/6/Oa57KwI8craSHu6jI2WxTLRzAyU6WGBBeVqM/L+ibaV5hSwRkOjc73l82OH5Sm+sRpeS/XJ7dPQQVBQG5x5Epwg1yBaqEkZc75pa5eVj5+TQK1jyMzjcmaGqbcN8GmDpbKUkUrPQ6rKw1zw9x8ZJ6nSOpRaGMgXJpbZp7uPf9Gd2iCK3p7t3+oud6yAUG2g/EzqsV8MpEtR+MEJAzhkZeYbpnC9eL4AG/sKijNqbt+RzPpctPgmCpRS4ndMvvgh8BHvU4K5zhbN7CdMfncMq2bh87d6nP8Xs/l6ypmfZKfh4xur6uyFORkF1JQRtnLPLtWk54nGCnsB/0sq6CEYtEJ1gpKE5ltuShvslgTMsnY86/+KA4JjbtKdJXiiRI6wWXo4nFZ44sScCnP/Hrb1mauoanGrDoTAsFgC33JDTroUk6sdTJCpVzqyS4n1ushfBJJLH2rF913SXvaUjRWKmU8UcWRrgVJT7phamTS4xQ5t0KJZwDszCQXABC8Rb97+8hjdv65kpZpWVXD8n6xdGpGWlO/uTDUYpXc0+mQEJ34fWqaaXa9thYqxEamH/1lABT1K+ikCwlya6KKnVyA== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB8PR08MB5017 Original-Authentication-Results: perftech.com; dkim=none (message not signed) header.d=none; perftech.com; dmarc=none action=none header.from=arm.com; X-EOPAttributedMessage: 0 X-MS-Exchange-Transport-CrossTenantHeadersStripped: AM5EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Office365-Filtering-Correlation-Id-Prvs: 9e70d8ac-325c-4a93-08e4-08d8380424ad X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: CD6gnK5aEwj1F+Ks0tkzd+wfruzUacLDfMdiHVx91yNTTZ0LmCnkr4DdbGBatAvqQjevHuA5pArPaDLr0VM7j5rXsN+Ir2thFDNOHnYDER3tYFaZ9j4JUz956zyAMj4lsGa+oIGvL117T+2H0sa7D8VyAGtxC5e4yfRSKNZ3JwUCTw/mSz9Bbm9gqa4YXK89DTqsr3HBAkyMr7O7Cuvw8Bu5c4oP0NKT/w/vtYAewk7SvAMLvB4MTxdKXc1YHpg2DRqnuT0KSI5rJFKoGf88XjZhn37I8nNvJ3x7Vhv3/L0T0O1q/0ZcUfMLAdnqYt/bfkPxcMQ6PLvR98SFOO9dq1WD111xkip9Eic3EavHxGylkWUcGDem41yf6C3raom4Mqh64uCatmz5KJuwKitSiQ== X-Forefront-Antispam-Report: CIP:63.35.35.123; CTRY:IE; LANG:en; SCL:1; SRV:; IPV:CAL; SFV:NSPM; H:64aa7808-outbound-1.mta.getcheckrecipient.com; PTR:ec2-63-35-35-123.eu-west-1.compute.amazonaws.com; CAT:NONE; SFTY:; SFS:(4636009)(39860400002)(136003)(376002)(396003)(346002)(46966005)(8676002)(70586007)(81166007)(47076004)(83380400001)(70206006)(82740400003)(186003)(336012)(9686003)(26005)(53546011)(2906002)(8936002)(7696005)(86362001)(33656002)(55016002)(478600001)(6506007)(82310400002)(54906003)(110136005)(52536014)(5660300002)(4326008)(316002)(36906005)(356005); DIR:OUT; SFP:1101; X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 03 Aug 2020 23:22:59.0418 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d946b69e-81d4-4e6b-2407-08d8380428f4 X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=f34e5979-57d9-4aaa-ad4d-b122a662184d; Ip=[63.35.35.123]; Helo=[64aa7808-outbound-1.mta.getcheckrecipient.com] X-MS-Exchange-CrossTenant-AuthSource: AM5EUR03FT017.eop-EUR03.prod.protection.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PR3PR08MB5740 Subject: Re: [dpdk-dev] CPU hog & memory leak on FreeBSD X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hello, I can take a look if you can post the patch. > -----Original Message----- > From: dev On Behalf Of Lewis Donzis > Sent: Monday, August 3, 2020 2:43 PM > To: dev@dpdk.org > Subject: [dpdk-dev] CPU hog & memory leak on FreeBSD >=20 > Hello. >=20 > We've posted about this before, but I'm hoping to find someone willing to > commit a patched version of lib/librte_eal/bsdapp/eal/eal_interrupts.c th= at > corrects a memory leak and 100% CPU hog that is immediately noticeable > with the i40e driver, at a minimum. We have modified this file to correct= the > problem, and would be happy to provide it back to whomever is a committer > for this. If you can send a patch, I can take a look. >=20 > The detailed explanation is: >=20 > Currently, s etting an alarm with rte_eal_alarm_set() registers an alarm > interrupt by calling rte_intr_callback_register(), which links the callba= ck > function (eal_alarm_callback) onto a list for that source and sets up a o= ne- > shot timer via kevent. Setting additional alarms links them on to the > alarm_list, but also calls rte_eal_alarm_set() again, which links the cal= lback > function onto the source callback list again. >=20 > When the alarm triggers and eal_alarm_callback() gets called, it goes dow= n > the list of pending alarms, calling as many callback functions as possibl= e and > removing each one from the list until it reaches one which has not yet ex= pired. > Once it's done, if alarm_list is not empty, it calls rte_intr_callback_re= gister(), > which then links yet another callback onto the interrupt source's list, t= hus > creating an infinite loop. >=20 > The problem is that the source callback list grows infinitely under this > condition (essentially, when more than one alarm is queued). However, the > call is necessary in order to reset the kevent timer. >=20 > The proposed fix recognizes and leverages the fact that an alarm interrup= t in > FreeBSD should never have more than one callback on its list, so if Is your fix applicable only for FreeBSD? > rte_intr_callback_register() is called with an interrupt handle type of > RTE_INTR_HANDLE_ALARM, and if such an interrupt type already has a non- > empty list, then a new callback is not created, but the kevent timer is > restarted properly. >=20 > A much simpler change is possible if we don't mind the overhead of alloca= ting, > filling-in, linking, de-linking, and freeing a callback unnecessarily. Th= is > proposed change makes every attempt to avoid that overhead.