Mercurial > hg > nginx-vendor-current
annotate src/os/unix/ngx_setaffinity.c @ 694:88a1b4797f2e NGINX_1_3_10
nginx 1.3.10
*) Change: domain names specified in configuration file are now resolved
to IPv6 addresses as well as IPv4 ones.
*) Change: now if the "include" directive with mask is used on Unix
systems, included files are sorted in alphabetical order.
*) Change: the "add_header" directive adds headers to 201 responses.
*) Feature: the "geo" directive now supports IPv6 addresses in CIDR
notation.
*) Feature: the "flush" and "gzip" parameters of the "access_log"
directive.
*) Feature: variables support in the "auth_basic" directive.
*) Bugfix: nginx could not be built with the ngx_http_perl_module in
some cases.
*) Bugfix: a segmentation fault might occur in a worker process if the
ngx_http_xslt_module was used.
*) Bugfix: nginx could not be built on MacOSX in some cases.
Thanks to Piotr Sikora.
*) Bugfix: the "limit_rate" directive with high rates might result in
truncated responses on 32-bit platforms.
Thanks to Alexey Antropov.
*) Bugfix: a segmentation fault might occur in a worker process if the
"if" directive was used.
Thanks to Piotr Sikora.
*) Bugfix: a "100 Continue" response was issued with "413 Request Entity
Too Large" responses.
*) Bugfix: the "image_filter", "image_filter_jpeg_quality" and
"image_filter_sharpen" directives might be inherited incorrectly.
Thanks to Ian Babrou.
*) Bugfix: "crypt_r() failed" errors might appear if the "auth_basic"
directive was used on Linux.
*) Bugfix: in backup servers handling.
Thanks to Thomas Chen.
*) Bugfix: proxied HEAD requests might return incorrect response if the
"gzip" directive was used.
author | Igor Sysoev <http://sysoev.ru> |
---|---|
date | Tue, 25 Dec 2012 00:00:00 +0400 |
parents | 9fbf3ad94cbf |
children |
rev | line source |
---|---|
668 | 1 |
2 /* | |
3 * Copyright (C) Nginx, Inc. | |
4 */ | |
5 | |
6 | |
7 #include <ngx_config.h> | |
8 #include <ngx_core.h> | |
9 | |
10 | |
11 #if (NGX_HAVE_CPUSET_SETAFFINITY) | |
12 | |
13 #include <sys/cpuset.h> | |
14 | |
15 void | |
16 ngx_setaffinity(uint64_t cpu_affinity, ngx_log_t *log) | |
17 { | |
18 cpuset_t mask; | |
19 ngx_uint_t i; | |
20 | |
21 ngx_log_error(NGX_LOG_NOTICE, log, 0, | |
22 "cpuset_setaffinity(0x%08Xl)", cpu_affinity); | |
23 | |
24 CPU_ZERO(&mask); | |
25 i = 0; | |
26 do { | |
27 if (cpu_affinity & 1) { | |
28 CPU_SET(i, &mask); | |
29 } | |
30 i++; | |
31 cpu_affinity >>= 1; | |
32 } while (cpu_affinity); | |
33 | |
34 if (cpuset_setaffinity(CPU_LEVEL_WHICH, CPU_WHICH_PID, -1, | |
35 sizeof(cpuset_t), &mask) == -1) | |
36 { | |
37 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | |
38 "cpuset_setaffinity() failed"); | |
39 } | |
40 } | |
41 | |
42 #elif (NGX_HAVE_SCHED_SETAFFINITY) | |
43 | |
44 void | |
45 ngx_setaffinity(uint64_t cpu_affinity, ngx_log_t *log) | |
46 { | |
47 cpu_set_t mask; | |
48 ngx_uint_t i; | |
49 | |
50 ngx_log_error(NGX_LOG_NOTICE, log, 0, | |
51 "sched_setaffinity(0x%08Xl)", cpu_affinity); | |
52 | |
53 CPU_ZERO(&mask); | |
54 i = 0; | |
55 do { | |
56 if (cpu_affinity & 1) { | |
57 CPU_SET(i, &mask); | |
58 } | |
59 i++; | |
60 cpu_affinity >>= 1; | |
61 } while (cpu_affinity); | |
62 | |
63 if (sched_setaffinity(0, sizeof(cpu_set_t), &mask) == -1) { | |
64 ngx_log_error(NGX_LOG_ALERT, log, ngx_errno, | |
65 "sched_setaffinity() failed"); | |
66 } | |
67 } | |
68 | |
69 #endif |