From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 16 08:59:27 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id D1E5A88A for ; Fri, 16 Nov 2012 08:59:27 +0000 (UTC) (envelope-from white.heron@yahoo.com) Received: from nm11-vm0.bullet.mail.ne1.yahoo.com (nm11-vm0.bullet.mail.ne1.yahoo.com [98.138.90.58]) by mx1.freebsd.org (Postfix) with ESMTP id 7D7CA8FC08 for ; Fri, 16 Nov 2012 08:59:27 +0000 (UTC) Received: from [98.138.90.57] by nm11.bullet.mail.ne1.yahoo.com with NNFMP; 16 Nov 2012 08:56:29 -0000 Received: from [98.138.88.237] by tm10.bullet.mail.ne1.yahoo.com with NNFMP; 16 Nov 2012 08:56:29 -0000 Received: from [127.0.0.1] by omp1037.mail.ne1.yahoo.com with NNFMP; 16 Nov 2012 08:56:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 632808.51897.bm@omp1037.mail.ne1.yahoo.com Received: (qmail 24720 invoked by uid 60001); 16 Nov 2012 08:56:28 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s1024; t=1353056188; bh=e8rmlm4XIU2vji5IgSEc+ggX5WjJt3UXGj5dxzcAOzw=; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=bWqrqx7etfYY6KOBlYQJP251nZoIc7/k7joGeQMEgF6pc14cHWlttkcRNyxTgtkXJuqXMMGV+qpDpMU1KN7yM1nNC2j9bewk2p+1JgubhgXALq1AQOv9hdrUhLwRQsQpZ2zSyiYfW1/nXYWHVgvh8KvKJFdHPql8nqmLh4Y9p/Y= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com; h=X-YMail-OSG:Received:X-Rocket-MIMEInfo:X-Mailer:Message-ID:Date:From:Reply-To:Subject:To:MIME-Version:Content-Type; b=KM7eVZxO3Fh91TuBLFwTvApjJO+bD93Psx0kcDDstAbes5l47RE+ZeYMBnJRdEaxfHzc3L/YZysnwaKQA02PYlYJu3E5jf/1u0LWfWF3nbWRBWq5USRqf8nMq8ujZhvoW5MstG0ZBghK3IQ7oK7d0vvq32SHmYMB8ByxUivinKc=; X-YMail-OSG: OefXnGIVM1k_VdcP2eOD_DN8QT1YskR8awfSsmBHoz4zX4k P3ZNuekh.625k1srp5.eHXWYZaaETYAe0rLh2bA6Sn.TaedyRa1BYYC.ehs2 93c5YJcLLWC_jo1j2Uw6.Uc81kVWC.OhxpwmD.PNL_fFnN9Nlwsq6C6urEmL UAkcSnVRuBW8oRZK6_aEKMkpcNzcmoFgftFjy.x3su8ohvYwZM3tTC_MpBKg pSc6_50VCA_9zOm.3M1npWfjHefqGS8I_A5yITgRjC5KU1tcvuupwkOjQ04G dJb2iFGv2YpK1KjLGNRVHtp3R7N5dt5o0AcjIa0ndJArrMl.BISI2FPVqZui 3bJtIWpfQaK7ZkNEfd7qOYp0s8sRD8MGELXlZwCDiOKwvcat4GbuTeuMoFOd KNGyUtTttA3ehuDbolK4Kio69K6aKSI2o39q8CQV32JXP5Mk0vz4vV1OlMji 8RTjlE4CT43yI_8L86syTi86NsMrRViOKJ7NcxUDCisDx7uhdng-- Received: from [42.152.12.185] by web110712.mail.gq1.yahoo.com via HTTP; Fri, 16 Nov 2012 00:56:28 PST X-Rocket-MIMEInfo: 001.001, RGVhciBBbGwsCgpJIGFtIGtlZW4gdG8ga25vdyBpZiB5b3UgaGF2ZSBhbnkgZ3VpZGVsaW5lIGZvciBCdWlsZCBhbmQgUmVsZWFzZSBBdXRvbWF0aW9uIHdpdGggUGVybCBMYW5ndWFnZS4KSSBhbSBpbnRlcmVzdGVkIHRvIGRyaWxsIGRvd24gZnVydGhlciB0byBleHBsb3JlIHRoaXMgZmllbGQuIEtpbmRseSBhZHZpc2VkLiBUaGFua3MuCsKgClJlZ2FyZHMsCgoKTVQgVEFKVURJTgEwAQEBAQ-- X-Mailer: YahooMailWebService/0.8.123.460 Message-ID: <1353056188.15906.YahooMailNeo@web110712.mail.gq1.yahoo.com> Date: Fri, 16 Nov 2012 00:56:28 -0800 (PST) From: "white.heron white" Subject: Build and Release automation with Perl. To: "freebsd-hackers@freebsd.org" MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.14 X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: "white.heron white" List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 08:59:28 -0000 Dear All,=0A=0AI am keen to know if you have any guideline for Build and Re= lease Automation with Perl Language.=0AI am interested to drill down furthe= r to explore this field. Kindly advised. Thanks.=0A=A0=0ARegards,=0A=0A=0AM= T TAJUDIN From owner-freebsd-hackers@FreeBSD.ORG Fri Nov 16 12:30:15 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 32922614; Fri, 16 Nov 2012 12:30:15 +0000 (UTC) (envelope-from asmrookie@gmail.com) Received: from mail-lb0-f182.google.com (mail-lb0-f182.google.com [209.85.217.182]) by mx1.freebsd.org (Postfix) with ESMTP id 70E5B8FC12; Fri, 16 Nov 2012 12:30:13 +0000 (UTC) Received: by mail-lb0-f182.google.com with SMTP id gg13so2644434lbb.13 for ; Fri, 16 Nov 2012 04:30:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:reply-to:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; bh=x6pkarpIu2txHyeISNTYtEBC+DnhdRw5xk3vxEBjZxM=; b=RfIIjb5KwUdlvGlI3O55P7+AVJm9b10Lvx4OsPMORCkXhf9DZG1FnPFzK/XsxYfc/7 1HVtg/Zm6+dne31XPKhBptCtWJW7Ddt3luXnuFSVVJ6XN5fmKnBS4vH9jU3nvNrhJKTn BQDqSVn/vD6N/UkFaD5WcQs1tdvu1lqbsy/PR05/4MFlZr+M6JsIEv5hOCtaTeS7OvdA 89Gp5A/YjVWsN+1vhsMeEDvcB8MdDjwfyNGqsBDEn4pIgUC0oB9o9IyEcXxxAyX3F0Gh PSq/GT3mC29lUXQMcuK+JrUw/GdoKGOrZ3MAUQvnJghb7U1ez1x/SuFSdFXpgvzjM4uL d9/Q== MIME-Version: 1.0 Received: by 10.152.132.3 with SMTP id oq3mr4072246lab.18.1353069013097; Fri, 16 Nov 2012 04:30:13 -0800 (PST) Sender: asmrookie@gmail.com Received: by 10.112.134.5 with HTTP; Fri, 16 Nov 2012 04:30:12 -0800 (PST) In-Reply-To: <50A5F12C.1050902@FreeBSD.org> References: <50A5F12C.1050902@FreeBSD.org> Date: Fri, 16 Nov 2012 12:30:12 +0000 X-Google-Sender-Auth: M9DuE0VU4l0D4k-H-XsHXG100Lo Message-ID: Subject: Re: stop_cpus_hard when multiple CPUs are panicking from an NMI From: Attilio Rao To: Andriy Gapon Content-Type: text/plain; charset=UTF-8 Cc: freebsd-hackers@freebsd.org, Ryan Stone X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: attilio@FreeBSD.org List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 16 Nov 2012 12:30:15 -0000 On Fri, Nov 16, 2012 at 7:54 AM, Andriy Gapon wrote: > on 16/11/2012 00:58 Ryan Stone said the following: >> At work we have some custom watchdog hardware that sends an NMI upon >> expiry. We've modified the kernel to panic when it receives the watchdog >> NMI. I've been trying the "stop_scheduler_on_panic" mode, and I've >> discovered that when my watchdog expires, the system gets completely >> wedged. After some digging, I've discovered is that I have multiple CPUs >> getting the watchdog NMI and trying to panic concurrently. One of the CPUs >> wins, and the rest spin forever in this code: >> >> /* >> * We don't want multiple CPU's to panic at the same time, so we >> * use panic_cpu as a simple spinlock. We have to keep checking >> * panic_cpu if we are spinning in case the panic on the first >> * CPU is canceled. >> */ >> if (panic_cpu != PCPU_GET(cpuid)) >> while (atomic_cmpset_int(&panic_cpu, NOCPU, >> PCPU_GET(cpuid)) == 0) >> while (panic_cpu != NOCPU) >> ; /* nothing */ >> >> The system wedges when stop_cpus_hard() is called, which sends NMIs to all >> of the other CPUs and waits for them to acknowledge that they are stopped >> before returning. However the CPU will not deliver an NMI to a CPU that is >> already handling an NMI, so the other CPUs that got a watchdog NMI and are >> spinning will never go into the NMI handler and acknowledge that they are >> stopped. > > I thought about this issue and fixed (in my tree) in a different way: > http://people.freebsd.org/~avg/cpu_stop-race.diff > > The need for spinlock_enter in the patch in not entirely clear. > The main idea is that a CPU which calls cpu_stop and loses a race should > voluntary enter cpustop_handler. > I am also not sure about MI-cleanness of this patch. It is similar to what I propose but with some differences: - It is not clean from MI perspective - I don't think we need to treact it specially, I would just unconditionally stop all the CPUs entering in the "spinlock zone", making the patch simpler. So I guess you are really fine with the proposal I made? Thanks, Attilio -- Peace can only be achieved by understanding - A. Einstein