linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Re: PROBLEM: select() on TCP socket sleeps for 1 tick even if data available
@ 2001-01-24 23:56 Bernd Eckenfels
  0 siblings, 0 replies; 28+ messages in thread
From: Bernd Eckenfels @ 2001-01-24 23:56 UTC (permalink / raw)
  To: linux-kernel

> can someone explain what is nagle or pinpoint explanation :)

nagel's algorithm is used to "wait" with sending of small packets until more
data is available, because sending biger packets has less overhead.

greetings
Bernd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 28+ messages in thread
* Re: PROBLEM: select() on TCP socket sleeps for 1 tick even if data  available
@ 2001-01-20 10:53 Bernd Eckenfels
  0 siblings, 0 replies; 28+ messages in thread
From: Bernd Eckenfels @ 2001-01-20 10:53 UTC (permalink / raw)
  To: linux-kernel

In article <3A68F855.6F16F152@att.net> you wrote:
> My problem is that if data is NOT available when select()
> starts, but becomes available immediately afterwards, select()
> doesn't wake up immediately, but sleeps for 1/100 second.

It does not sleep for a 1/100second, it will but the process in the run queue
and of course the process needs to wait for the current scheduled process to
finish it's scheduling. This happens only every tick.

If there is no process in the run queue, mabe this can be done faster (already
is done faster?)

Greetings
Bernd
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 28+ messages in thread
* PROBLEM: select() on TCP socket sleeps for 1 tick even if data available
@ 2001-01-19 20:47 Michael Lindner
  2001-01-19 23:20 ` David Schwartz
  2001-01-19 23:31 ` Chris Wedgwood
  0 siblings, 2 replies; 28+ messages in thread
From: Michael Lindner @ 2001-01-19 20:47 UTC (permalink / raw)
  To: linux-kernel

[1.] select() sleeps for 1 tick even if data available
[2.] Full description of the problem/report:
	If select() is waiting for data to become available on a TCP socket FD,
and
	data becomes available, it doesn't return until the next clock tick.
This
	produces large latencies when passing data between processes several
times,
	since each transaction (which requires microseconds) does not occur
until
	the next clock tick, limiting the entire throughput of the system to
100
	transactions/second.
[3.] Keywords: select, socket, networking
[4.] Kernel version (from /proc/version): 2.2.18
[5.] Output of Oops.. message (not applicable)
[6.] A small shell script or example program which triggers the
     problem (if possible)

	#include <sys/time.h>
	#include <sys/types.h>
	#include <unistd.h>

	/* this program should take 1 second to complete, but takes 10 */
	/* yes i know, it doesn't do any I/O, but the behavior is the
		same as if it did */
	main()
	{
	        for (int i = 0; i < 1000; i++) {
			struct timeval to;
			to.tv_sec = 0;
			to.tv_usec = 1000;
			select(0, 0, 0, 0, &to);
		}
		return 0;
	}

[7.] Environment
	Red Hat 7.0 with kernel upgraded to 2.2.18

[7.1.] Software (add the output of the ver_linux script here)
	ver_linux di dnot appear to work. However, here's its output.

Linux mlindner-ras.sonusnet.com 2.2.18 #8 Wed Jan 3 01:40:29 EST 2001
i586 unknown
Kernel modules         found
Gnu C                  2.96
Binutils               2.10.0.18
Linux C Library        ..
ldd: missing file arguments
Try `ldd --help' for more information.
ls: /usr/lib/libg++.so: No such file or directory
Procps                 2.0.7
Mount                  2.10m
Net-tools              (2000-05-21)
Kbd                    [option...]
Sh-utils               2.0
Sh-utils               Parker.
Sh-utils               
Sh-utils               Inc.
Sh-utils               NO
Sh-utils               PURPOSE.

[7.2.] Processor information (from /proc/cpuinfo):

processor       : 0
vendor_id       : AuthenticAMD
cpu family      : 5
model           : 8
model name      : AMD-K6(tm) 3D processor
stepping        : 12
cpu MHz         : 451.033
cache size      : 64 KB
fdiv_bug        : no
hlt_bug         : no
sep_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 1
wp              : yes
flags           : fpu vme de pse tsc msr mce cx8 sep mtrr pge mmx 3dnow
bogomips        : 897.84

[7.3.] Module information (from /proc/modules): N/A
[7.4.] SCSI information (from /proc/scsi/scsi) N/A
[7.5.] Other information that might be relevant to the problem
       (please look in /proc and include all information that you
       think to be relevant):
[X.] Other notes, patches, fixes, workarounds:

--
Mike Lindner
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

^ permalink raw reply	[flat|nested] 28+ messages in thread

end of thread, other threads:[~2001-04-12  0:11 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <fa.nc2eokv.1dj8r80@ifi.uio.no>
     [not found] ` <fa.dcei62v.1s5scos@ifi.uio.no>
     [not found]   ` <015e01c082ac$4bf9c5e0$0701a8c0@morph>
2001-01-20  6:54     ` PROBLEM: select() on TCP socket sleeps for 1 tick even if data available Michael Lindner
2001-01-20  7:07       ` Chris Wedgwood
2001-01-20  7:46         ` Michael Lindner
2001-01-20 21:58           ` Edgar Toernig
2001-01-21  0:35             ` Dan Maas
2001-01-21  0:34               ` Chris Wedgwood
2001-01-21  1:22                 ` Michael Lindner
2001-01-21  1:29                   ` David Schwartz
2001-01-21  3:20                 ` Michael Lindner
2001-04-09 14:54                   ` Stephen D. Williams
2001-04-09 19:16                     ` James Antill
2001-04-10 18:29                       ` Stephen D. Williams
2001-04-10 20:25                         ` James Antill
2001-04-11 21:03                           ` Stephen D. Williams
2001-04-12  0:09                             ` James Antill
2001-01-24 20:31                 ` Boris Dragovic
     [not found]         ` <3A694357.1A7C6AAC@att.net>
2001-01-20  9:41           ` Dan Maas
2001-01-20 17:26             ` Michael Lindner
2001-01-24 23:56 Bernd Eckenfels
  -- strict thread matches above, loose matches on Subject: below --
2001-01-20 10:53 Bernd Eckenfels
2001-01-19 20:47 Michael Lindner
2001-01-19 23:20 ` David Schwartz
2001-01-20  2:30   ` Michael Lindner
2001-01-20  3:27     ` David Schwartz
2001-01-20  4:37       ` Michael Lindner
2001-01-20 12:26     ` Martin MaD Douda
2001-01-20 11:39       ` Bjorn Wesen
2001-01-19 23:31 ` Chris Wedgwood

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).