From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id E52B4A00C5 for ; Wed, 7 Dec 2022 10:08:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D660642D1D; Wed, 7 Dec 2022 10:08:51 +0100 (CET) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by mails.dpdk.org (Postfix) with ESMTP id E46A2410D2; Wed, 7 Dec 2022 10:08:47 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1670404128; x=1701940128; h=from:to:cc:subject:date:message-id:references: in-reply-to:content-transfer-encoding:mime-version; bh=Cv2GS3I5BZz/XXhm22UsRCQi+ADr8bqECAmdpVCsQjg=; b=QndWO0zPHQUyX18CG1lK597fPOH8r70Ur+WvVDYAkP+8fhEMSk4+MXTg 016bpEqD4FFRwvZQ/aOwJU2ZlSbkwjKn8YSYwuj5RBKT7gE13qluve1Kh Vbt+MDcNrz3cgRm2gtNPDE+qvhW293quwfuDBI9eK/kP0nKRMNNQPP3hY NMYry/l18tVYNtmVnixTCWeHXWS+WjYpImWgYFxuhYjwb+2+sb9e/AMjY XKWwEY6F6YUPDb5ocQjpxvcdGDLPLf+sj2yGHGQibS3FoWQ2/MudL/Pyk DOyIRYzA+mi2fym8J2kbIHpE3040GPjZY3aQYIKTSQ7KN7zcNPl0QT4Bp g==; X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="381137260" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="381137260" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga105.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2022 01:07:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10553"; a="753014637" X-IronPort-AV: E=Sophos;i="5.96,223,1665471600"; d="scan'208";a="753014637" Received: from orsmsx601.amr.corp.intel.com ([10.22.229.14]) by fmsmga002.fm.intel.com with ESMTP; 07 Dec 2022 01:07:23 -0800 Received: from orsmsx611.amr.corp.intel.com (10.22.229.24) by ORSMSX601.amr.corp.intel.com (10.22.229.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 7 Dec 2022 01:07:22 -0800 Received: from orsmsx612.amr.corp.intel.com (10.22.229.25) by ORSMSX611.amr.corp.intel.com (10.22.229.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16; Wed, 7 Dec 2022 01:07:22 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx612.amr.corp.intel.com (10.22.229.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.16 via Frontend Transport; Wed, 7 Dec 2022 01:07:22 -0800 Received: from NAM12-DM6-obe.outbound.protection.outlook.com (104.47.59.171) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.16; Wed, 7 Dec 2022 01:07:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=DT4cFFwGiGWI+PbL9acX/mVTUZKWmdye5gvTkyV/wWjT65NAYPIMtDQ4MNALNBJ9AtA8GZMpVFe7LL2uOv0kSzMTBYnefWkNNsao2aaHGh0q0hSJ4eJDjrb4e8NwIka/O+xlM8qvk/ZNoxP3aRF/GXYHHsKW3IGQCnULh41ZE0l9XYFy19toaQVBwDZbHGhw4AsuOOit1jbpzNz0Q/lz1HZ5bmqkWniOOjjfoTOW1U4zXy8758eOwLg9afLtLksYLiSRum0a+ncSZWPO6I5xF2jDroHX/h58/Ev74SimJFLysTv5SsI6yRa4MpzsPIagHPV7eHR/TNpTbvFYYzBwXw== 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-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=qomJZATeR4LvfNDIhRVwsRZXDXkLVVZ1Ec9iTuJL5EY=; b=J/nScf1H1B4wfwE2ZJB9w4jWQYnsJsbSQkFRUA8O7LEnHFwxyDmQhVRUQd65+rutJFJxnvdR+d6vlBB6n6iz9CrVid4uV2hIQRkIKxWNF0qxEkFWIesO/R6VXSOIt8F60Iln0F5oZ3yVv4iV7hMHG2G8J/bGgulKiATtMQcaF+zK/3w5qABRbOEVmozjTW00B2u7PDKRGLHFJv9PSrrFG5uSWqBayPuE+oDz3vc6l6wrSIGiLeDppKoH9pHnvG4qzJ+5wqmGnVbXyXJtv2b9Z0JvWnI1XoIXD6ZwF/tOrNrLv/B7NxJ3GoSBpTNsg+zHnLerNArJ4FGkJVzNnSaEXg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none Received: from SJ0PR11MB6765.namprd11.prod.outlook.com (2603:10b6:a03:47b::10) by PH8PR11MB7120.namprd11.prod.outlook.com (2603:10b6:510:214::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5880.14; Wed, 7 Dec 2022 09:07:20 +0000 Received: from SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::1193:2129:4750:3da0]) by SJ0PR11MB6765.namprd11.prod.outlook.com ([fe80::1193:2129:4750:3da0%4]) with mapi id 15.20.5880.014; Wed, 7 Dec 2022 09:07:20 +0000 From: "You, KaisenX" To: "dev@dpdk.org" CC: "stable@dpdk.org" , "Yang, Qiming" , "Zhou, YidingX" , "Wu, Jingjing" , "Xing, Beilei" , "Zhang, Qi Z" Subject: RE: [PATCH] net/iavf:fix slow memory allocation Thread-Topic: [PATCH] net/iavf:fix slow memory allocation Thread-Index: AQHY+loFeMqmz4GLVk6MziI+2SKeuq5iQcvA Date: Wed, 7 Dec 2022 09:07:20 +0000 Message-ID: References: <20221117065726.277672-1-kaisenx.you@intel.com> In-Reply-To: <20221117065726.277672-1-kaisenx.you@intel.com> Accept-Language: zh-CN, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: SJ0PR11MB6765:EE_|PH8PR11MB7120:EE_ x-ms-office365-filtering-correlation-id: 11f6795c-cf6c-4353-4763-08dad8327244 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: 19TeUEi7huJefOeB8BULH30FDYcdjOgvP2eouQTcFIkiowMTMcvjq0p3+cLDptPV/r/yp4KZ3q6kJ0uJiCG9mjVKZZ5hd8BFHDYeG40gDFH+9M+9RUIcpJKCi63zmTfco2wlZBMjj9qyE0HGuAC8IgNtr3WcXnteS/kZat1QTRW8iTSH38Ptynqd3JQR8aGMPI6vNaohwlvaEHZ83cBvVfxFzxaGI/5372GuTe4OrenEZxyLoQ3kA5xoTFtechvnrDp5LH1YyIYm1qAhaBDuSGmfWOEEO4MVhkz74Vt++tyC2da6uvkMYATGEh1twNJP8pkA7VTPyQQcpKGrA/Ol8LHAAAhHKFMjW8E3yLs9CeR1yM6EI4FKHizi4eaOuylitzi+lLjmyQ1fh3lSQxj0FHsEJEnZD7D0Sh8mqeGLuWDWZtDw7Q0Pi8u1p2YTd1xMvaZ2jApHTy1SS6ZixZ40J1S7uYYaGZ5qS5XzIyHJXUJAkdFLI22w/hnfhCm3ji+U6rbzwSM1rvAPgu3t6vjDTKPMBsYdxdzCL3T6/uJF5/6KwdgKrufLMmNGI75HO1iNNRM4pieaGe9TPMnoJxoWNydee66uETKbhJ3yNeSavE4zHyAYYrAIZAG8PazRdIk06hnremSmO2q0B9u1ptuee0Ga1MYafUkOA1ydCzCgYNzX3HCNQYynsgugT0O74GjssJjuEzliFWyHAe8elgjb/g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:SJ0PR11MB6765.namprd11.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230022)(346002)(136003)(39860400002)(376002)(366004)(396003)(451199015)(316002)(6916009)(41300700001)(86362001)(76116006)(54906003)(66946007)(450100002)(33656002)(8676002)(66556008)(64756008)(66446008)(5660300002)(66476007)(4326008)(8936002)(83380400001)(82960400001)(38100700002)(122000001)(107886003)(71200400001)(55016003)(9686003)(7696005)(53546011)(186003)(26005)(6506007)(38070700005)(2906002)(52536014)(478600001); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-2022-jp?B?NkE1WGd5ZmhoY0tYUXBrMjNLNVdianMxamxTcWpXNGk1aVZ4RUVZWWFN?= =?iso-2022-jp?B?Q0lzUllWd0o4TTZMeTd2TzVIVFZHb0hHcHkxQmNrQUlmM3RzMjJFNkov?= =?iso-2022-jp?B?QVRkemdMU2hkU2FVMllEcmxaU2hqN2ZiVjBOTTE2N0pZY0xTbVBkNEZh?= =?iso-2022-jp?B?WC8rZUR6MWZ3UmtSMi9nOUxKREdWWGlOUUhLNGk5MVZhdjV4akxvS3Ir?= =?iso-2022-jp?B?ZkR3T0hiS0U4SmJ5T3pCbm9UYTNBcHhkUGlzaVloVEo4NEUzNDFPWm1z?= =?iso-2022-jp?B?eDZkaWpwK1pIVUFWWU81MGpxSWJpamNDUGp2Tm9DYkZUU010UVc1S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itqYVdQOFFMc2N1NjNTdGY0eU9qQWdoZG1wYzVTakJ2R3R3WE5weWl6?= =?iso-2022-jp?B?M2U5dmFzQVQ3ZFFCalNIL1VJZkpzcFNHVS9aVHJaVXlwWUltRmpkWmxH?= =?iso-2022-jp?B?V1ZsU0h1ckYvUWZpRGlmMWNxNDRVUVZwY1lBd0FrOVM1OHNFTnJOMVJw?= =?iso-2022-jp?B?aXNIaQ==?= Content-Type: text/plain; charset="iso-2022-jp" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: SJ0PR11MB6765.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 11f6795c-cf6c-4353-4763-08dad8327244 X-MS-Exchange-CrossTenant-originalarrivaltime: 07 Dec 2022 09:07:20.3075 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: PFjRKFImpCA/RpEW726t+kAuqZsc8WUr+r6pEwQugCXQ5WjB808mqXo88ydPI1G+HwCZ0Hy5XB9+rheYvOHZGA== X-MS-Exchange-Transport-CrossTenantHeadersStamped: PH8PR11MB7120 X-OriginatorOrg: intel.com X-BeenThere: stable@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: patches for DPDK stable branches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: stable-bounces@dpdk.org Can you please help to review? thanks. > -----Original Message----- > From: You, KaisenX > Sent: 2022=1B$BG/=1B(B11=1B$B7n=1B(B17=1B$BF|=1B(B 14:57 > To: dev@dpdk.org > Cc: stable@dpdk.org; Yang, Qiming ; Zhou, YidingX > ; You, KaisenX ; Wu, > Jingjing ; Xing, Beilei ; Z= hang, > Qi Z > Subject: [PATCH] net/iavf:fix slow memory allocation >=20 > In some cases, the DPDK does not allocate hugepage heap memory to some > sockets due to the user setting parameters (e.g. -l 40-79, SOCKET 0 has n= o > memory). > When the interrupt thread runs on the corresponding core of this socket, > each allocation/release will execute a whole set of heap allocation/relea= se > operations,resulting in poor performance. > Instead we call malloc() to get memory from the system's heap space to fi= x > this problem. >=20 > Fixes: cb5c1b91f76f ("net/iavf: add thread for event callbacks") > Cc: stable@dpdk.org >=20 > Signed-off-by: Kaisen You > --- > drivers/net/iavf/iavf_vchnl.c | 8 +++----- > 1 file changed, 3 insertions(+), 5 deletions(-) >=20 > diff --git a/drivers/net/iavf/iavf_vchnl.c b/drivers/net/iavf/iavf_vchnl.= c index > f92daf97f2..a05791fe48 100644 > --- a/drivers/net/iavf/iavf_vchnl.c > +++ b/drivers/net/iavf/iavf_vchnl.c > @@ -36,7 +36,6 @@ struct iavf_event_element { > struct rte_eth_dev *dev; > enum rte_eth_event_type event; > void *param; > - size_t param_alloc_size; > uint8_t param_alloc_data[0]; > }; >=20 > @@ -80,7 +79,7 @@ iavf_dev_event_handle(void *param __rte_unused) > TAILQ_FOREACH_SAFE(pos, &pending, next, save_next) { > TAILQ_REMOVE(&pending, pos, next); > rte_eth_dev_callback_process(pos->dev, pos- > >event, pos->param); > - rte_free(pos); > + free(pos); > } > } >=20 > @@ -94,14 +93,13 @@ iavf_dev_event_post(struct rte_eth_dev *dev, { > struct iavf_event_handler *handler =3D &event_handler; > char notify_byte; > - struct iavf_event_element *elem =3D rte_malloc(NULL, sizeof(*elem) > + param_alloc_size, 0); > + struct iavf_event_element *elem =3D malloc(sizeof(*elem) + > +param_alloc_size); > if (!elem) > return; >=20 > elem->dev =3D dev; > elem->event =3D event; > elem->param =3D param; > - elem->param_alloc_size =3D param_alloc_size; > if (param && param_alloc_size) { > rte_memcpy(elem->param_alloc_data, param, > param_alloc_size); > elem->param =3D elem->param_alloc_data; @@ -165,7 +163,7 > @@ iavf_dev_event_handler_fini(void) > struct iavf_event_element *pos, *save_next; > TAILQ_FOREACH_SAFE(pos, &handler->pending, next, save_next) { > TAILQ_REMOVE(&handler->pending, pos, next); > - rte_free(pos); > + free(pos); > } > } >=20 > -- > 2.34.1