From owner-svn-src-head@freebsd.org Thu Jan 18 14:14:42 2018 Return-Path: Delivered-To: svn-src-head@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 D1090E7CD9C for ; Thu, 18 Jan 2018 14:14:42 +0000 (UTC) (envelope-from wma@semihalf.com) Received: from mail-qt0-x229.google.com (mail-qt0-x229.google.com [IPv6:2607:f8b0:400d:c0d::229]) (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 A0A3E6EFE5 for ; Thu, 18 Jan 2018 14:14:42 +0000 (UTC) (envelope-from wma@semihalf.com) Received: by mail-qt0-x229.google.com with SMTP id o35so20361245qtj.13 for ; Thu, 18 Jan 2018 06:14:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=semihalf-com.20150623.gappssmtp.com; s=20150623; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=rL4kMKdUyDuUKfHpilCv1Bu8DvcGPl8PwEiYJ5AXQV4=; b=Z6UC612Cl3AIBGtFsarc9763UZRttWfNiFx5G0SkvMgF0wqhYuTfTSpKcNnkqvbdVd sRoTEqdMyJcXIRY56QACDoVn5geWuVeZXGhAJn0Im18CeCWOIaRWxVabk8vYM1oRTRaE qLoBrmg6EqiefqIpwEBXHzCybtOKNVQ2qMh74f+m0/C3myKbzY23Z+FRJ5JgadHANl12 5oW6iHnpD/NMxagQLcSk+fEJeeGeqfBJnZKfcvDPlKOKgTO4kAfbizo3ZxTy927wCLrL 9D4MOTO8Jn1pxzOAX9EWwp3KzAlBiyEYuhib08Xg2Oxg63kF01DqXKBn8nUnCl4Xc80Y mYeg== 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=rL4kMKdUyDuUKfHpilCv1Bu8DvcGPl8PwEiYJ5AXQV4=; b=O1R59i5kVQKLIj9FlUOLclpAAoTx+CGuwxJpm5pTqUokfmkhWTRptJ+gfxde6JW9m7 qdIIx1dgG0wdWJeYVyJAwURGZ+0/15ddPCgtf3IO7bmq/2uA0/yQLCWkcMl6Q1BDUGeB gIUD1inCjHNkWUEQqsMoQRr9f3uOol+fUoPiHelH+sJZ+KJp9uyRXO7cIJ1soaLVwwVt IAXeDEvzGtrS63+iPxNblDbmC25ffuYOesdBP/X11ukYz0NB6eH8lBAyfIcEbIJjl/Ks uXS22AHY0ApBpkozQsaQzYWYmtVzcN6pjAgZ5UnwMwvsBIFJ1e0mn8mIcG/kgSIJ6+Ii zd2A== X-Gm-Message-State: AKwxytcWPz2J50hYuFW5sR/jOEn/PpZmb5k4L+Nzm2+JKbqOMaYbxqLf 4SdOVrZL4oio1YeXy+rfweQ0Rw4dJSqyswq2Ogv3L2cK X-Google-Smtp-Source: ACJfBosY0FwZDeGPMHtA6F4BQJro0ngZ7oDZNdztPWml6NsdnuTmueyN2bDJIXNieFRhXJWMQ0DP5FeYwWAxOZ1Ta2s= X-Received: by 10.55.217.132 with SMTP id q4mr60504370qkl.236.1516284881732; Thu, 18 Jan 2018 06:14:41 -0800 (PST) MIME-Version: 1.0 Received: by 10.200.42.122 with HTTP; Thu, 18 Jan 2018 06:14:21 -0800 (PST) In-Reply-To: References: <201801180738.w0I7cswv054484@repo.freebsd.org> From: Wojciech Macek Date: Thu, 18 Jan 2018 15:14:21 +0100 Message-ID: Subject: Re: svn commit: r328110 - head/sys/kern To: Andriy Gapon , Patryk Duda Cc: Wojciech Macek , 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: Thu, 18 Jan 2018 14:14:42 -0000 Adding author wma 2018-01-18 11:43 GMT+01:00 Andriy Gapon : > On 18/01/2018 09:38, Wojciech Macek wrote: > > Author: wma > > Date: Thu Jan 18 07:38:54 2018 > > New Revision: 328110 > > URL: https://svnweb.freebsd.org/changeset/base/328110 > > > > Log: > > KDB: restart only CPUs stopped by KDB > > > > There is a case when not all CPUs went online. In that situation, > > restart only APs which were operational before entering KDB. > > What is the context here? > I mean, what is the state of those CPUs that are not online? > > Also, it seems you allow for the situation where a CPU that was not online > at > the time of kdb_trap becomes online (and running) while kdb is active? > If that's so, then it can mess up the system big time. > > I think that this is not a right solution. > > P.S. > While not a recipe for a solution, these musing may be of interest to you: > https://lists.freebsd.org/pipermail/freebsd-arch/2011-June/011373.html > > > Created by: Wojciech Macek > > Obtained from: Semihalf > > Reviewed by: nwhitehorn > > Differential revision: https://reviews.freebsd.org/D13949 > > Sponsored by: QCM Technologies > > > > Modified: > > head/sys/kern/subr_kdb.c > > > > Modified: head/sys/kern/subr_kdb.c > > ============================================================ > ================== > > --- head/sys/kern/subr_kdb.c Thu Jan 18 06:28:21 2018 (r328109) > > +++ head/sys/kern/subr_kdb.c Thu Jan 18 07:38:54 2018 (r328110) > > @@ -673,6 +673,7 @@ kdb_trap(int type, int code, struct trapframe *tf) > > #ifdef SMP > > if (!SCHEDULER_STOPPED()) { > > other_cpus = all_cpus; > > + CPU_NAND(&other_cpus, &stopped_cpus); > > CPU_CLR(PCPU_GET(cpuid), &other_cpus); > > stop_cpus_hard(other_cpus); > > did_stop_cpus = 1; > > @@ -707,8 +708,9 @@ kdb_trap(int type, int code, struct trapframe *tf) > > kdb_active--; > > > > #ifdef SMP > > + CPU_AND(&other_cpus, &stopped_cpus); > > if (did_stop_cpus) > > - restart_cpus(stopped_cpus); > > + restart_cpus(other_cpus); > > #endif > > > > intr_restore(intr); > > > > > -- > Andriy Gapon >