Re: Adding readdir entries to the name cache ...

2002-07-05 Thread Richard Sharpe

On Thu, 4 Jul 2002, Terry Lambert wrote:

[major snippage, much useful to think about here ...]

  However, ls seems to call lstat in the same order that the files are in
  the directory, and a normal clock approach to directories would yield
  exactly the same result. Further, in the cases that the user did not want
  a -l, we would avoid adding many potentially useless names to the name
  cache and reducing its performance.
 
 This is because the sort occurs first.  An unsorted ls (which is
 available -- see the man page) doesn't have this issue.

I don't want to start a flame war, but a truss of ls -l shows the 
following:

getdirentries(0x5,0x809d000,0x1000,0x80990b4)= 4096 (0x1000)
lstat(.gnome,0x809c248)= 0 (0x0)
lstat(.mc,0x809c348)   = 0 (0x0)
lstat(.xinitrc,0x809c44c)  = 0 (0x0)
lstat(750B.pdf,0x809c54c)  = 0 (0x0)
lstat(Mail,0x809c648)  = 0 (0x0)
lstat(nsmail,0x809c748)= 0 (0x0)
lstat(.cshrc,0x809c848)= 0 (0x0)
lstat(.ssh,0x809c948)  = 0 (0x0)
lstat(.gnome_private,0x809ca50)= 0 (0x0)
lstat(.xchat,0x809cb48)= 0 (0x0)
lstat(.exmh,0x809cc48) = 0 (0x0)
lstat(.ICEauthority,0x809cd50) = 0 (0x0)
lstat(.netrc,0x809ce48)= 0 (0x0)

This is the same order that 'ls -fal' produced.

This suggests that the ls is doing an unsorted lookup of the info, and 
then sorting. That is the way I would have done it as well.
 
Regards
-
Richard Sharpe, [EMAIL PROTECTED], [EMAIL PROTECTED], 
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Adding readdir entries to the name cache ...

2002-07-05 Thread Richard Sharpe

On Thu, 4 Jul 2002, Terry Lambert wrote:

 Richard Sharpe wrote:
 
 Note that you can get another 8-12% by making negative cache entries,
 since DOS/Windows clients tend to search the full path each time,
 even though they have already received a successful response in
 the past (i.e. there is no client caching for this information,
 because there is no distributed coherency protocol that would permit
 server invalidation of the cache).  Unmodified, SVR4 DNLC can not
 support negative cache entries (there need to be two line changes).

Hmmm, I think that the major part of the problem there was that, for what 
ever reason, Barry Feigenbaum of IBM, declined to add a Change Working 
Directory or Set Working Diretory command to the SMB protocol.

Thus, at least for the SMB protocol, and maybe generally, Windows clients 
must always send the full pathname for every file they want, unless it 
happens to be at the root of the share.

Perhaps I am wrong about that.

Regards
-
Richard Sharpe, [EMAIL PROTECTED], [EMAIL PROTECTED], 
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Adding readdir entries to the name cache ...

2002-07-05 Thread Garance A Drosihn

At 6:29 AM +0930 7/6/02, Richard Sharpe wrote:
Hmmm, I think that the major part of the problem there was that,
for what ever reason, Barry Feigenbaum of IBM, declined to add
a Change Working Directory or Set Working Diretory command to
the SMB protocol.

Thus, at least for the SMB protocol, and maybe generally, Windows
clients  must always send the full pathname for every file they
want, unless it happens to be at the root of the share.

Could the unix process for samba fake that?  Keep track of the
most recently used directory, and when a new request comes in
split it into directory plus filename, and if the directory
is the same as the previous one, then just access the filename.
If the directory is different, try to do a chdir() to the new
directory, and if that succeeds then save that as the previous
directory.

Or is that more trouble than it's worth?

-- 
Garance Alistair Drosehn=   [EMAIL PROTECTED]
Senior Systems Programmer   or  [EMAIL PROTECTED]
Rensselaer Polytechnic Instituteor  [EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Adding readdir entries to the name cache ...

2002-07-05 Thread Richard Sharpe

On Fri, 5 Jul 2002, Garance A Drosihn wrote:

 At 6:29 AM +0930 7/6/02, Richard Sharpe wrote:
 Hmmm, I think that the major part of the problem there was that,
 for what ever reason, Barry Feigenbaum of IBM, declined to add
 a Change Working Directory or Set Working Diretory command to
 the SMB protocol.
 
 Thus, at least for the SMB protocol, and maybe generally, Windows
 clients  must always send the full pathname for every file they
 want, unless it happens to be at the root of the share.
 
 Could the unix process for samba fake that?  Keep track of the
 most recently used directory, and when a new request comes in
 split it into directory plus filename, and if the directory
 is the same as the previous one, then just access the filename.
 If the directory is different, try to do a chdir() to the new
 directory, and if that succeeds then save that as the previous
 directory.

Yes it can do that, and should do that. I will have to check what Samba 
does. I know I proposed adding a path cache to smbclient/smbtar so that it 
could avoid repeatedly, and even a cache of one path could make a big 
difference.
 
 Or is that more trouble than it's worth?

No, I think it is worth a lot. I suspect Samba already does that. There is 
just so much code to look at. 

Regards
-
Richard Sharpe, [EMAIL PROTECTED], [EMAIL PROTECTED], 
[EMAIL PROTECTED]


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Adding readdir entries to the name cache ...

2002-07-05 Thread Terry Lambert

Richard Sharpe wrote:
 On Thu, 4 Jul 2002, Terry Lambert wrote:
 [major snippage, much useful to think about here ...]
   However, ls seems to call lstat in the same order that the files are in
   the directory, and a normal clock approach to directories would yield
   exactly the same result. Further, in the cases that the user did not want
   a -l, we would avoid adding many potentially useless names to the name
   cache and reducing its performance.
 
  This is because the sort occurs first.  An unsorted ls (which is
  available -- see the man page) doesn't have this issue.
 
 I don't want to start a flame war, but a truss of ls -l shows the
 following:

[ ... ]

 This suggests that the ls is doing an unsorted lookup of the info, and
 then sorting. That is the way I would have done it as well.

My bad; I had assumed that what he said he was observing was
actually what he was observing.  It may be that he's installed
an ls replacement or something, or it could just be an artifact
of the directory he's looking in.

-- Terry

To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message