From owner-freebsd-threads@freebsd.org Tue Sep 29 04:30:55 2015 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 15C36A0B876 for ; Tue, 29 Sep 2015 04:30:55 +0000 (UTC) (envelope-from schulz.j@gmail.com) Received: from mail-pa0-x22d.google.com (mail-pa0-x22d.google.com [IPv6:2607:f8b0:400e:c03::22d]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id DC5B41585; Tue, 29 Sep 2015 04:30:54 +0000 (UTC) (envelope-from schulz.j@gmail.com) Received: by padhy16 with SMTP id hy16so194028345pad.1; Mon, 28 Sep 2015 21:30:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to:user-agent; bh=LiGldTemkaLff/7AV//2ED1DZPZI5G+A3qU6Ha1qs7s=; b=Bl0QkSSiQH3CWOR63FKA1ucni7CCiAvhAnrPaK5NnE4aq5o1JmwSVvsUbx1nm4o2J6 n0a7n4K/APXcOh5h7nC6puBnbdfD6vSBOdwFU+iexLNc4Se56wxTkjYdbyyXGPqToaLh dqQhTRoHzY9an1sPmp3fQklifJs8pg8U0n/b4hqcNLAZN+2PJkmfKIDwCQJHHivndNNp lVZUxRUqrU43VRPN/o9M8iU+jiqRHvrjgbjs0846ynjfiFw/BIdriwe/XL/qhSOjhgEM 1/WkZLgGwHLcIB579lSCqQ85F+V9mRwLGZBV3fMUXl2kItBB744fqr09iJpLYwap8j4q 7dWQ== X-Received: by 10.68.171.37 with SMTP id ar5mr31150805pbc.39.1443501054556; Mon, 28 Sep 2015 21:30:54 -0700 (PDT) Received: from gmail.com (c-73-140-192-75.hsd1.wa.comcast.net. [73.140.192.75]) by smtp.gmail.com with ESMTPSA id rs8sm22465795pbb.14.2015.09.28.21.30.52 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 28 Sep 2015 21:30:52 -0700 (PDT) Sender: Jason Schulz Date: Mon, 28 Sep 2015 21:30:40 -0700 From: Jason Schulz To: John Baldwin Cc: Konstantin Belousov , freebsd-threads@freebsd.org Subject: Re: pthread_getaffinity_np issue Message-ID: <20150929043040.GA2177@gmail.com> References: <20150924181127.GC3104@gmail.com> <20150924191121.GG3104@gmail.com> <20150924192623.GL67105@kib.kiev.ua> <5496698.OIvuy2PFgu@ralph.baldwin.cx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <5496698.OIvuy2PFgu@ralph.baldwin.cx> User-Agent: Mutt/1.5.24 (2015-08-30) X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2015 04:30:55 -0000 On Fri, Sep 25, 2015 at 09:37:55AM -0700, John Baldwin wrote: > On Thursday, September 24, 2015 10:26:23 PM Konstantin Belousov wrote: > > So your issue only appears when you specify _XOPEN_SOURCE. This is reasonable, > > because __bitcount stuff in sys/types.h was put under _BSD_VISIBLE protection. > > I am not sure why and I Cc:ed the author of the change. > > > > IMO all symbols from __bitcount* are in the private namespace and could > > be made unconditionally accessible, to avoid surprises. I put the patch > > at the end of the message which does this. > > It was not on purpose, more to put it in the section with other "doodads". > If it is safe to move out from under BSD_VISIBLE then your patch is fine > with me. The only person I can think to ask would be bde@, but my guess > is your change is correct. > > -- > John Baldwin I tried the patch with _XOPEN_SOURCE=700 and the non-posix CPU_COUNT macro does compile correctly now. I didn't try with _POSIX_SOURCE, but I would guess it should also compile. If anyone wants me to test anything else with the patch, just let me know. -J From owner-freebsd-threads@freebsd.org Tue Sep 29 05:40:53 2015 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 156DEA0A778 for ; Tue, 29 Sep 2015 05:40:53 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 83EFC1D14; Tue, 29 Sep 2015 05:40:52 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id t8T5efK1066106 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Tue, 29 Sep 2015 08:40:42 +0300 (EEST) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua t8T5efK1066106 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id t8T5efVk066105; Tue, 29 Sep 2015 08:40:41 +0300 (EEST) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 29 Sep 2015 08:40:41 +0300 From: Konstantin Belousov To: Jason Schulz Cc: John Baldwin , freebsd-threads@freebsd.org Subject: Re: pthread_getaffinity_np issue Message-ID: <20150929054041.GF11284@kib.kiev.ua> References: <20150924181127.GC3104@gmail.com> <20150924191121.GG3104@gmail.com> <20150924192623.GL67105@kib.kiev.ua> <5496698.OIvuy2PFgu@ralph.baldwin.cx> <20150929043040.GA2177@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150929043040.GA2177@gmail.com> User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Sep 2015 05:40:53 -0000 On Mon, Sep 28, 2015 at 09:30:40PM -0700, Jason Schulz wrote: > On Fri, Sep 25, 2015 at 09:37:55AM -0700, John Baldwin wrote: > > On Thursday, September 24, 2015 10:26:23 PM Konstantin Belousov wrote: > > > So your issue only appears when you specify _XOPEN_SOURCE. This is reasonable, > > > because __bitcount stuff in sys/types.h was put under _BSD_VISIBLE protection. > > > I am not sure why and I Cc:ed the author of the change. > > > > > > IMO all symbols from __bitcount* are in the private namespace and could > > > be made unconditionally accessible, to avoid surprises. I put the patch > > > at the end of the message which does this. > > > > It was not on purpose, more to put it in the section with other "doodads". > > If it is safe to move out from under BSD_VISIBLE then your patch is fine > > with me. The only person I can think to ask would be bde@, but my guess > > is your change is correct. > > > > -- > > John Baldwin > > > I tried the patch with _XOPEN_SOURCE=700 and the non-posix CPU_COUNT macro does > compile correctly now. I didn't try with _POSIX_SOURCE, but I would guess it > should also compile. > > If anyone wants me to test anything else with the patch, just let me know. I already committed the patch to HEAD, r288258. Unless an issue with the change is reported, it will be merged to stable/10 shortly. From owner-freebsd-threads@freebsd.org Sat Oct 3 03:13:28 2015 Return-Path: Delivered-To: freebsd-threads@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 34161A0FC61 for ; Sat, 3 Oct 2015 03:13:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 209791A88 for ; Sat, 3 Oct 2015 03:13:28 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id t933DSu3011786 for ; Sat, 3 Oct 2015 03:13:28 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 203521] MongoDB hangs during mi_switch Date: Sat, 03 Oct 2015 03:13:28 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 10.2-RELEASE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: rwestlun@gmail.com X-Bugzilla-Status: New X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_id short_desc product version rep_platform op_sys bug_status bug_severity priority component assigned_to reporter Message-ID: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 03 Oct 2015 03:13:28 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=203521 Bug ID: 203521 Summary: MongoDB hangs during mi_switch Product: Base System Version: 10.2-RELEASE Hardware: amd64 OS: Any Status: New Severity: Affects Only Me Priority: --- Component: threads Assignee: freebsd-threads@FreeBSD.org Reporter: rwestlun@gmail.com I'm running a webserver on 10.2-RELEASE with MongoDB-2.6.7 in a ZFS-backed jail. After rebooting after an unrelated crash, my jail is unable to fully start. ezjail-admin just blocks. I used jexec to get in to the jail and found this: PID USERNAME THR PRI NICE SIZE RES STATE C TIME WCPU COMMAND 20928 mongodb 1 52 0 100M 40412K wait 0 0:00 0.00% mongod 26645 root 1 20 0 23588K 3408K pause 1 0:00 0.00% tcsh 20391 root 1 20 0 17084K 2480K wait 1 0:00 0.00% sh 20898 mongodb 1 52 0 23592K 2492K pause 0 0:00 0.00% csh 20821 root 1 20 0 14512K 1748K select 1 0:00 0.00% syslogd 20870 root 1 52 0 47724K 2252K wait 1 0:00 0.00% su 21003 mongodb 1 52 0 104M 41244K umtxn 1 0:00 0.00% mongod 20862 root 1 20 0 17084K 2580K wait 0 0:00 0.00% sh 73529 root 1 20 0 21936K 2292K CPU1 1 0:00 0.00% top 21000 mongodb 1 52 0 100M 40408K wait 0 0:00 0.00% mongod MongoDB is stuck in state 'umtxn'. And procstat: root@recipes:/ # procstat -kk 21003 PID TID COMM TDNAME KSTACK 21003 100205 mongod - mi_switch+0xe1 sleepq_catch_signals+0xab sleepq_wait_sig+0xf _sleep+0x27d umtxq_sleep+0x125 do_lock_umutex+0x1f74 __umtx_op_wait_umutex+0x78 amd64_syscall+0x357 Xfast_syscall+0xfb root@recipes:/ # procstat -r 21003 PID COMM RESOURCE VALUE 21003 mongod user time 00:00:00.000000 21003 mongod system time 00:00:00.007805 21003 mongod maximum RSS 40940 KB 21003 mongod integral shared memory 14588 KB 21003 mongod integral unshared data 360 KB 21003 mongod integral unshared stack 128 KB 21003 mongod page reclaims 324 21003 mongod page faults 0 21003 mongod swaps 0 21003 mongod block reads 1 21003 mongod block writes 1 21003 mongod messages sent 0 21003 mongod messages received 0 21003 mongod signals received 0 21003 mongod voluntary context switches 2 21003 mongod involuntary context switches 0 root@recipes:/ # procstat -t 21003 PID TID COMM TDNAME CPU PRI STATE WCHAN 21003 100205 mongod - 1 152 sleep umtxn root@recipes:/ # uname -a FreeBSD recipes 10.2-RELEASE FreeBSD 10.2-RELEASE #0 r286666: Wed Aug 12 15:26:37 UTC 2015 root@releng1.nyi.freebsd.org:/usr/obj/usr/src/sys/GENERIC amd64 It looks like maybe a deadlock is preventing the context switch. This happens every time I reset the jail. -- You are receiving this mail because: You are the assignee for the bug.