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 1D0B1A034D; Mon, 3 Jan 2022 19:22:32 +0100 (CET) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id D0FCF40042; Mon, 3 Jan 2022 19:22:31 +0100 (CET) Received: from NAM02-BN1-obe.outbound.protection.outlook.com (mail-bn1nam07on2040.outbound.protection.outlook.com [40.107.212.40]) by mails.dpdk.org (Postfix) with ESMTP id 6E8B64003C for ; Mon, 3 Jan 2022 19:22:30 +0100 (CET) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=gIyoN2q3cKyJprrDcqlGyILUhtp5zSC35oJAiNcRQED+aeKzkkKitLM19uDGToOfbeJgysXGfzfYbfP6+4D/csN2xNcFX6Gq9KcWPyFSSP5FoGdOU8BAmtN/MAAGB3LlWVhwS4WR/hzTYw9rKn/4rgoccsPbEgYbUd5RvVYofrT4CKlwaZ1HuBmA1qTbbU/Z/7eHiDgnC1I2OyptF7JgUn3t6jTiP6IES8LL7PdesAp+JRJCCBoIHeZcnnYxFzfZY6Hky/b+vOeRHy62aQg6M0QgdmuMWmWxlMo0CuAlQvG6mKM8J+25IAiDpsHVM6SC1oMRegSnGrDcDgKM4K3CKw== 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=cglkDrStc31UiDoI8vs2eNGxZn3lNXBy77h3bahqGeY=; b=RYiCrgL+4Lt/UX5R1tdHKPkPzuCvAQJPNeN4oS5FiyYgmxZ7ciuMv1sbdZY3xJ3yzwIZoxnEM3zyJNGdcKxqMKosEsjKtwZKajsh6pIsCn9iLejQaTSaEILoNgtTvR7CdQyMVjMm81fqMX53BCRmQsSlw6N+9A0Eb6XAn0grWN76Of91Z4bIudWX/etDBTfEJdkoSpI0UxWNpYty3pasU+Cksb1uXB4VxB1my635VH+mwUCMdqTrPIrtGzcYcdy5BiP5H4LUJJOOq8ZN3ZafPr5eqwx3GZwHviFggCCyo+OTTzr0sKjDoS3TQQ+4F4zR/hYx3us3cIZWbO41vvwN/g== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=nvidia.com; dmarc=pass action=none header.from=nvidia.com; dkim=pass header.d=nvidia.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=Nvidia.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=cglkDrStc31UiDoI8vs2eNGxZn3lNXBy77h3bahqGeY=; b=ikBZqXW/IF9CQn1DXQAd0j0xtJQbWyN7S4XBFsgnNwuxQ9wvReRFIWR4pkWqO9wPMXsftU8pm5c6JXpnU9bUcM0REAYKPIeMFmiG89wrdp/PbsOy/e5dtneWM0PNjTUexiOJ7kA2HrusKIBOTORI+0xu/VI7jmfJ5kM4cfsbM6ytex90AoiJFLHtWc7kr5RenFHc0pxwbMDTp8o1z6/xfiM7k2dQqDG8fEntsOILOH99fsYUtYl2X6nHyK9MIJ1yZalJS57nmXXDZgUv62dJx9mpbcSOBe68s3Bm8F29e2hvbBO3Z54wpcjBNKmox+TGGFQh29tbA1YDG2rCjgkOAQ== Received: from DM6PR12MB4107.namprd12.prod.outlook.com (2603:10b6:5:218::7) by DM5PR1201MB0252.namprd12.prod.outlook.com (2603:10b6:4:5b::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4844.14; Mon, 3 Jan 2022 18:22:28 +0000 Received: from DM6PR12MB4107.namprd12.prod.outlook.com ([fe80::7006:8ce7:3bc4:512]) by DM6PR12MB4107.namprd12.prod.outlook.com ([fe80::7006:8ce7:3bc4:512%4]) with mapi id 15.20.4844.016; Mon, 3 Jan 2022 18:22:28 +0000 From: Elena Agostini To: Stephen Hemminger CC: "dev@dpdk.org" Subject: Re: [PATCH v1 3/3] gpu/cuda: mem alloc aligned memory Thread-Topic: [PATCH v1 3/3] gpu/cuda: mem alloc aligned memory Thread-Index: AQHYAMiXl96E1P1nikGhAu5uOI9iL6xRl18AgAABZKKAAAIPgIAAAT1R Date: Mon, 3 Jan 2022 18:22:27 +0000 Message-ID: References: <20220104014721.1799-1-eagostini@nvidia.com> <20220104014721.1799-4-eagostini@nvidia.com> <20220103100520.66677c3f@hermes.local> <20220103101741.711319ab@hermes.local> In-Reply-To: <20220103101741.711319ab@hermes.local> Accept-Language: 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=nvidia.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: e73401b1-5172-4a2d-6612-08d9cee5ff98 x-ms-traffictypediagnostic: DM5PR1201MB0252:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: w3LT1ToP0B0sI6oKVubTuMxWDQ2ebRPET56hxSRPHCky/GqPLqg5repXcg+hYtCZZs0xsGVq3Cz2DTaC1UYppy5pcsehDG6rHaWnO+tRy8EQJvdktlzJXw95GwR7ZXY57X8LgPcMk1KqMjIRUX+2AoVj85HJVAX23TmWdaSUaRu92CnvxEOOk9IL8kOcAqDo3GkmMt5s3f/wYi+aX/Txj3PQOveb9K3x5E47L0miqjcLoNySYGNJESo8kIdJ+Nx+hrzw4G+2uo8UfGrzRja4tZ8JPkQbzZ/1nvSvIDpFJjk9Gw71QoT8Z6i5Z8euJhZ3agGGoclSjJtdNpVML2Ya5qEphkvKI72vIpQQmc7KxQSWn9ok7SNIMcOxxEkxZ9ZdPhXC/+l+kQwg2s8pOKL1P5EZR45AMFU2WCX8Hhdp3LaEfKioqR/nLf7OeMQdtpuHov0uYfxNxy0uExKYuPCUfEQrK+f/vToGeADV6s51XFrCDKrktCKMwzjUgZRTAsaDAdUi4mHpLgPbgEWA5PBiK379o4gYgH3yU/5r6v0wOj7GKAdCLPkTd0WYNtBN2XpAHV4i8zu9xJ+JNMpLhoFy/YYJKnlGa8ptv55Agm+4ugYyLxjupSqDpytiecbOshtIH4XTXYxjfIr393qnnfaIaZ8KhSmgTn7JnHpOmruJ/5ooYzMLT3jfn7CLlcR1R3we7AEugPByLtKIkuSo/RpD6g== x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:DM6PR12MB4107.namprd12.prod.outlook.com; PTR:; CAT:NONE; SFS:(4636009)(366004)(64756008)(316002)(186003)(76116006)(4326008)(91956017)(33656002)(66476007)(52536014)(508600001)(9686003)(66556008)(38100700002)(7696005)(66446008)(8936002)(86362001)(8676002)(2906002)(6916009)(66946007)(71200400001)(26005)(6506007)(38070700005)(5660300002)(55016003)(4744005)(122000001); DIR:OUT; SFP:1101; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?xVafjU2t7tnYqNjmphiP3sgi3hYyOQF9LFptFWKonM9EIPMMLb0AmdBQ++Qo?= =?us-ascii?Q?BEWT7rBm9fuLp6syZyvdpNKGUfgPjXHI80FASzIhRJmo2IxUHXi6c8fTgarl?= =?us-ascii?Q?8a5j5sLT3nO2zbP3bJth+oZAi3KDGLuRLiFyeQdgDPecQWwX9U54v86koMa8?= =?us-ascii?Q?N3yT03Q8qhYTWjAIIWcl+Eqbo1N87sfLufMgc51aQlRFPncCQBEpWWIPZdB/?= =?us-ascii?Q?z6ee4QxbpoogVoyufJx7+PgHrLDEjhSjKrjqw852Oi8ufRdBbqipNXR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kyoEJJkf/3GgXcmEP8iIW+nWPys82v2rvRRFp01G/s5wec?= =?us-ascii?Q?r+SGlrCXuLfmnW9CFo0Ps5arvRbG8Z6ynEGiT5SGExha5fNKneX32Y0Z2Ide?= =?us-ascii?Q?oLzAtCeF9qRyjJ28sqsjIZyocKZVEyeDKL18aedXjXj69TJf4QAy59IdEGpt?= =?us-ascii?Q?nnBWAdzE3jpY9ZcGvQDKHJ0f3sOfM67qQpUiQm6ZsPPyVW9smUVSiLhu3g4v?= =?us-ascii?Q?MVtcgaMtgjDHtkG4h9eRkscNX3x005bowsOBXxnblGyAYGVFURpJJf6aNX+b?= =?us-ascii?Q?ozrBP9WGEZZk2WWEnRj/DnE5ZDt5wSRa4t6/8vOibh1h6SGbCPBq9Ms5RXfu?= =?us-ascii?Q?aJQJnJKk7NBz8RWxb/7Ff9QMGiKwrtNH+3yPy0y11U+CIFVrNCoZ4ht+txWI?= =?us-ascii?Q?Ab8f//XT1dBi8BgpnWd5OGICy2iocM+zIY1LSFlIcejPTKDnKVg4uwT4bBTO?= =?us-ascii?Q?G1vmMrC1BqcUZep+pxGsCIee7hW6vt08hXQgzmesgQx7?= Content-Type: multipart/alternative; boundary="_000_DM6PR12MB4107B9238EFFEF4BC1952B2ECD499DM6PR12MB4107namp_" MIME-Version: 1.0 X-OriginatorOrg: Nvidia.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: DM6PR12MB4107.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: e73401b1-5172-4a2d-6612-08d9cee5ff98 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Jan 2022 18:22:28.0177 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 43083d15-7273-40c1-b7db-39efd9ccc17a X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: X4nn2xg4Ed9hr9vR2gl2ngyNOda01OXT/542Txqcv5Tbj+nNWkiQ+Pgmm8DMgOKyrTG/oIk9BZE+shiH10/7zQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM5PR1201MB0252 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org --_000_DM6PR12MB4107B9238EFFEF4BC1952B2ECD499DM6PR12MB4107namp_ Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable > On Mon, 3 Jan 2022 18:15:11 +0000 > Elena Agostini wrote: > > > > Alignment only makes sense if power of two. The code should check tha= t and optimize > > > for that. > > > > > > > The alignment value is checked in the gpudev library before > > passing it to the driver. > > > > Adding this kind of checks in the driver has been rejected in the past = because it was > > considered dead code (the library was already checking input parameters= ). > > > > Let me know what are the preferred options. > > Driver could use the mask instead of slow divide operation. I'd not be concerned about performance here. Memory allocation is expensive, typically you want to do it at initialization time. What do you suggest for my other comments? --_000_DM6PR12MB4107B9238EFFEF4BC1952B2ECD499DM6PR12MB4107namp_ Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

> On Mon, 3 Jan = 2022 18:15:11 +0000

> Elena Agostini= <eagostini@nvidia.com> wrote:

>

> > > Alig= nment only makes sense if power of two. The code should check that and opti= mize

> > > for = that.

> > >=

> >

> > The align= ment value is checked in the gpudev library before

> > passing i= t to the driver.

> >

> > Adding th= is kind of checks in the driver has been rejected in the past because it wa= s

> > considere= d dead code (the library was already checking input parameters).=

> >

> > Let me kn= ow what are the preferred options.

>

> Driver could u= se the mask instead of slow divide operation.

 

I'd not be concerne= d about performance here.

Memory allocation i= s expensive, typically you want to do it

at initialization t= ime.

 

What= do you suggest for my other comments?

--_000_DM6PR12MB4107B9238EFFEF4BC1952B2ECD499DM6PR12MB4107namp_--