From patchwork Thu Aug 29 23:01:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Samuel Thibault X-Patchwork-Id: 1155552 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=sourceware.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=libc-alpha-return-104907-incoming=patchwork.ozlabs.org@sourceware.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=ens-lyon.org Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; secure) header.d=sourceware.org header.i=@sourceware.org header.b="jP8m5I1i"; dkim-atps=neutral Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 46KJ5f3Y6Xz9sBp for ; Fri, 30 Aug 2019 09:01:58 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; q=dns; s=default; b=KEm VdZvQxvBIg/wtyWOPpLl/CUkN9TfHy6y9nFJyobooTzvkebbbPSrjfuwEm/5s1Ty 4irttyiQiSTvIIDRfulkKWLuP204VWgYdwy0hzFfC4Pxg/FtQhIAjxmoXoNldbfW YJVl37Qi9xPwBIfQnyzCU/ZG2+FYruBYUB5XK5JU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; s=default; bh=1vkBjwvxw D7lbPn6CF7WMDV/0t4=; b=jP8m5I1ix6ySSFaEJ+Vf+Im/IuJq6PpgtWabMC/dj +VSCWNKsdojFIAMsUsECdT0La75rkOcJRJwlKqwY3docnESa8u1JPrJCsIKCeNgS lQwpWuc0YwIgVM+pm28SSKUwZCP3Y1A6J7eNQTqUB9oHbCqAPpgwGkx2hQf9xHPS 28= Received: (qmail 45979 invoked by alias); 29 Aug 2019 23:01:52 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Delivered-To: mailing list libc-alpha@sourceware.org Received: (qmail 45966 invoked by uid 89); 29 Aug 2019 23:01:52 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, GIT_PATCH_1, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_NONE, SPF_HELO_PASS, SPF_NEUTRAL autolearn=ham version=3.3.1 spammy=HContent-Transfer-Encoding:8bit X-HELO: hera.aquilenet.fr From: Samuel Thibault To: libc-alpha@sourceware.org Cc: Richard Braun , commit-hurd@gnu.org Subject: [hurd,commited] hurd: Fix _hurd_select for single fd sets Date: Fri, 30 Aug 2019 01:01:46 +0200 Message-Id: <20190829230146.11323-1-samuel.thibault@ens-lyon.org> MIME-Version: 1.0 From: Richard Braun The function attempts to optimize this case by performing one IPC system call with the timeout included among the parameters, but in the absence of a reply, it will call mach_msg again with the same timeout later, effectively doubling the total timeout of the select/poll call. Remove this optimization for the time being. * hurd/hurdselect.c (_hurd_select): Always call __io_select with no timeout. --- ChangeLog | 5 +++++ hurd/hurdselect.c | 5 +---- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index 87d43d425e..06c8852c95 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2019-08-30 Richard Braun + + * hurd/hurdselect.c (_hurd_select): Always call __io_select with no + timeout. + 2019-08-29 Mihailo Stojanovic * elf/dl-addr.c (determine_info): Calculate the symbol index diff --git a/hurd/hurdselect.c b/hurd/hurdselect.c index 6997b2b73b..a5e6e26b9a 100644 --- a/hurd/hurdselect.c +++ b/hurd/hurdselect.c @@ -236,10 +236,7 @@ _hurd_select (int nfds, { int type = d[i].type; d[i].reply_port = __mach_reply_port (); - err = __io_select (d[i].io_port, d[i].reply_port, - /* Poll only if there's a single descriptor. */ - (firstfd == lastfd) ? to : 0, - &type); + err = __io_select (d[i].io_port, d[i].reply_port, 0, &type); switch (err) { case MACH_RCV_TIMED_OUT: