From owner-freebsd-questions@FreeBSD.ORG Wed Oct 19 14:35:08 2011 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id F21B7106564A for ; Wed, 19 Oct 2011 14:35:08 +0000 (UTC) (envelope-from dcherednik@masterhost.ru) Received: from mail.corp.masterhost.ru (wincas02.mail.corp.masterhost.ru [90.156.219.212]) by mx1.freebsd.org (Postfix) with ESMTP id 346698FC14 for ; Wed, 19 Oct 2011 14:35:07 +0000 (UTC) Received: from kzholnay-pc.masterhost.ru (87.242.97.5) by mail.corp.masterhost.ru (90.156.219.210) with Microsoft SMTP Server (TLS) id 14.1.339.1; Wed, 19 Oct 2011 18:35:05 +0400 Message-ID: <4E9EE018.205@masterhost.ru> Date: Wed, 19 Oct 2011 18:35:04 +0400 From: Daniil Cherednik User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.18) Gecko/20110617 Lightning/1.0b2 Thunderbird/3.1.11 MIME-Version: 1.0 To: X-Originating-IP: [87.242.97.5] Content-Type: text/plain; charset="ISO-8859-1"; format=flowed Content-Transfer-Encoding: 7bit X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: sigprocmask system call X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 19 Oct 2011 14:35:09 -0000 Hello. We are using FreeBSD 8.2 on hight load projects. When I was preparing system for production I sow strange (as me think) behavior that can lead to increased load on servers. If I made truss on httpd (apache22) process, I saw too much syscalls such us: 24822: sigprocmask(SIG_BLOCK,0x0,0x0) = 0 (0x0) 24822: sigprocmask(SIG_BLOCK,0x0,0x0) = 0 (0x0) 24822: sigprocmask(SIG_BLOCK,0x0,0x0) = 0 (0x0) 24822: sigprocmask(SIG_BLOCK,0x0,0x0) = 0 (0x0) 24822: sigprocmask(SIG_BLOCK,0x0,0x0) = 0 (0x0) ... too many line ... and 24822: sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|S IGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) 24822: sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0) 24822: sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|S IGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) 24822: sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0) 24822: sigprocmask(SIG_BLOCK,SIGHUP|SIGINT|SIGQUIT|SIGKILL|SIGPIPE|SIGALRM|SIGTERM|SIGURG|SIGSTOP|SIGTSTP|SIGCONT|SIGCHLD|SIGTTIN|SIGTTOU|SIGIO|SIGXCPU|SIGXFSZ|SIGVTALRM|SIGPROF|S IGWINCH|SIGINFO|SIGUSR1|SIGUSR2,0x0) = 0 (0x0) 24822: sigprocmask(SIG_SETMASK,0x0,0x0) = 0 (0x0) ... too many line ... but apache, and modules loaded from it do not call this directly. I was trying to use DTRACE for getting information about syscalls, and I got same result. I wrote tiny sample code: #include main(){ fork(); } I ran it on FreeBSD: truss -f ./mytest 2>&1 | grep sigprocmask | wc -l 30 Is it normal to call so many syscalls ? For example, there is no sigprocmask syscalls when I run it in Linux. -- ? ?????????, Daniil Cherednik .masterhost