delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2001/02/14/22:23:49

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sources DOT redhat DOT com>
List-Archive: <http://sources.redhat.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sources DOT redhat DOT com>
List-Help: <mailto:cygwin-help AT sources DOT redhat DOT com>, <http://sources.redhat.com/ml/#faqs>
Sender: cygwin-owner AT sources DOT redhat DOT com
Delivered-To: mailing list cygwin AT sources DOT redhat DOT com
Date: Wed, 14 Feb 2001 22:17:09 -0500
From: Christopher Faylor <cgf AT redhat DOT com>
To: cygwin AT cygwin DOT com
Subject: Re: Followup on eliminating symlink ReadFile calls -- it's not necessary
Message-ID: <20010214221709.B25745@redhat.com>
Reply-To: cygwin AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
References: <20010214174608 DOT 17253 DOT qmail AT lizard DOT curl DOT com> <20010214161306 DOT D18567 AT redhat DOT com> <20010215000556 DOT 23697 DOT qmail AT lizard DOT curl DOT com>
Mime-Version: 1.0
User-Agent: Mutt/1.3.11i
In-Reply-To: <20010215000556.23697.qmail@lizard.curl.com>; from jik@curl.com on Wed, Feb 14, 2001 at 07:05:56PM -0500

On Wed, Feb 14, 2001 at 07:05:56PM -0500, Jonathan Kamens wrote:
>>  Date: Wed, 14 Feb 2001 16:13:06 -0500
>>  From: Christopher Faylor <cgf AT redhat DOT com>
>>  
>>  >I implemented his suggestion, adding a "-l" flag and a corresponding
>>  >MOUNT_NO_SYMLINKS flag, and did some performance testing on the
>>  >result.  I was surprise to discover that mounting with this option
>>  >didn't provide any additional performance improvement over "-x".
>>  
>>  Actually, I suggested this.
>
>No, I'm afraid not.
>
>You suggested using "mount -x":

Your original email said this:

On Wed, Feb 14, 2001 at 12:46:08PM -0500, Jonathan Kamens wrote:
>DJ Delorie suggested using "mount -x" to eliminate the ReadFile for
>determining whether a file is executable, and adding a new mount
>option to indicate that there are no symbolic links under a particular
>mountpoint, to eliminate the other ReadFile.

I was referring to the "mount -x" part of what you said, of course.
But it was a petty observation, anyway, and I really should not
have made it.

>>  Setting execute permissions on everything is not a generically good
>>  solution.  It means that cygwin will try to execute things like "foo.c".
>
>1) This happens to me already in Cygwin, even when I don't use "mount
>-x".  Cygwin's and bash's mechanisms for figuring out whether a file
>can be executed are hardly foolproof.

Thanks for reporting this bug.  Could you provide an example of this
behavior, please?

>2) I do not think that the fact that Cygwin will try to run a
>non-program file if someone makes the mistake of typing its name as a
>command is a particularly big deal.  It's highly unlikely that any harm
>would come of it.  And the performance improvement from "mount -x" is
>really phenomenal; I think it clearly outweighs the risk.

There is a possibility that some harm, or at least some confusion, could
come from it.  Windows could interpret the file as a .com file and try
to execute it as arbitrary code.

You actually see this occasionally when Windows tries to execute a
Cygwin symlink when the system attribute has been removed.

>To see what I mean, try doing "configure; make" on Cygwin with and
>without "mount -x".  On my machine, it takes 16:54 without "-x" and
>13:31 with it, an improvement of 20%!

I am interested in correctness, not speed.  I am not going to turn on
the 'x' bit for every file just so that all 'configure; make's will be
faster.  You're welcome to make this decision for yourself, however,
and you've obviously done so.

>>  I've mentioned that -x is a performance win in the mailing list several
>>  times.
>
>The mailing list is not documentation.  People should be able to
>download and use Cygwin in an effective manner by consulting its
>documentation.  They should not need to subscribe to the mailing list
>and pick up tips over time just to learn how to tweak Cygwin into an
>effective configuration.
>
>If you've had to mention it on the mailing list several times, that's
>all the more indication that it should be documented in the persistent
>documentation.

The option is mentioned in the documentation:

http://sources.redhat.com/cygwin/cygwin-ug-net/using-utils.html#MOUNT

However, we probably could use a tuning cygwin section.  If someone
would like to contribute this, I'm sure that it will be included.

Btw, you can also use this option (and any mount option, actually) on
individual files if you want to get pinpoint control.

I should also point out that the currently undocumented "-X" (uppercase)
flag may be useful for directories which are populated only by cygwin
executables.  This should decrease the overhead in spawn and fork
slightly.

cgf

--
Want to unsubscribe from this list?
Check out: http://cygwin.com/ml/#unsubscribe-simple

- Raw text -


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