From owner-freebsd-hackers@FreeBSD.ORG Sat Dec 17 08:27:29 2005 Return-Path: X-Original-To: freebsd-hackers@freebsd.org Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 8EDC916A41F for ; Sat, 17 Dec 2005 08:27:29 +0000 (GMT) (envelope-from guomingyan@gmail.com) Received: from xproxy.gmail.com (xproxy.gmail.com [66.249.82.199]) by mx1.FreeBSD.org (Postfix) with ESMTP id DFBA243D49 for ; Sat, 17 Dec 2005 08:27:28 +0000 (GMT) (envelope-from guomingyan@gmail.com) Received: by xproxy.gmail.com with SMTP id t12so631349wxc for ; Sat, 17 Dec 2005 00:27:28 -0800 (PST) DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=beta; d=gmail.com; h=received:message-id:date:from:to:subject:mime-version:content-type; b=qSis4eXfybJlUNvZAm5IwxYeQn+4aviKla8VAHBNpc13xE1q6tQzRsnd6ctbodW94zlhfH0ebaskrbheRnM5akyZoSQMn74ZBeSbbNQ+NT3c3pCwZ+LJWkXo159q0c+Y0nb/3Bd5WlMj+06U8MKiff9qUCX8ocwz20+hSC1pgn8= Received: by 10.70.16.15 with SMTP id 15mr2091140wxp; Sat, 17 Dec 2005 00:27:28 -0800 (PST) Received: by 10.70.39.18 with HTTP; Sat, 17 Dec 2005 00:27:28 -0800 (PST) Message-ID: <1fa17f810512170027h58ccadbcq9f8d3187f35a2ddd@mail.gmail.com> Date: Sat, 17 Dec 2005 16:27:28 +0800 From: prime To: freebsd-hackers@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Content-Disposition: inline X-Content-Filtered-By: Mailman/MimeDel 2.1.5 Subject: Puzzled about turnstile's lock X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 17 Dec 2005 08:27:29 -0000 Hi hackers, I want to understand the current implementation of turnstile,and meet some questions about its locks' logicality. turnstile's ``ts_blocked" field is protected by both ``td_contested" lock and its turnstile_chain lock, but I think its turnstile_chain lock is enough,because we allways get the turnstile_chain lock before our manipulation on ``ts_blocked". If td_contested lock were needed ,reading ts_blocked is not protected by td_contested lock,in the kernel source, why? Thanks. -- Three passions, simple but overwhelmingly strong, have governed my life: the longing for love, the search for knowledge, and unbearable pity for the suffering of mankind. ---------Bertrand Russell