From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ot1-x32c.google.com (mail-ot1-x32c.google.com [IPv6:2607:f8b0:4864:20::32c]) by sourceware.org (Postfix) with ESMTPS id 082963858D39 for ; Tue, 9 Nov 2021 13:01:05 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 082963858D39 Received: by mail-ot1-x32c.google.com with SMTP id r10-20020a056830080a00b0055c8fd2cebdso9349096ots.6 for ; Tue, 09 Nov 2021 05:01:05 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=AVhXRNXWoG4nz7o/lke7pJRtR8Em/wWLZScBAGeMu9g=; b=xfIiy0Vn7kQyAcFPi952hH9EbPMXVgV4mCJ3SLNc3lOGu9sI+pIBN49+oxd+U0q0uD Q1Gdok+HhKyrOD9uLhmXBp2tWuIiKl5MwgpSK/Y7mGYgshZw+mD7jpX5xwu+50NfFz9E g9Q8n0Z6qIG2t6ymRG8eXmzFUxD7mY0N0r3Z8f0dVhfkXXzPc9UUDXknUobjwtVxKoo/ rHwgQkek48th5mf5xIlvh1yId0oJ7s6+qS76v8dD1C7bH2g1STe4n5zkfBYcBCmP0cYQ CyFWhBhncBm/SUVUW4APj19aXkxWfkMsMrjCpq4FShAxNdxHrHXukLNFgi26LehRJZMm 9MeQ== X-Gm-Message-State: AOAM530oggHMS1GvMsIY1+XWDXxipP5lg0M4SDk2FxrKFEZ+e0CCBZvA ux8q9AjYQuMt63wmvSgvvFyutg== X-Google-Smtp-Source: ABdhPJzjmloI4njSsXKqibqtacip31c9IiXov8uX5GuzDD0N97lf9hVYIhmu6EH7+gsKEYFgDSL7Rw== X-Received: by 2002:a9d:f4a:: with SMTP id 68mr215156ott.327.1636462864405; Tue, 09 Nov 2021 05:01:04 -0800 (PST) Received: from ?IPV6:2804:431:c7cb:55a:94d0:2630:9b29:e621? ([2804:431:c7cb:55a:94d0:2630:9b29:e621]) by smtp.gmail.com with ESMTPSA id k4sm7088764oic.48.2021.11.09.05.01.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 09 Nov 2021 05:01:04 -0800 (PST) Message-ID: Date: Tue, 9 Nov 2021 10:00:59 -0300 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: [PATCH v2 20/22] selftests: futex: Test sys_futex_waitv() timeout Content-Language: en-US To: =?UTF-8?Q?Andr=c3=a9_Almeida?= , Vasily Gorbik Cc: Davidlohr Bueso , libc-alpha@sourceware.org, Peter Zijlstra , linux-api@vger.kernel.org, Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Steven Rostedt , Ingo Molnar , mtk.manpages@gmail.com, Darren Hart , Thomas Gleixner , kernel@collabora.com, krisman@collabora.com References: <20210923171111.300673-1-andrealmeid@collabora.com> <20210923171111.300673-21-andrealmeid@collabora.com> <51bbfe74-33f6-bb92-3ce8-a22e4185820b@collabora.com> From: Adhemerval Zanella In-Reply-To: <51bbfe74-33f6-bb92-3ce8-a22e4185820b@collabora.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 09 Nov 2021 13:01:08 -0000 On 09/11/2021 09:52, André Almeida via Libc-alpha wrote: > Hi Vasily, > > Às 08:18 de 09/11/21, Vasily Gorbik escreveu: >> On Thu, Sep 23, 2021 at 02:11:09PM -0300, André Almeida wrote: >>> Test if the futex_waitv timeout is working as expected, using the >>> supported clockid options. >> >>> + /* futex_waitv with CLOCK_MONOTONIC */ >>> + if (futex_get_abs_timeout(CLOCK_MONOTONIC, &to, timeout_ns)) >>> + return RET_FAIL; >>> + res = futex_waitv(&waitv, 1, 0, &to, CLOCK_MONOTONIC); >>> + test_timeout(res, &ret, "futex_waitv monotonic", ETIMEDOUT); >>> + >>> + /* futex_waitv with CLOCK_REALTIME */ >>> + if (futex_get_abs_timeout(CLOCK_REALTIME, &to, timeout_ns)) >>> + return RET_FAIL; >>> + res = futex_waitv(&waitv, 1, 0, &to, CLOCK_REALTIME); >>> + test_timeout(res, &ret, "futex_waitv realtime", ETIMEDOUT); >> >> Hi André, >> >> when built with -m32 and run as compat this two futex_waitv calls hang >> on x86 and s390 (noticed while wiring up futex_waitv). The rest of the >> futex selftests pass. This suggests some common compat issue? Any ideas? > > The issue is that futex_waitv() only accepts struct timespec that uses > 64bit members. When using -m32, glibc will give you a 32bit timespec, > thus the timeout won't wort. Someday glibc will provide 64bit timespec > to 32bit userspace, given that this is affected by y2038 bug. We do since glibc 2.34, but you need to opt-in by defining -D_TIME_SIZE=64. The default might change in a future release, so hopefully we will have both LFS and 64-bit as the default ABI. > > In previous submissions I added a workaround for that in the > selftest[0]. Search for "Y2038 section for 32-bit applications" in that > link. I'll submit something like that for futex_waitv() timeout test. > > [0] > https://lore.kernel.org/lkml/20210709001328.329716-6-andrealmeid@collabora.com/ >