annotate src/os/unix/ngx_sunpro_amd64.il @ 9299:2706b60dc225 default tip

Core: error logging rate limiting. With this change, error logging to files can be rate-limited with the "rate=" parameter. The parameter specifies allowed log messages rate to a particular file (per worker), in messages per second (m/s). By default, "rate=1000m/s" is used. Rate limiting is implemented using the "leaky bucket" method, similarly to the limit_req module. Maximum burst size is set to the number of log messages per second for each severity level, so "error" messages are logged even if the rate limit is hit by "info" messages (but not vice versa). When the limit is reached for a particular level, the "too many log messages, limiting" message is logged at this level. If debug logging is enabled, either for the particular log file or for the particular connection, rate limiting is not used.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 25 Jun 2024 22:58:56 +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