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 A9BD6386545E for ; Wed, 24 Mar 2021 21:22:31 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org A9BD6386545E Received: by mail-ot1-x32c.google.com with SMTP id 68-20020a9d0f4a0000b02901b663e6258dso24421667ott.13 for ; Wed, 24 Mar 2021 14:22:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=fHSTYGCVWiEt9VwMVUF7vl8ts2FtsJsd+TNtY1M+NA0=; b=SvL7+ohyxcKAh1zpLJEWnWWpsXIBCTIgKSgcA8lqgP9KUTEwa+uwsSKrTDHU67No6X 1xZLKYGjNjbfzR2hO6EO64zw2rM6otfuouh7tTpaQwpzjGnXV349DvV0IN39S+538H0p F7HvzdZ1EE5GYrulzyRE8P0dKUljRO1vkpVj4hIirucpJB9M7NkeMb+BJ/ZojJ3qJ606 /K6cSl6T3msQOKajJH7RKSEGFybeiD2xONwKKOp75e+AFMkTwfTUmzu+O7mh0m92rinQ +wgNlWsbvtbr7jd41JvSsjQRpYMdxl4bUawn5vQD5Ov0mwufHcY04i7IXMbp1axMCG47 iUWg== X-Gm-Message-State: AOAM530wq4isMFkfbXdK+2UKBNpA3qALrr7qom0FbcCZkVXk3927LoBJ S8GgaRGv8MSIzDGbRwu1fTNFZweQfwGLR6m/Ha8= X-Google-Smtp-Source: ABdhPJwzPCo3k56Z0xRtvEQWhoiO8okaVjdfnlIUj0E+FQxWpGXY6HFPjCEDJ1XRMTNWB/Bxna+XiyhIOGrU9SFCAFc= X-Received: by 2002:a05:6830:1515:: with SMTP id k21mr4660276otp.269.1616620951101; Wed, 24 Mar 2021 14:22:31 -0700 (PDT) MIME-Version: 1.0 References: <20210314164625.9312-1-lukma@denx.de> <20210322123213.58775fbd@jawa> <39ac5960-73ef-f838-4409-20384c83b59d@linaro.org> <9dc782d3-c151-1dcb-0a2e-f6397c781761@linaro.org> In-Reply-To: <9dc782d3-c151-1dcb-0a2e-f6397c781761@linaro.org> From: "H.J. Lu" Date: Wed, 24 Mar 2021 14:21:54 -0700 Message-ID: Subject: Re: [PATCH] tst: Provide test for select To: Adhemerval Zanella Cc: Lukasz Majewski , GNU C Library Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-3035.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, FREEMAIL_FROM, GIT_PATCH_0, RCVD_IN_DNSWL_NONE, SPF_HELO_NONE, SPF_PASS, 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:22:36 -0000 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. I tried it. It doesn't solve the problem. I opened: https://sourceware.org/bugzilla/show_bug.cgi?id=27648 -- H.J.