Date: Sun, 2 Apr 2017 03:27:04 +0000 (UTC) From: Jin Guojun <jguojun@sbcglobal.net> To: FreeBSD Questions Mailing List <freebsd-questions@freebsd.org> Subject: Re: 10.3 system hangs when existing from X with radeon cards/driver Message-ID: <1167907592.9096642.1491103624078@mail.yahoo.com> In-Reply-To: <1367028502.7607768.1490997691827@mail.yahoo.com> References: <1367028502.7607768.1490997691827.ref@mail.yahoo.com> <1367028502.7607768.1490997691827@mail.yahoo.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This seems not the Xorg server issue.Replaced xf86-video-ati (ati_drv.so, radeon_drv.so) from working 11.0 system, the problem persists.Then, replace xorg-server 1.17.x from 11.0 as well, existing X using radeon video cards still hangs the system.Not sure if this is caused by some dynamic libraries X uses. On Friday, March 31, 2017 3:01 PM, Jin Guojun <jguojun@sbcglobal.net> wrote: When using Radeon Video cards (X600/RV370, HD2400/RV610, HD4650/RV730) in FreeBSD 10.3, existing X causes system hanging.Event installed the xorg-7.7_2 with latest xf86-video-ati driver released on Feb 24, 2017, this problem still exists. The xorg-7.7_2 in FreeBSD 11.0 and 12-Current do not have this problem.Has anyone seen this problem?And any suggestion on solving this problem on 10.3-R? -Jin From owner-freebsd-questions@freebsd.org Sun Apr 2 08:30:38 2017 Return-Path: <owner-freebsd-questions@freebsd.org> Delivered-To: freebsd-questions@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 857E3D29BAF for <freebsd-questions@mailman.ysv.freebsd.org>; Sun, 2 Apr 2017 08:30:38 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: from mail-pg0-x234.google.com (mail-pg0-x234.google.com [IPv6:2607:f8b0:400e:c05::234]) (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 4CFF0666 for <freebsd-questions@freebsd.org>; Sun, 2 Apr 2017 08:30:38 +0000 (UTC) (envelope-from ablacktshirt@gmail.com) Received: by mail-pg0-x234.google.com with SMTP id g2so95400242pge.3 for <freebsd-questions@freebsd.org>; Sun, 02 Apr 2017 01:30:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding; bh=BFoNGxwomHEdbNTkrQcXrlQlL/b8oD2/jKHFj5PXE3w=; b=uqNwI3FcVTEno1/TSPtcDQxEQZ8e4aafqXM0Nw3yPunyFoAtBGOiTapB1eR0NpN31u knbo1z3V6ZGKQWPcg0003B3DsUrrBVSBUR8oiTIp7aYOAg7VMzv2PQGjU35r6i2QUzex R8ukQmy/iCjcsSpWBPekEi91JPArRa0H8HwtrosP+LDThFl2vIgNlRCGW/8oUDDPxkp4 CuNA+xO7et0LE0v9F/oRlnFfVXmNvnZ3Kbe9ubEK2hTMSuhgSxKy93pA+mXTX5mFPyTF /qhTdzaxu5bRypqcMzbq3v5JXlKAhSNx7cgiYeM0RznvhTLcVRnOlwE8GwrckYeODuMn 5ijA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding; bh=BFoNGxwomHEdbNTkrQcXrlQlL/b8oD2/jKHFj5PXE3w=; b=V6Vz7OrG1nfi6LOo5aJ1OsGsiDIgeNDpaqL60ViN/yl9HuqKZlMFcgipoIU5ZYnZ0F w6Eq7YcElZnQ5dfIFOCQLsPPWigegiSgn16lnigUAIS9stTwHTT92AT2ua8koJ5sDyb+ 4kWiudySZA5tQwxquaC1lXRepB/JICLsqjGjfu8aFX2fNUTXPuc+lPFiwjvlHuRr4tee bOg2Ili19Apy8r06C5GP0FD8ArqKyhfB6O/dELFrqiCx6ObJX+gG4tM4BFk0pxAwOImv x+egEs6FVnAp292GXWCv1japjczVTgFqIqOnbSVddC8yydUh6J8Fqytzr7R7uo2ceN0u 9g7A== X-Gm-Message-State: AFeK/H0hsMdUsCIrE0izEJxMl2MtdXMEmDA6A+txqM2lh/Y8xN47J+Iln1TsR0AwoBPj2Q== X-Received: by 10.84.211.130 with SMTP id c2mr14077025pli.82.1491121837491; Sun, 02 Apr 2017 01:30:37 -0700 (PDT) Received: from [192.168.1.115] ([223.73.97.188]) by smtp.gmail.com with ESMTPSA id h9sm19294550pfd.103.2017.04.02.01.30.32 for <freebsd-questions@freebsd.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 02 Apr 2017 01:30:36 -0700 (PDT) To: freebsd-questions@freebsd.org From: Yubin Ruan <ablacktshirt@gmail.com> Subject: Understanding the FreeBSD locking mechanism Message-ID: <e5b5f272-7515-05f8-ac6a-14c7bac4346c@gmail.com> Date: Mon, 3 Apr 2017 00:30:22 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions <freebsd-questions.freebsd.org> List-Unsubscribe: <https://lists.freebsd.org/mailman/options/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=unsubscribe> List-Archive: <http://lists.freebsd.org/pipermail/freebsd-questions/> List-Post: <mailto:freebsd-questions@freebsd.org> List-Help: <mailto:freebsd-questions-request@freebsd.org?subject=help> List-Subscribe: <https://lists.freebsd.org/mailman/listinfo/freebsd-questions>, <mailto:freebsd-questions-request@freebsd.org?subject=subscribe> X-List-Received-Date: Sun, 02 Apr 2017 08:30:38 -0000 Hi, I am reading the FreeBSD source code related to its locking mechanism. I have done some researches but still cannot understand some codes. Let's take `spinlock' for example. I know there are different kinds of mutex in FreeBSD: spin mutex and other kinds of mutex. I try to locate the source of spin mutex but what I find all look very weird to me. For example, the `spinlock_enter()` 1816 void 1817 spinlock_enter(void) 1818 { 1819 struct thread *td; 1820 register_t flags; 1821 1822 td = curthread; 1823 if (td->td_md.md_spinlock_count == 0) { 1824 flags = intr_disable(); 1825 td->td_md.md_spinlock_count = 1; 1826 td->td_md.md_saved_flags = flags; 1827 } else 1828 td->td_md.md_spinlock_count++; 1829 critical_enter(); 1830 } Does this function provides the ordinary "spinlock" functionality? There is no special "test-and-set" instruction, and neither any extra locking to protect internal data structure manipulation. Isn't this subjected to race condition? I also checked the `mtx_lock()`, but neither can't find a seemingly correct implementation. Do I miss anything? Which is the real implementation of the spin lock in FreeBSD? Thanks Yubin Ruan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?1167907592.9096642.1491103624078>