Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp5915136iob; Tue, 10 May 2022 06:38:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrQgvHRzHgOTpm19X0fkDZwMvI7E2TG/QwS5eSNSlq/ZuZrmhskZJKGyNMdEX3p5dcszA1 X-Received: by 2002:a17:90b:350a:b0:1dc:69bc:e04 with SMTP id ls10-20020a17090b350a00b001dc69bc0e04mr100761pjb.18.1652189914297; Tue, 10 May 2022 06:38:34 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1652189914; cv=pass; d=google.com; s=arc-20160816; b=P06/dWTOEUeXegnz2D3fn6hLvURVqdIjFida0WiPX2MhsUTF26+fERkmdWeFIWji8u tTiTdz5PKePBuLFshOijpmMO8UsrHzFznL3fHYRskWRfbxle8DHEe+Xe0xPcahX1IgHW rwGdtkc0XQU1V6ISdKXbmGZleow+gvnZmQzVDB0iL3sA6l3tU0WseKVhU8ZtGl3mx2Yl HXFlx6ax679v0U0WpBYi5nY1X6OjGeIRvBRmoTPbomxVNZzHCYPqdVBwgDKRcXSLJM/a Syi1fvMGbzRoLaS6jrUJEm0h773/BRlyvS8t8/7ObskIXTaLrO1emsnP7w/RVGSvUodF wTJg== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=hmsT/g18UhquvCDQuFtXwsC/Z38GTp9Xq0ubiUgEHaQ=; b=splFUDEK5vYAtH4q384XUf1Fr3kBsj/ruSxASP9PZm/Waci7zFHPGRiUdrO+TKgUZK sxNeMMfDwuYLJwaulyZ99PymUIUQ2a4Orc0vEZJe9RnBIAmg/d3vBS3Kw0fRyUdoWcgk 8pcgmQwoVw0H8S9XIeXuhVk7/1kv+/xylBBgGNXPS/PGzFSsCLhmCdT/017eKH9xjRhL 3LWfcUl3zjtLiQazshCFCXlH+pttpIg4sPwgIkVqbAWBG8C4S/phuikZaYqLDIeGP26H P2I7hagRLulg5CzRsc0Cv5mIso8z+Ecqth1EaLFgnH9SkW1RBI+ipCM7IWlPb89qVqcm 6utw== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=N6tAf6XH; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r15-20020a63b10f000000b0039cf6c5573csi17447464pgf.844.2022.05.10.06.38.19; Tue, 10 May 2022 06:38:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=N6tAf6XH; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241243AbiEJMYY (ORCPT + 99 others); Tue, 10 May 2022 08:24:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43046 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230358AbiEJMYW (ORCPT ); Tue, 10 May 2022 08:24:22 -0400 Received: from NAM11-DM6-obe.outbound.protection.outlook.com (mail-dm6nam11on2044.outbound.protection.outlook.com [40.107.223.44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F14092A18B4; Tue, 10 May 2022 05:20:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=aTmbpaMlS3isRMkg2T6JEy0dKCQiBWBjD6/huo8W/GyMGud0SWm8F8MHsSquPyjuIQQBDISC+6cqNYcjaJ/LIKFnI5TqC8rGFmo88lbtH/chx1OumYlV/Wu9T3mpYXVRQppLrallJftAuB5W0v/ZagYygNcfDE43sdFdZynlYxIR11Q34Q4/0SBVt7gvhD8sblGhKbfmwi+ywJdN5N1N1u+LVEesfkyP7EyJLIva1+YmKBcHrbRRmAuDOn7vAsvigTXpAOFsY+PuokUlYB/H3beqHttwO/CuKr58C4DXtGAvKfKNakIUACxyvL65N38qZZvHFcwXdHOJ7SPNNuaRng== 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=hmsT/g18UhquvCDQuFtXwsC/Z38GTp9Xq0ubiUgEHaQ=; b=JPZI2BA8AtoUsQmNE77h+p7FRuJktDMBfoUOBiTN/Vh9FQYGzlXsbrLyKcJfrSU9+xz+1FcFicjzcaO1/HXP6I9HM4Cx4YLWC1xsoJmmZRc7mzZpkcOXjF++GdjpubCi9hPYF/JbdsrUPEv/Cl0JbylBNHNnzr9QMjRHqNgmiu14izHM4hGoSnPfsE5Mc0gjUz/ldY4jBhOQg2gwCgTXXc5eCf+SZvqEvjwNfCiG2QacUmohWvWGz8uFWten6yCW5RV0+Np60zB0zAEQ/I8PyHZNP7fFLSwpsKAZeKxo6RFHlBHR2zcOITwL0xWRJPmuiAGDO5Tz6PKuAMweyRlATg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=hmsT/g18UhquvCDQuFtXwsC/Z38GTp9Xq0ubiUgEHaQ=; b=N6tAf6XH9j2rAaNN3r6LV4QmnVPX/YLAd8gN+zFjRCbb5pdb2vHEkDnyFcypGQgV1UsqFCAOh1ZPLnRfi1J2hSNQ4yu+88cArk5u0oqRn9Asm6d83J2wv5rkXcFG4inHo6sp4GtkuACQnstXSOFoETMTTFVOd7VWNptUwUc4mUA= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) by DM6PR12MB4714.namprd12.prod.outlook.com (2603:10b6:5:30::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5227.23; Tue, 10 May 2022 12:20:23 +0000 Received: from BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::fdba:2c6c:b9ab:38f]) by BN8PR12MB3587.namprd12.prod.outlook.com ([fe80::fdba:2c6c:b9ab:38f%4]) with mapi id 15.20.5227.023; Tue, 10 May 2022 12:20:23 +0000 Message-ID: <771f293d-9972-7176-aed3-04e63ef3014d@amd.com> Date: Tue, 10 May 2022 14:20:17 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH] dmabuf: ensure unique directory name for dmabuf stats Content-Language: en-US To: Charan Teja Kalla , Greg KH Cc: sumit.semwal@linaro.org, daniel.vetter@ffwll.ch, tjmercier@google.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org References: <1652178212-22383-1-git-send-email-quic_charante@quicinc.com> <039e1acc-8688-2e06-1b2a-1acbe813b91e@amd.com> From: =?UTF-8?Q?Christian_K=c3=b6nig?= In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-ClientProxiedBy: AS8PR07CA0018.eurprd07.prod.outlook.com (2603:10a6:20b:451::15) To BN8PR12MB3587.namprd12.prod.outlook.com (2603:10b6:408:43::13) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 370a1dd6-b620-4e3d-510e-08da327f74c2 X-MS-TrafficTypeDiagnostic: DM6PR12MB4714:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: cG8B0tCBykJJl22+tEiZWRlgLBdEnMkYSM0VmmYlHrxayG4arsG8yJDPRSKmwLPn+IbmxMcw4y2WkBPv8pjPdUIpi4tZXZTnEeG677hjcYP/qKVz5vlkr7m8RwG6CsVahC5dQs0ksL7yGBqkhXG4J8VctkxRJmr2j3Ujc2b8xGy12yim+iqwf18eTbVUfqdPWpKg2ld+dBuVxxJCdyWXXwWF2Kxy4WAbqrr5T7c4VzaEiAnGxOANlBHH+ZcC+9JQMMad5PEg7/Y/zWPYFgpbb9hzZbIyqWKwIdoN3LcRVQnbCNIsFrPnR9zkZ3R8XbvKap4wfXxrZrcZFUKMvkCB8msfIe+cBSKwhm3HMC4kkzJHg4XpkKHQxWpo0KFW/P9WjNBpK3JglTr88PXIJKscOmYiHFWksQV/AVsnxsGvsqq1A1eSE63Q8uvkDiNXB8G5N1IXg/cGlDM5cDRtkn0lsPp7TNdbYFMKntjh9uKxq7LwUCY4EMvt8U0++K1fnJgvoYhpkcPI524HU/Ry4RQqUa06285YO/VsTve/aSd4Bxx58AM0UPPv0q4+prpZWN84qw06uL7QLRZhPXWx/EeuvSPwEF1jrCfby1DHq26LvPCDdA1J8LKQy2wJ1pwJW0GDi/DYt/kMtnz/KOBQ/vJv9ePHnUszfGfl3pWrP67JtGVWB/JA2pMLYea+hvmd7dgPh/waxPNREzhbcgJs5Wm6MTHlpn0e/62kmnEXVZmJSII1LcvvNT41f5yv3HdiSIIw X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BN8PR12MB3587.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(8676002)(31696002)(66946007)(66556008)(66476007)(186003)(2616005)(86362001)(8936002)(6512007)(4326008)(2906002)(38100700002)(316002)(6506007)(53546011)(110136005)(36756003)(31686004)(6666004)(6486002)(5660300002)(508600001)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 2 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?aWhNQWJGWDUzeEZaL3laaWY5bTN2dlZJSGtDS2lXNHpKVFpIVnRNcE1kbisy?= =?utf-8?B?MDVTYUVxcU5Jb2cyeUk5RDY5MzE3bjAvcnpwWU10ODdsQ1pxRkJCMXVlWFBp?= =?utf-8?B?STFjYkY5ZElCTHRhVTlSbzgxMnFOYW9CQzBCRXFPbGtWcEJraUVaUWtGT0xu?= =?utf-8?B?bFhIQVVMdjJWYUtiS3FPUERleDhMVWNKb283WWFsYnNoT2p1Tmd3QzFRTDNr?= =?utf-8?B?OEoyUFZwK00zT0tMYVgrcVAzcVhHcXFwRzZFVkdZWWphb05zS0RRWkhLZGJE?= =?utf-8?B?OS96N3RkN1RVVGE1RVBYL1h1K0RYN0h1czJkVlBEUWdHTU9xZENXV0hzQ3FD?= =?utf-8?B?ZmVxNnYya0lpMXRWc01sQWF1b1VlcE93c2loQjg2OU5GNm5jUCtjMG5MTmVP?= =?utf-8?B?VXRZcXJSNkFnclU5NXI1UWV4bjdSUjBLMUpNM2J4OVRPSWU1R2Q1Vzdq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pTG4rbk1BMGpESmJ1NlNUWEgrdEhnSFFpN3VuQUtP?= =?utf-8?B?MmlqTUlSdXNVSTlmb1NqL1d0RTV6UXZsNWRTdHRtYVhPQ2hZeGJCZ0VsQ0dt?= =?utf-8?Q?/n+rhBWsgDHYWhgKEbhsMn0n59v7Hze6OrnHb6m7DRp3T?= X-MS-Exchange-AntiSpam-MessageData-1: /XdL2OJ76UJPIg== X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 370a1dd6-b620-4e3d-510e-08da327f74c2 X-MS-Exchange-CrossTenant-AuthSource: BN8PR12MB3587.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 May 2022 12:20:22.9192 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: /cs3awLV7/eBCmrMFKgXVaNQ0ZLxFVI9JSMekGh4zNifE8aQ7kNJT/hkX9G5+zk9 X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM6PR12MB4714 X-Spam-Status: No, score=-3.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE, URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Am 10.05.22 um 14:16 schrieb Charan Teja Kalla: > Thanks Christian for the inputs!! > > On 5/10/2022 5:05 PM, Christian König wrote: >>> And what's to keep the seconds field from also being the same? >> Well exporting two DMA-bufs with the same ino in the same nanosecond >> should be basically impossible, but I would rather opt for using a 64bit >> atomic in that function. >> >> This should be 100% UAPI compatible and even if we manage to create one >> buffer ever ns we need ~500years to wrap around. > I see that the inode->i_ctime->tv_sec is already defined as > 64bit(time64_t tv_sec), hence used it. This way we don't need extra > static atomic_t variable just to get a unique name. > > Just pasting excerpt from the reply posted to Greg about why this secs > will always be a unique: with secs field added, to get the same > inode-secs string, the uint should overflow in the same second which is > impossible. > > Let me know If you still opt for atomic variable only. I think just using a static atomic variable here would be cleaner, that is 100% unique. Your approach should probably work as well, but it looks quite constructed. Regards, Christian.