Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] worker_cpu_affinity support for DragonFlyBSD

Sepherosa Ziehau
May 26, 2017 09:16PM
Hi Maxim,

Your patch works. Thank you!

Thanks,
sephe

On Sat, May 27, 2017 at 12:04 AM, Maxim Dounin <mdounin@mdounin.ru> wrote:
> Hello!
>
> On Fri, May 26, 2017 at 02:56:06PM +0800, Sepherosa Ziehau wrote:
>
>> Hi all,
>>
>> The patch is here:
>> https://leaf.dragonflybsd.org/~sephe/nginx_dfly_affinity.diff
>>
>> Unlike FreeBSD, we adopted sched_setaffinity() syscall for process CPU affinity.
>
> A better solution might be to move sched_setaffinity() test from
> auto/os/linux to auto/unix instead. Patch below (untested).
>
> # HG changeset patch
> # User Maxim Dounin <mdounin@mdounin.ru>
> # Date 1495814031 -10800
> # Fri May 26 18:53:51 2017 +0300
> # Node ID d4d316c4503f7b9bbf47b0006822e4438e6e641a
> # Parent 9552758a786e20c70130427298895bc782a754c5
> Configure: sched_setaffinity() test moved to auto/unix.
>
> The sched_setaffinity() function was introduced in DragonFly BSD 4.7,
> so it is no longer Linux-specific.
>
> diff --git a/auto/os/linux b/auto/os/linux
> --- a/auto/os/linux
> +++ b/auto/os/linux
> @@ -157,20 +157,6 @@ ngx_feature_test="if (prctl(PR_SET_DUMPA
> . auto/feature
>
>
> -# sched_setaffinity()
> -
> -ngx_feature="sched_setaffinity()"
> -ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
> -ngx_feature_run=no
> -ngx_feature_incs="#include <sched.h>"
> -ngx_feature_path=
> -ngx_feature_libs=
> -ngx_feature_test="cpu_set_t mask;
> - CPU_ZERO(&mask);
> - sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
> -. auto/feature
> -
> -
> # crypt_r()
>
> ngx_feature="crypt_r()"
> diff --git a/auto/unix b/auto/unix
> --- a/auto/unix
> +++ b/auto/unix
> @@ -300,6 +300,18 @@ if [ $ngx_found = no ]; then
> fi
>
>
> +ngx_feature="sched_setaffinity()"
> +ngx_feature_name="NGX_HAVE_SCHED_SETAFFINITY"
> +ngx_feature_run=no
> +ngx_feature_incs="#include <sched.h>"
> +ngx_feature_path=
> +ngx_feature_libs=
> +ngx_feature_test="cpu_set_t mask;
> + CPU_ZERO(&mask);
> + sched_setaffinity(0, sizeof(cpu_set_t), &mask)"
> +. auto/feature
> +
> +
> ngx_feature="SO_SETFIB"
> ngx_feature_name="NGX_HAVE_SETFIB"
> ngx_feature_run=no
>
> --
> Maxim Dounin
> http://nginx.org/
> _______________________________________________
> nginx-devel mailing list
> nginx-devel@nginx.org
> http://mailman.nginx.org/mailman/listinfo/nginx-devel



--
Tomorrow Will Never Die
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] worker_cpu_affinity support for DragonFlyBSD

Sepherosa Ziehau 528 May 26, 2017 02:58AM

Re: [PATCH] worker_cpu_affinity support for DragonFlyBSD

Maxim Dounin 228 May 26, 2017 12:06PM

Re: [PATCH] worker_cpu_affinity support for DragonFlyBSD

Sepherosa Ziehau 219 May 26, 2017 09:16PM

Re: [PATCH] worker_cpu_affinity support for DragonFlyBSD

Maxim Dounin 252 May 29, 2017 10:06AM

Re: [PATCH] worker_cpu_affinity support for DragonFlyBSD

Sepherosa Ziehau 224 May 30, 2017 10:36PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 158
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready