From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from hera.aquilenet.fr (hera.aquilenet.fr [185.233.100.1]) by sourceware.org (Postfix) with ESMTPS id 01028386102F for ; Wed, 24 Mar 2021 21:35:47 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 01028386102F Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: sourceware.org; spf=fail smtp.mailfrom=samuel.thibault@ens-lyon.org Received: from localhost (localhost [127.0.0.1]) by hera.aquilenet.fr (Postfix) with ESMTP id E62849D8; Wed, 24 Mar 2021 22:35:46 +0100 (CET) X-Virus-Scanned: Debian amavisd-new at aquilenet.fr Received: from hera.aquilenet.fr ([127.0.0.1]) by localhost (hera.aquilenet.fr [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Ak7v1RVXfk4G; Wed, 24 Mar 2021 22:35:45 +0100 (CET) Received: from begin (unknown [IPv6:2a01:cb19:956:1b00:de41:a9ff:fe47:ec49]) by hera.aquilenet.fr (Postfix) with ESMTPSA id 6F1691EC; Wed, 24 Mar 2021 22:35:45 +0100 (CET) Received: from samy by begin with local (Exim 4.94) (envelope-from ) id 1lPBAF-004CIH-N5; Wed, 24 Mar 2021 22:35:43 +0100 Date: Wed, 24 Mar 2021 22:35:43 +0100 From: Samuel Thibault To: "H.J. Lu" Cc: Adhemerval Zanella , GNU C Library Subject: Re: [PATCH] tst: Provide test for select Message-ID: <20210324213543.4ixrs66lloe7x6lx@begin> References: <20210314164625.9312-1-lukma@denx.de> <20210322123213.58775fbd@jawa> <39ac5960-73ef-f838-4409-20384c83b59d@linaro.org> <9dc782d3-c151-1dcb-0a2e-f6397c781761@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Organization: I am not organized User-Agent: NeoMutt/20170609 (1.8.3) X-Spamd-Bar: -- Authentication-Results: hera.aquilenet.fr X-Rspamd-Server: hera X-Rspamd-Queue-Id: E62849D8 X-Spamd-Result: default: False [-2.50 / 15.00]; ARC_NA(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_ALL(0.00)[]; FREEMAIL_ENVRCPT(0.00)[gmail.com]; TAGGED_RCPT(0.00)[]; MIME_GOOD(-0.10)[text/plain]; HAS_ORG_HEADER(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; TO_DN_ALL(0.00)[]; FREEMAIL_TO(0.00)[gmail.com]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; MID_RHS_NOT_FQDN(0.50)[]; BAYES_HAM(-3.00)[100.00%] X-Spam-Status: No, score=-11.8 required=5.0 tests=BAYES_00, GIT_PATCH_0, JMQ_SPF_NEUTRAL, KAM_DMARC_STATUS, SPF_HELO_PASS, SPF_NEUTRAL, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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: Wed, 24 Mar 2021 21:35:49 -0000 H.J. Lu via Libc-alpha, le mer. 24 mars 2021 14:21:54 -0700, a ecrit: > On Wed, Mar 24, 2021 at 2:14 PM Adhemerval Zanella > wrote: > > > > > > > > On 24/03/2021 17:13, H.J. Lu wrote: > > > On Wed, Mar 24, 2021 at 12:47 PM Adhemerval Zanella > > > wrote: > > >> > > >> > > >> > > >> On 24/03/2021 16:17, H.J. Lu wrote: > > >>> On Mon, Mar 22, 2021 at 4:33 AM Lukasz Majewski wrote: > > >>>> > > >>>> Dear Community, > > >>>> > > >>>>> This change adds new test to assess select()'s timeout related > > >>>>> functionality (the rdfs set provides valid fd - stderr - but during > > >>>>> normal program operation there is no data to be read, so one just > > >>>>> waits for timeout). > > >>>>> > > >>>>> To be more specific - two use cases are checked: > > >>>>> - if select() times out immediately when passed struct timeval has > > >>>>> zero values of tv_usec and tv_sec. > > >>>>> - if select() times out after timeout specified in passed argument > > >>>> > > >>>> Do you have any comments regarding this patch? > > >>>> > > >>> > > >>> This test failed on machines with more than 40 cores: > > >>> > > >>> tst-select.c:54: 1616610088.851713938s not after 1616610089.851712804s > > >>> (difference 0.999998866s) > > >>> error: 1 test failures > > >>> > > >>> I was doing 3 "makec -j28 check" in parallel. > > >> > > >> I think the nanosecond precision of time accounting is triggering the > > >> failure, since select only support timeval (the error indicates that > > >> the nanosecond precision is what is triggering it). > > >> > > >> Maybe if we ignore the nanosecond precision: > > >> > > >> diff --git a/misc/tst-select.c b/misc/tst-select.c > > >> index 7c310256c5..4b1791ac8a 100644 > > >> --- a/misc/tst-select.c > > >> +++ b/misc/tst-select.c > > >> @@ -45,6 +45,8 @@ test_select_timeout (bool zero_tmo) > > >> to.tv_sec = timeout; > > >> ts = xclock_now (CLOCK_REALTIME); > > >> ts = timespec_add (ts, (struct timespec) { timeout, 0 }); > > >> + /* Ignore nanosecond precision since select only support microsecond. */ > > >> + ts.tv_nsec = (ts.tv_nsec * 1000) / 1000; > > > > > > How does it work? It looks like a NOP to me. > > > > The idea is to clear the nanosecond precision from the xclock_now call. It should rather be ts.tv_nsec = (ts.tv_nsec / 1000) * 1000; shouldn't it? Samuel