From owner-svn-src-head@freebsd.org Sun Feb 18 21:08:28 2018 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id B4B8BF043E2; Sun, 18 Feb 2018 21:08:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (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 481FD6BA8D; Sun, 18 Feb 2018 21:08:28 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qt0-x242.google.com with SMTP id d26so10023186qtk.10; Sun, 18 Feb 2018 13:08:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=qVypv9QH8tHzHYobluDLZaWYO0r65SHaEZex0UgfIOI=; b=ABbAuxwCipxjsyLIrhlm2aojH8tAy6lXEjt+5coYsynx6/pDm+JHLCh98eTHp1yeux CXbAk3zpVcIjFfb+s3byXyB4DJShzNbueHhpwOnQdeh0hlcKzn6FDg47UR2tJ8SzI4AL qWmbDD/jJwVb0Suwy/JEOmz4+C2priJ2s+dBtPN5O/7r6RclCRcSqLzLoU1UMWvL5wqn MJAWIhdIxiB7q48zwglAavr0N1rqM6mib+1fENjhwpTo78Y+8E9F5WulhJrU6tpWVzWw 2y6x0AxjWkELS3LCTTv3JrST0JNJCrNygiTJwwVhA6h46crGPhtJGMvmFrYR0Q6jdQGX joNw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=qVypv9QH8tHzHYobluDLZaWYO0r65SHaEZex0UgfIOI=; b=PxQy8qEz4UiLakakjS0Sev7KYTmhzyJpXYrxxagPZRHbF1lDrhfbsOa5TG8t3dJRRD zYRPluYoLu0Gf3abRttHOhcGw91MA+3jlseeXQbFbWIbA/Gf3f+ZWaUrXAGCygh5SFPW kpNJQsIAh7+seL/jQVpwLiF+L6715zJlzDvqbHKDocJfZSszgDGmKIIKhNbmXRLU2unW Hxkhmeeh2xCMwN27jStOJ63tNFc6FcVOIMH+8ob0gT6PnbjphHvr5uaYfR7z+akzaByb 79lOvcQS0IVq7nl6jGu7VOejlPhZXFAaFPF5m7+RvFmuPm0sCIeK39VZOoPQ/HLpaSiX X+sg== X-Gm-Message-State: APf1xPC4sOdVum4MiIaSyQ8V3R/SaS/aNPkzMhbzKDUrpO5GlWRPI3cK z0OkV4wqkozpBe+iDTBnQdfmVb1rs7LuJ4FRK+BF4A== X-Google-Smtp-Source: AH8x2248uQ2gyPvjkRdwAiGf4fZZaIRXTIUJg11mfBOjq43IN4iwLkknGxSJLsan6eCDrC0zH5+iFOgLqj9pCGgJ3cc= X-Received: by 10.237.62.233 with SMTP id o38mr20406335qtf.3.1518988107945; Sun, 18 Feb 2018 13:08:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.237.58.99 with HTTP; Sun, 18 Feb 2018 13:08:27 -0800 (PST) In-Reply-To: <20180218204637.GA16922@x2.osted.lan> References: <201802170848.w1H8mkfb081764@repo.freebsd.org> <20180217112738.GO94212@kib.kiev.ua> <20180217162632.GQ94212@kib.kiev.ua> <20180217163822.GA81555@x2.osted.lan> <20180217184259.GA84054@x2.osted.lan> <20180218204637.GA16922@x2.osted.lan> From: Mateusz Guzik Date: Sun, 18 Feb 2018 22:08:27 +0100 Message-ID: Subject: Re: svn commit: r329448 - head/sys/kern To: Peter Holm Cc: Konstantin Belousov , Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 18 Feb 2018 21:08:29 -0000 Thanks, committed in r329531. On Sun, Feb 18, 2018 at 9:46 PM, Peter Holm wrote: > On Sat, Feb 17, 2018 at 07:47:38PM +0100, Mateusz Guzik wrote: > > On Sat, Feb 17, 2018 at 7:42 PM, Peter Holm wrote: > > > > > On Sat, Feb 17, 2018 at 06:34:34PM +0100, Mateusz Guzik wrote: > > > > On Sat, Feb 17, 2018 at 5:38 PM, Peter Holm wrote: > > > > > > > > > On Sat, Feb 17, 2018 at 06:26:32PM +0200, Konstantin Belousov > wrote: > > > > > > On Sat, Feb 17, 2018 at 05:07:07PM +0100, Mateusz Guzik wrote: > > > > > > > On Sat, Feb 17, 2018 at 01:27:38PM +0200, Konstantin Belousov > > > wrote: > > > > > > > > On Sat, Feb 17, 2018 at 08:48:46AM +0000, Mateusz Guzik > wrote: > > > > > > > > > Author: mjg > > > > > > > > > Date: Sat Feb 17 08:48:45 2018 > > > > > > > > > New Revision: 329448 > > > > > > > > > URL: https://svnweb.freebsd.org/changeset/base/329448 > > > > > > > > > > > > > > > > > > Log: > > > > > > > > > exit: get rid of PROC_SLOCK when checking a process to > report > > > > > > > > Was this tested ? > > > > > > > > > > > > > > > > > > > > > > I was trussing multithreaded microbenchmarks, no issues. > > > > > > > > > > > > > > > In particular, are you aware of r309539 ? > > > > > > > > > > > > > > > > > > > > > > So it looks like I misread the code - I have grepped > > > > > > > thread_suspend_switch operating with the proc locked and > misread > > > > > > > thread_suspend_one's assert as PROC_LOCK_ASSERT. > > > > > > > > > > > > > > That said, I think this is harmless. Regardless of the lock the > > > > > > > inspecting thread can race and check "too soon". Even for a > case > > > where > > > > > > > it decides to report, I don't see anything which would depend > on > > > the > > > > > > > suspending thread to finish. > > > > > > It was definitely not harmless when I tried to avoid the spin > lock > > > there, > > > > > > but I do not remember exact failure mode. Most likely, it was a > > > missed > > > > > > report of the traced child indeed, but I am not sure that truss > > > triggered > > > > > > it. Most likely, Peter Holm was the reporter, since he is > listed in > > > > > > the commit. > > > > > > > > > > > > > > > > I ran a truss(1) test on r329456 and it fails. I have not had a > > > > > chance to look closer at this, but this is what I see: > > > > > > > > > > [root@mercat1 /home/pho]# pgrep truss | xargs ps -Hlp > > > > > UID PID PPID CPU PRI NI VSZ RSS MWCHAN STAT TT TIME > COMMAND > > > > > 0 41149 41118 0 52 0 11532 2588 wait I 0 0:01.38 truss > > > > > /tmp/ttruss 10 > > > > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.98 > > > /tmp/ttruss > > > > > 10 > > > > > 0 41151 41149 0 52 0 13156 2300 - TX 0 0:00.00 > > > /tmp/ttruss > > > > > 10 > > > > > [root@mercat1 /home/pho]# procstat -k 41151 > > > > > PID TID COMM TDNAME KSTACK > > > > > 41151 100211 ttruss - mi_switch > > > > > thread_suspend_switch ptracestop amd64_syscall fast_syscall_common > > > > > 41151 100765 ttruss - mi_switch > > > > > thread_suspend_check ast doreti_ast > > > > > [root@mercat1 /home/pho]# > > > > > > > > > > > > > > Ok, I reproduced the bug with your script. I reverted the change. > > > > > > > > The patch I mailed in this thread fixes it for me. Below is a variant > > > > which can be applied on top of fresh head: > > > > > > > > https://people.freebsd.org/~mjg/wait6_slock.diff > > > > > > > > > > Yes, this also works for me with the truss(1) test scenario. > > > Would you like me to run the full set of test? > > > > > > > > If you have free cycles I don't see why not, thanks. > > > > I ran all of the tests in stress2 on amd64. > No problems found. > > - Peter > -- Mateusz Guzik