From owner-svn-src-all@freebsd.org Thu Jan 18 12:22:50 2018 Return-Path: Delivered-To: svn-src-all@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 C09DDE76023; Thu, 18 Jan 2018 12:22:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: from mail-lf0-f67.google.com (mail-lf0-f67.google.com [209.85.215.67]) (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 515C96A1ED; Thu, 18 Jan 2018 12:22:50 +0000 (UTC) (envelope-from agapon@gmail.com) Received: by mail-lf0-f67.google.com with SMTP id k19so6157105lfj.1; Thu, 18 Jan 2018 04:22:50 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=5Ow33m2g2+hlOWU1FtE4KcmU+n6bvbUlGL6YcIpG8xw=; b=T3LYsODCG7amyKDcuniMynTwSJ13J1hcbaV86iTMSC359JlNpvIFoWZoKFGgKBAk+i +zRZ+5PKMKuluyEYmKPpYkyeuoaMdPs67Q56qZZymPy88wbeGnnjIHgyg5E8OCqg6qWx D9jrMy1A0wQg1dqXtpmu5T5xT3LHzcebd5TnZ+2Ix0+hB7Pxns2SrqcEltDHTZVB08YL hfnzyzw+wacAVoeA79hNiPTWoHhFoAcD7rdm7wvLXH26TLMyl/kr/8IrN50cSeJf4u0W rj/uBjp/mBmTonJFfPt78QBTBebFm2pnVx6J9gmD/c/Nb1QyRnbOBsvAGsSZUMKbny53 3BDA== X-Gm-Message-State: AKwxytf1rsLqivO1OdapCm9bEfrPyM+Eqr+wK/TBwTtHib7WOrBy9a09 C3H8BrD/FzQy42WUgqwyyJwfb0Eh X-Google-Smtp-Source: ACJfBovfe1k157h7gCLGpx3si/g8CfgEw38HXBlpB5MHBmKxKASVvqeOlRPIYNbQup6OTbMr1Ly8oQ== X-Received: by 10.25.28.142 with SMTP id c136mr24351505lfc.38.1516272239380; Thu, 18 Jan 2018 02:43:59 -0800 (PST) Received: from [192.168.0.88] (east.meadow.volia.net. [93.72.151.96]) by smtp.googlemail.com with ESMTPSA id k200sm1178371lfg.27.2018.01.18.02.43.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 18 Jan 2018 02:43:58 -0800 (PST) Subject: Re: svn commit: r328110 - head/sys/kern To: Wojciech Macek , src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org References: <201801180738.w0I7cswv054484@repo.freebsd.org> From: Andriy Gapon Message-ID: Date: Thu, 18 Jan 2018 12:43:57 +0200 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:52.0) Gecko/20100101 Thunderbird/52.5.2 MIME-Version: 1.0 In-Reply-To: <201801180738.w0I7cswv054484@repo.freebsd.org> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 18 Jan 2018 12:22:50 -0000 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