Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2387595pxb; Mon, 20 Sep 2021 21:02:38 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzX2mx+cahstoWbH5JIvH0M5yOmKKvR8j4GDcBBQ1j74eSIjJz57pN9GYv+YKAj1P1T4D39 X-Received: by 2002:a17:906:3745:: with SMTP id e5mr32920397ejc.400.1632196958652; Mon, 20 Sep 2021 21:02:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632196958; cv=none; d=google.com; s=arc-20160816; b=XQDBAIA46kSJZF4FEJvclwY9ZCGrToLU0+U7M11l2ZoSjB/CjDh8m/SaTvD94n12rO DxLzl+S0xMGOU18eZ90sXR3pnZHqr5ACQ1VZAS4wiotnTZhhJVSXUHbQDQo7qn+iQmMt p9kDgh+HfQ8t1Mnaaj6QTgee06fabovPUWQ8xNBBzZXevmVfRLyHcJV/6iu3PJuVZiAu cMtm/WBVGsJPtHe3VJRCTrwsjcvUiqU2IfR+/mpofLtI9lxqrgED2Mk7Ep8qNt+1mIDD KHkti5CxOFUKESJlaR/+QLdM8f4fv6p/TY2NcY1U2niCABubZebdlZJ8DAn9yaSAArz6 Ec8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=VXhi7a0RKCYxmJtUfff90GgNpcsfRICICc3w+t63HR0=; b=CUPJDF3jq0x9L7Fr41YMPxw7bHF85idiszNj0QlWAOCk8KsRCwEDbU99A6UX/Lbvzg LGnL9Pkrxm/HQEBYH4Z6eHqvN3PYkhRoUTMNUHVqOQ3yQrTzu3cz/q46ZTCpmvf0SxpD L+bSWXtelG8aFu0bJvD8V+seVaLWWrOVVWb0oxy3/RwRQF+SVhSgtWaj82SaMjkIFFf2 D0YgE9tTuChC347jalpIrlPAjswmc1ZsEQQl6RldKAseymyRMvwsdSPc06Rj6ES4SjPG ciIY7S4RqTsmiHnG27xdr9UPdoXpdqNVf6n0rS5XkByAY7e+z1rtJ1W7l3eR4D6+vCFm atbQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 3si19849213ejl.781.2021.09.20.21.02.14; Mon, 20 Sep 2021 21:02:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=collabora.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244091AbhIUCIE (ORCPT + 99 others); Mon, 20 Sep 2021 22:08:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236835AbhIUBvd (ORCPT ); Mon, 20 Sep 2021 21:51:33 -0400 Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7EA34C0364A5; Mon, 20 Sep 2021 15:47:55 -0700 (PDT) Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: tonyk) with ESMTPSA id A7DF31F426D9 Message-ID: <72990864-5ec6-1f73-efd9-61b667a172dd@collabora.com> Date: Mon, 20 Sep 2021 19:47:44 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.1.1 Subject: Re: [PATCH v3 2/2] perf bench: Add support for 32-bit systems with 64-bit time_t Content-Language: en-US To: Alistair Francis Cc: linux-kernel@vger.kernel.org, alistair23@gmail.com, linux-riscv@lists.infradead.org, namhyung@kernel.org, jolsa@redhat.com, linux-perf-users@vger.kernel.org, alexander.shishkin@linux.intel.com, mark.rutland@arm.com, acme@kernel.org, dave@stgolabs.net, dvhart@infradead.org, peterz@infradead.org, mingo@redhat.com, tglx@linutronix.de, atish.patra@wdc.com, arnd@arndb.de, Alistair Francis References: <20210917061040.2270822-1-alistair.francis@opensource.wdc.com> <20210917061040.2270822-2-alistair.francis@opensource.wdc.com> From: =?UTF-8?Q?Andr=c3=a9_Almeida?= In-Reply-To: <20210917061040.2270822-2-alistair.francis@opensource.wdc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alistair, Às 03:10 de 17/09/21, Alistair Francis escreveu: > From: Alistair Francis > > Some 32-bit architectures (such are 32-bit RISC-V) only have a 64-bit > time_t and as such don't have the SYS_futex syscall. This patch will > allow us to use the SYS_futex_time64 syscall on those platforms. > Thanks for your patch! However, I don't think that any futex operation at perf has timeout. Do you plan to implement a test that use it? Or the idea is to get this ready for it in case someone want to do so in the future? Also, I faced a similar problem with the new futex2 syscalls, that supports exclusively 64bit timespec. But I took a different approach: I called __NR_clock_gettime64 for 32bit architectures so it wouldn't require to convert the struct: #if defined(__i386__) || __TIMESIZE == 32 # define NR_gettime64 __NR_clock_gettime64 #else # define NR_gettime64 __NR_clock_gettime #endif struct timespec64 { long long tv_sec; /* seconds */ long long tv_nsec; /* nanoseconds */ }; int gettime64(clock_t clockid, struct timespec64 *tv) { return syscall(NR_gettime64, clockid, tv); } Then we can just use &timeout at __NR_futex_time64 for 32bit arch and at __NR_futex for 64bit arch. This might be a simpler solution to the problem that you are facing but I'm not entirely sure. Also, futex's selftests do use the timeout argument and I think that they also won't compile in 32-bit RISC-V, so maybe we can start from there so we can actually test the timeout argument and check if it's working. Thanks, André