delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2021/08/29/17:06:26

X-Recipient: archive-cygwin AT delorie DOT com
DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 176583857425
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cygwin.com;
s=default; t=1630271185;
bh=tb94cwG+Jhq7noTPhm5syv/H/fMbrJ0Q7YOnBfmVe4E=;
h=Subject:To:References:Date:In-Reply-To:List-Id:List-Unsubscribe:
List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:
From;
b=GrrhZpEbsdEuWhQmppZzotWeFuaa3zPbpKViSCLQsazvVImqJ1bm/MlOyGBhz57MX
Xs5cOHRIcfI8v5iMSyt7anvsPMOjGXWhiGqxk8ygaN5VgIFv8pghgWrK3NOZUoCO+U
n3jOhJE5oFN8N25zXMtAAV5RYcFQlY1D1f5Cp6qs=
X-Original-To: cygwin AT cygwin DOT com
Delivered-To: cygwin AT cygwin DOT com
DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org AF9E53858C3B
ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none;
b=D0jt25Cjwjib5SCl7itANdY8Hb3ssVgproCQfNtYr6U07yQ7EbnzpMZQM2LptpqHK7EwkCmdor99cLGBJSPzc7uoDSPgR4/xE3MaQF0e3UxmAy7Jb4fdlTRk4XmsNL2AbfixRTEhu2l8Ek1l8sYxYIlO82zuRwpOuXI9YydEdPcYOgbjmDzebOo7XDm8r4THxKKGiJDk21+fg4S2MXRaXD5rrDIBtimIiNJtPtKw8/VIt+Dfa7QoXxqOASquuq+8ixEY5gMplsFdNDDgX7qQVTvIo9zpPCHgTzD9py8hLdHv9fTt9Ga/8zXjVZsI/hRhQqQBw2EcOg4ijFnZ47xyyA==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com;
s=arcselector9901;
h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck;
bh=13c1Iy+ctjc7xrB5BpmftfwbDv6E89/ZVhp9mntwcf0=;
b=jGDWb9MvOFsPLLTOrg+Pk7OOnagavMsVk4P6SUvQWJUSjoLqdvZV1F45C8CdtOn1JJsQ9nay4e9f+h5NKGpQzAW6KXXiq2XL/eZHofgwutY30UI5GcuZFtSzBjc5vxA6Ll6U0Ox5SnY5EMoVRYczqxbc+Vb7/mTIlXN7xzAiZLM9FKx62t5w1RtNZoMOOU0mlpS10rVL2+HkTuzf4IFupqeMftmudCVN3lZURMo6ezQku+1B2lnQh4gyySfSwk1AahSFRw+E8a6z0d/ZVB6lwrkdLlLy57cxX9TB7olC9W09meg1q2FZwDuw+M9yzNHasoOhaPw06iAH9IpXQ6ULxQ==
ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass
smtp.mailfrom=cornell.edu; dmarc=pass action=none header.from=cornell.edu;
dkim=pass header.d=cornell.edu; arc=none
Subject: Re: cygrunsrv + sshd + rsync = 20 times too slow -- throttled?
To: cygwin AT cygwin DOT com
References: <41A583E1-C8E7-42AB-9F24-EEC33A41EC60 AT house DOT org>
<20210825201845 DOT 07b6400b79dc5558a7761efe AT nifty DOT ne DOT jp>
<f8106fe7-a2b8-d106-3061-4d888124f4b0 AT cornell DOT edu>
<20210826062934 DOT 54f2f2216021c095bb7ba13b AT nifty DOT ne DOT jp>
<d0a8c57d-1ed1-6b4f-c6e7-cbe0e2ec8a1c AT cornell DOT edu>
<3b560051-ab27-f392-ca4b-d1fd9b5733b0 AT cornell DOT edu>
<20210827202440 DOT 47706fc2fc07c5e9a1bc0047 AT nifty DOT ne DOT jp>
<4f2cb5f3-ce9c-c617-f65f-841a5eca096e AT cornell DOT edu>
<20210828022111 DOT 91ef5b4ff24f6da9fadb489e AT nifty DOT ne DOT jp>
<YSn3L0W1M527utK0 AT calimero DOT vinschen DOT de>
<20210828184102 DOT f2206a8a9e5fe5cf24bf5e45 AT nifty DOT ne DOT jp>
<20210829180729 DOT 48b4e877f773cb3980c5766d AT nifty DOT ne DOT jp>
Message-ID: <c62d18df-ab7a-7233-62ee-29a8eced5353@cornell.edu>
Date: Sun, 29 Aug 2021 17:04:56 -0400
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101
Thunderbird/78.13.0
In-Reply-To: <20210829180729.48b4e877f773cb3980c5766d@nifty.ne.jp>
X-ClientProxiedBy: CH2PR11CA0028.namprd11.prod.outlook.com
(2603:10b6:610:54::38) To BN7PR04MB4388.namprd04.prod.outlook.com
(2603:10b6:406:f8::19)
MIME-Version: 1.0
X-MS-Exchange-MessageSentRepresentingType: 1
X-MS-PublicTrafficType: Email
X-MS-Office365-Filtering-Correlation-Id: 62efa854-f7ab-4ba8-3ce8-08d96b30a7d4
X-MS-TrafficTypeDiagnostic: BN7PR04MB4050:
X-Microsoft-Antispam-PRVS: <BN7PR04MB405039C5FFEA3C5257747E46D8CA9 AT BN7PR04MB4050 DOT namprd04 DOT prod DOT outlook DOT com>
X-MS-Oob-TLC-OOBClassifiers: OLM:3826;
X-MS-Exchange-SenderADCheck: 1
X-MS-Exchange-AntiSpam-Relay: 0
X-Microsoft-Antispam: BCL:0;
X-Microsoft-Antispam-Message-Info: gXIyJ3cF3uU/sp1IwrpevPrDv5mNQaKEYJ3XyizeKDYsx9YIrlFgTkANcmtK8IEHFWXaxfByFqdj9fUcSZV3ThI4udVORDrvaDQhaD0mvYEvDZMKnGyABW+RVSce0cYACjDCaeuCjCh7XmDZ/RBjzDw/b+2EM85B0a+Qp+goUBFUuJWjTIjNzt+M5fQ0sm6WI/deEKZ4ytSZ064anBpuRkUVp38rJl1tPHZjWAD35NA/QOKmXozU93CRpOHi+lMwVI+vDsCMWyR04VEbhpjxlxAISrRxDnst88GVP/+Ewp3dndAxZkIqlxUK4rd6zR3Ku9SBg++5hMRUmMt7hChSL9ryx9Z4WnRuASRjf+AcuMIRI69MYvFUH35liZIBaFZaePQcC440LtMyKpcKwMmcFOZU43jAqicTe2s4TW2DbMw/fe4D0lxJ8KyHymIBYB1UqUV1veX/0nSf+SRK/lGqdRpLDKxQPYznxAqudn98Dw3fW9EWVubry+BrgcBRoLYt0myitAymdbBT43iFcokvXndSjPANw3x5xKr2sI2Pw/ScYMTc2MxuXTtnI4Z0ZL+y05kHzPGrz5Ze0tZeuEkBmH+/T7zvSYa20McvLuc8LGzvwRpiQ6IhnsAfLO1e+IKCcr8SUby1wkxBSskBzKXarI6Qvv7vRaZ4ttiiOM81PQnp3sDRw5+Ldc+Fq/c1qO8vwWBC/B/+Pib1b20ViWy3ChSrbD0uYFlXR+bQrLZxwLc=
X-Forefront-Antispam-Report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:;
IPV:NLI; SFV:NSPM; H:BN7PR04MB4388.namprd04.prod.outlook.com; PTR:; CAT:NONE;
SFS:(4636009)(346002)(376002)(136003)(396003)(39860400002)(366004)(478600001)(66476007)(66556008)(66946007)(38100700002)(2906002)(16576012)(31686004)(83380400001)(53546011)(26005)(86362001)(5660300002)(75432002)(6916009)(6486002)(8936002)(36756003)(2616005)(186003)(956004)(8676002)(316002)(786003)(31696002)(45980500001)(43740500002);
DIR:OUT; SFP:1102;
X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1
X-MS-Exchange-AntiSpam-MessageData-0: =?Windows-1252?Q?+oKznN9teGQ7wIdyMi5K0XsZk0X5G9V9USRvdZBUoo8cv5a608Lvr9BR?=
=?Windows-1252?Q?Pds3kQFgSdfaB/7q11PyBZ2lxucrMn/T8YLaf818xxgcshuNR0dUkTt9?=
=?Windows-1252?Q?+qxDLrjXwVry2j5djoxgf2TjO011rtTrA3mZsuzrJt2xWuCIqKjjnMV7?=
=?Windows-1252?Q?v/aocgP0611ZUDCZEr9hI8JXUwcM4enEvSqfdXMzXIH7dvq7ZfeayhXK?=
=?Windows-1252?Q?OGnioNGSmMSBz2jWi0AvKLVsidH9tzTmm6oibLh0wLJpu6A+rfP1h/s7?=
=?Windows-1252?Q?7QjAUuBDTnPRwhDQK1VWymNjuWotWyUCwBn2HaSaAKgU+hv1A/olvedq?=
=?Windows-1252?Q?1I1eWD2QB3KFmjj5oY6flrG9y5NAE9Lfgk+n7c+loJu/97GVjws2LyVM?=
=?Windows-1252?Q?tcl+Dy+3axLjVUO6dH+o9CUkSNvctWL7Io1vxeQiXh6SNjCFnNJwNJf+?=
=?Windows-1252?Q?HPpbX783vAy+hTNbiH663N3XNy6iVaUDBO17yjoG4Qvkuz4N0oYYDjGq?=
=?Windows-1252?Q?kIviAaUIUAtSzjg/Ig2mE9PYgY/wy5ci/aImYTF5euV8GoKCcf7Vji5U?=
=?Windows-1252?Q?3LKmQ+HVzAd5+Pv4Kap4K+B71x9fJ16OeZrrr/KZsNvGJn4pfpskDLTW?=
=?Windows-1252?Q?KZsU4uaDPoG7F1FPIibx7cV0IdN7D3Nim7/3CZ6znxZG2nwwzQUKlRtX?=
=?Windows-1252?Q?t9q1h1AVE5pvXGlhFC/Sc0znvifRkDHty6iXRNq7I6Fix+zueXyDdGss?=
=?Windows-1252?Q?PxTubPOcLHoMMYhNHeezrxK7EGqivuqAuFTUMEv3oTD1CLWDijhVjzE0?=
=?Windows-1252?Q?tNelZN3F3YsODgmJeMvOau2c4CbEp1xiUxDxYZpnJTVrRq7Lg1/DpTN9?=
=?Windows-1252?Q?+rAbCJhcMQlMz4wHcXXePXzneE4fWSqKj2mHyf1CEjoNef9KF8qm16ew?=
=?Windows-1252?Q?Gj/htLU919PQ78r6D4KkRgnp9h7AY69tkOlWeOBWfxk+jKjW+tQaJ4sI?=
=?Windows-1252?Q?lm53SxoU6FM2xv0AOAxaE688xe4c/AioEEGTPq/ZM3NV45rfmCO4Ml1o?=
=?Windows-1252?Q?sAjO6xzcsA8wwmg+bUTEtNvNbjfYPpRZyEy2Db2JeISkjBy7Kb4N/V94?=
=?Windows-1252?Q?k4+6iHfjen3MRIzVpnF0xf273LalxAGTGQsCXd1ezPCZkE/Pal2/U8Lp?=
=?Windows-1252?Q?FTxpsOhKddxTKJ7yxWWXglzthxzdau6aXmkmgNZaR676sXm1Zb1HJbee?=
=?Windows-1252?Q?QVyIirE2PhJ4aMgG76a4p3tvSLvMMA44B95x/Ctgl/UvBI2epxgkwpRe?=
=?Windows-1252?Q?Hy73q1gqo9ZLnnZZRJH3CkKfDCxM492huIDHXEAvV8/rXlhgp3oBf3Oz?=
=?Windows-1252?Q?tDZoDcVFgqP5bQEl53sG7LRLmqm+7K1RFCEyC5HnqwnZ9MM/+svP7QPy?=
X-OriginatorOrg: cornell.edu
X-MS-Exchange-CrossTenant-Network-Message-Id: 62efa854-f7ab-4ba8-3ce8-08d96b30a7d4
X-MS-Exchange-CrossTenant-AuthSource: BN7PR04MB4388.namprd04.prod.outlook.com
X-MS-Exchange-CrossTenant-AuthAs: Internal
X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Aug 2021 21:04:57.3739 (UTC)
X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted
X-MS-Exchange-CrossTenant-Id: 5d7e4366-1b9b-45cf-8e79-b14b27df46e1
X-MS-Exchange-CrossTenant-MailboxType: HOSTED
X-MS-Exchange-CrossTenant-UserPrincipalName: eUhJJMQKYIlRz7zTu5phM4wOFoN6dW/OiH4IDG9agpOhB2yOogJ4uNLfzeqSWZzHhv8AJ5wIZ691pNitUgyp2A==
X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN7PR04MB4050
X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00, DKIM_SIGNED,
DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, MSGID_FROM_MTA_HEADER, NICE_REPLY_A,
RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, 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: cygwin AT cygwin DOT com
X-Mailman-Version: 2.1.29
List-Id: General Cygwin discussions and problem reports <cygwin.cygwin.com>
List-Unsubscribe: <https://cygwin.com/mailman/options/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=unsubscribe>
List-Archive: <https://cygwin.com/pipermail/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-request AT cygwin DOT com?subject=help>
List-Subscribe: <https://cygwin.com/mailman/listinfo/cygwin>,
<mailto:cygwin-request AT cygwin DOT com?subject=subscribe>
From: Ken Brown via Cygwin <cygwin AT cygwin DOT com>
Reply-To: Ken Brown <kbrown AT cornell DOT edu>
Errors-To: cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com
Sender: "Cygwin" <cygwin-bounces+archive-cygwin=delorie DOT com AT cygwin DOT com>

On 8/29/2021 5:07 AM, Takashi Yano via Cygwin wrote:
> On Sat, 28 Aug 2021 18:41:02 +0900
> Takashi Yano wrote:
>> On Sat, 28 Aug 2021 10:43:27 +0200
>> Corinna Vinschen wrote:
>>> On Aug 28 02:21, Takashi Yano via Cygwin wrote:
>>>> On Fri, 27 Aug 2021 12:00:50 -0400
>>>> Ken Brown wrote:
>>>>> Two years ago I thought I needed nt_create to avoid problems when calling
>>>>> set_pipe_non_blocking.  Are you saying that's not an issue?  Is
>>>>> set_pipe_non_blocking unnecessary?  Is that the point of your modification to
>>>>> raw_read?
>>>>
>>>> Yes. Instead of making windows read function itself non-blocking,
>>>> it is possible to check if the pipe can be read before read using
>>>> PeekNamedPipe(). If the pipe cannot be read right now, EAGAIN is
>>>> returned.
>>>
>>> The problem is this:
>>>
>>>    if (PeekNamedPipe())
>>>      ReadFile(blocking);
>>>
>>> is not atomic.  I. e., if PeekNamedPipe succeeds, nothing keeps another
>>> thread from draining the pipe between the PeekNamedPipe and the ReadFile
>>> call.  And as soon as ReadFile runs, it hangs indefinitely and we can't
>>> stop it via a signal.
>>
>> Hmm, you are right. Mutex guard seems to be necessary like pty code
>> if we go this way.
> 
> I have found that set_pipe_non_blocking() succeeds for both read and
> write pipes if the write pipe is created by CreateNamedPipe() and the
> read pipe is created by CreateFile() contrary to the current create()
> code. Therefore, not only nt_create() but also PeekNamedPipe() become
> unnecessary.
> 
> Please see the revised patch attached.

I haven't had a chance to test this myself yet, but occurs to me that we might 
have a different problem after this patch: Does the write handle that we get 
from CreateNamedPipe() have FILE_READ_ATTRIBUTES access?

Ken

-- 
Problem reports:      https://cygwin.com/problems.html
FAQ:                  https://cygwin.com/faq/
Documentation:        https://cygwin.com/docs.html
Unsubscribe info:     https://cygwin.com/ml/#unsubscribe-simple

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019