Speed problem - smbclient doesn't send duplicate ACKs in case of pacekt loss

Derrell.Lipman at UnwiredUniverse.com Derrell.Lipman at UnwiredUniverse.com
Mon Jan 10 03:27:21 GMT 2005


Jeremy Allison <jra at samba.org> writes:

> On Tue, Jan 04, 2005 at 12:46:17AM -0500, Derrell.Lipman at UnwiredUniverse.com wrote:
>> 
>> - lib/util.c and lib/select.c
>
> Your change to lib/util.c depends on nanosleep - a linux-only function.

Are you sure of this?  According to the nanosleep(2) manual section, it's
conformant to POSIX.1b (formerly POSIX.4).

> I'll add this with a configure.in test.

Sounds reasonable.  Then, even if it's not a Linux system but has nanosleep(),
it'll be used.

>>   * In an application with signals, it was possible for functions to block
>>   indefinitely while awaiting timeouts.  This patch ensures that if a
>>   system call with a timeout is aborted and needs to be restarted, it is
>>   restarted with a timeout which is adjusted for the amount of time already
>>   waited.
>
> This is correct, but I think slightly less efficient than it could be, as it
> does 2 gettimeofday calls per select. Can you give me an opinion on this
> version, which I think does the same but with only one gettimeofday call ?

Your version appears to be functionally equivalent and slightly more efficient
in the "normal" case (no interrupt).  Doing the gettimeofday call only when
errno == EINTR seems perfectly appropriate and desirable.  My only concern
(and it's a big one) is that this is an absolutely critical function -- the
whole of samba relies on it to function properly -- so I'd be loath to make a
switch to fairly untested code.  Although I tend to use almost exclusively
libsmbclient, at least the version I submitted has been tested (albeit only
here) for a couple of months without apparent failure.

Cheers,

Derrell

ps. That was only one small part of my patch.  Will the remainder
(libsmbclient stuff) be applied?  It'd be really nice to get that into the
release as well!

Thanks.


More information about the samba-technical mailing list