From owner-freebsd-threads@freebsd.org Mon Dec 26 10:26:50 2016 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 C1729C90D6F for ; Mon, 26 Dec 2016 10:26:50 +0000 (UTC) (envelope-from gjinjun@gmail.com) Received: from mail-oi0-x233.google.com (mail-oi0-x233.google.com [IPv6:2607:f8b0:4003:c06::233]) (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 89F30C93 for ; Mon, 26 Dec 2016 10:26:50 +0000 (UTC) (envelope-from gjinjun@gmail.com) Received: by mail-oi0-x233.google.com with SMTP id 128so126558583oig.0 for ; Mon, 26 Dec 2016 02:26:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=dx2hpOjwK1hH/wXjXd2kSSCGWU/i1J4NnZMhlsAk32o=; b=Ui+l3482npcWtaCVky+QVJDt2pqr4bm/g1Vsknse++Uux97kQJh28XR9Omqrkqb3rG JNH8Gteokk0oA8ET4KyOWFbjTXt3/xivGDZU7K4U1SKINM3eatDVCzFebbY0izlIuwcx wZu/+nOeTwLyI9JtkLkAOxUUBplUMtaEj5+m3FEv8Gl9a7s2QitmQ1+Oe13cRUBWbe1R edu4ji/h2oiq10qNG6Kcc22eACzhvpXy3oqs7kN+zr/ZrXgZhoD2kcUCJbFnOtqZctRm faB1OYvz9VsCz5Ex3UiomO4XDpFdd1mSUO7k8RehxbAxby9tB2QPE/Eb0zq6qKJWHoWS iyWA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=dx2hpOjwK1hH/wXjXd2kSSCGWU/i1J4NnZMhlsAk32o=; b=luOTr+zasoT5n52NClhdfozygofDKpGhR6cQc5Z6k2DM9hDDIgxh54/OBzw/wOVUx7 sM2VSx/tO8utA4BuESX9HELw5PCZA9wfkC5RtRvWDD+9oQDoqyiI3uKJuM2FIq8p/B87 o0njaSeMCueCr1HAb3/bm3ofpy9jkt6WMmOzFc82WdF+AByqb5Jxf+k7dsUDc323eFLR mKqlTqmGxTDbO83P8Y5gUYlCaYcmUhjWlSgXKxwfjHUmw7NooUqCPRkUy6xeCh6e8R2d YXaIxS8vxyDe8bxitqCWk+GWGKIpDicDZzEPkiF1DSRR9HhJE2L4Z4mH1KxdZ6A5PdNt E3+Q== X-Gm-Message-State: AIkVDXJxp28vQ0J4U4Y+cfY2ghredtSy8bkj3YHC99PPBCFx4+xR8oZDaMzd/usyzaKvejj0+y1oJKqt+ziZeQ== X-Received: by 10.202.71.131 with SMTP id u125mr13229885oia.170.1482748009466; Mon, 26 Dec 2016 02:26:49 -0800 (PST) MIME-Version: 1.0 Received: by 10.157.33.136 with HTTP; Mon, 26 Dec 2016 02:26:48 -0800 (PST) From: jinjun gao Date: Mon, 26 Dec 2016 18:26:48 +0800 Message-ID: Subject: Why need not to PROC_UNLOCK() in kthread_suspend()/kproc_suspend()? To: freebsd-threads@freebsd.org Content-Type: text/plain; charset=UTF-8 X-Content-Filtered-By: Mailman/MimeDel 2.1.23 X-BeenThere: freebsd-threads@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 10:26:50 -0000 Hi Guys, In file sys/kern/kern_kthread.c ( https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_kthread.c), the PROC_LOCK() and PROC_UNLOCK() are used in pairs in one function except function kthread_suspend()/kproc_suspend() ( https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_kthread.c#L177). In these two functions, there is only PROC_LOCK(). I checked may related function(such as kproc_resume()) and can not find PROC_UNLOCK() to pair the one resided in kproc_suspend(). Why need not PROC_UNLOCK() to pair PROC_LOCK() in kproc_suspend()/kthread_suspend()? Thanks! regards, Jinjun From owner-freebsd-threads@freebsd.org Mon Dec 26 11:04:07 2016 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 A94E0C0BADF for ; Mon, 26 Dec 2016 11:04:07 +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 372B112CF for ; Mon, 26 Dec 2016 11:04:07 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kib@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id uBQB417w095129 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Mon, 26 Dec 2016 13:04:01 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua uBQB417w095129 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id uBQB418B095128; Mon, 26 Dec 2016 13:04:01 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Mon, 26 Dec 2016 13:04:01 +0200 From: Konstantin Belousov To: jinjun gao Cc: freebsd-threads@freebsd.org Subject: Re: Why need not to PROC_UNLOCK() in kthread_suspend()/kproc_suspend()? Message-ID: <20161226110400.GP94325@kib.kiev.ua> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.7.2 (2016-11-26) 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.23 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 26 Dec 2016 11:04:07 -0000 On Mon, Dec 26, 2016 at 06:26:48PM +0800, jinjun gao wrote: > Hi Guys, > > In file sys/kern/kern_kthread.c ( > https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_kthread.c), > the PROC_LOCK() and PROC_UNLOCK() are used in pairs in one function except > function kthread_suspend()/kproc_suspend() ( > https://github.com/freebsd/freebsd/blob/master/sys/kern/kern_kthread.c#L177). > In these two functions, there is only PROC_LOCK(). I checked may related > function(such as kproc_resume()) and can not find PROC_UNLOCK() to pair the > one resided in kproc_suspend(). Why need not PROC_UNLOCK() to pair > PROC_LOCK() in kproc_suspend()/kthread_suspend()? Thanks! > Because later msleep(9) is called with the process lock and PDROP flag. From owner-freebsd-threads@freebsd.org Tue Dec 27 19:20:48 2016 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 BC37CC9367D for ; Tue, 27 Dec 2016 19:20:48 +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 AB6991C21 for ; Tue, 27 Dec 2016 19:20:48 +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 uBRJKmFR058734 for ; Tue, 27 Dec 2016 19:20:48 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-threads@FreeBSD.org Subject: [Bug 79683] svctcp_create() fails if multiple threads call at the same time, it's not thread-safe Date: Tue, 27 Dec 2016 19:20:48 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: threads X-Bugzilla-Version: 5.3-STABLE X-Bugzilla-Keywords: X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: hiren@FreeBSD.org X-Bugzilla-Status: Closed X-Bugzilla-Resolution: FIXED X-Bugzilla-Priority: Normal X-Bugzilla-Assigned-To: freebsd-threads@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: bug_status resolution cc Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable 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.23 Precedence: list List-Id: Threading on FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Dec 2016 19:20:48 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D79683 Hiren Panchasara changed: What |Removed |Added ---------------------------------------------------------------------------- Status|In Progress |Closed Resolution|--- |FIXED CC| |hiren@FreeBSD.org --- Comment #2 from Hiren Panchasara --- As per the last comment. --=20 You are receiving this mail because: You are the assignee for the bug.=