annotate src/os/unix/ngx_sunpro_amd64.il @ 7142:b9d919b53593 stable-1.12

Stream: relaxed next upstream condition (ticket #1317). When switching to a next upstream, some buffers could be stuck in the middle of the filter chain. A condition existed that raised an error when this happened. As it turned out, this condition prevented switching to a next upstream if ssl preread was used with the TCP protocol (see the ticket). In fact, the condition does not make sense for TCP, since after successful connection to an upstream switching to another upstream never happens. As for UDP, the issue with stuck buffers is unlikely to happen, but is still possible. Specifically, if a filter delays sending data to upstream. The condition can be relaxed to only check the "buffered" bitmask of the upstream connection. The new condition is simpler and fixes the ticket issue as well. Additionally, the upstream_out chain is now reset for UDP prior to connecting to a new upstream to prevent repeating the client data twice.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 11 Sep 2017 15:32:31 +0300
parents 2cd019520210
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
1 /
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
2 / Copyright (C) Igor Sysoev
4412
d620f497c50f Copyright updated.
Maxim Konovalov <maxim@nginx.com>
parents: 3479
diff changeset
3 / Copyright (C) Nginx, Inc.
561
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
4 /
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
5
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
6 / ngx_atomic_uint_t ngx_atomic_cmp_set(ngx_atomic_t *lock,
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
7 / ngx_atomic_uint_t old, ngx_atomic_uint_t set);
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
8 /
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
9 / the arguments are passed in %rdi, %rsi, %rdx
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
10 / the result is returned in the %rax
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
11
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
12 .inline ngx_atomic_cmp_set,0
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
13 movq %rsi, %rax
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
14 lock
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
15 cmpxchgq %rdx, (%rdi)
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
16 setz %al
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
17 movzbq %al, %rax
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
18 .end
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
19
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
20
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
21 / ngx_atomic_int_t ngx_atomic_fetch_add(ngx_atomic_t *value,
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
22 / ngx_atomic_int_t add);
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
23 /
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
24 / the arguments are passed in %rdi, %rsi
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
25 / the result is returned in the %rax
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
26
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
27 .inline ngx_atomic_fetch_add,0
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
28 movq %rsi, %rax
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
29 lock
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
30 xaddq %rax, (%rdi)
e48ebafc6939 nginx-0.3.2-RELEASE import
Igor Sysoev <igor@sysoev.ru>
parents:
diff changeset
31 .end
1309
08c6ee7a1b11 Sun Studio 12 compatibility
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
32
08c6ee7a1b11 Sun Studio 12 compatibility
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
33
08c6ee7a1b11 Sun Studio 12 compatibility
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
34 / ngx_cpu_pause()
3479
bfd1912e55a9 use "rep; nop" instead of "pause" on Solaris/amd64
Igor Sysoev <igor@sysoev.ru>
parents: 1309
diff changeset
35 /
bfd1912e55a9 use "rep; nop" instead of "pause" on Solaris/amd64
Igor Sysoev <igor@sysoev.ru>
parents: 1309
diff changeset
36 / the "rep; nop" is used instead of "pause" to avoid the "[ PAUSE ]" hardware
bfd1912e55a9 use "rep; nop" instead of "pause" on Solaris/amd64
Igor Sysoev <igor@sysoev.ru>
parents: 1309
diff changeset
37 / capability added by linker because Solaris/amd64 does not know about it:
bfd1912e55a9 use "rep; nop" instead of "pause" on Solaris/amd64
Igor Sysoev <igor@sysoev.ru>
parents: 1309
diff changeset
38 /
bfd1912e55a9 use "rep; nop" instead of "pause" on Solaris/amd64
Igor Sysoev <igor@sysoev.ru>
parents: 1309
diff changeset
39 / ld.so.1: nginx: fatal: hardware capability unsupported: 0x2000 [ PAUSE ]
1309
08c6ee7a1b11 Sun Studio 12 compatibility
Igor Sysoev <igor@sysoev.ru>
parents: 561
diff changeset
40
6474
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
41 .inline ngx_cpu_pause,0
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
42 rep; nop
Ruslan Ermilov <ru@nginx.com>
parents: 4412
diff changeset
43 .end