From owner-svn-src-head@freebsd.org Wed Jan 10 20:35:19 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 CF2F7E75605; Wed, 10 Jan 2018 20:35:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qk0-x22b.google.com (mail-qk0-x22b.google.com [IPv6:2607:f8b0:400d:c09::22b]) (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 869546AF1D; Wed, 10 Jan 2018 20:35:19 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qk0-x22b.google.com with SMTP id w1so789229qka.2; Wed, 10 Jan 2018 12:35:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=6HOrR4qmfAakZ/7uWsrl1Qukt1zxw5O/8qjsnvuz+Bs=; b=g+HK7bjrrGWrc8iuQwpgspEKKboVIut7FsT2Ch8VJRaPWYjqntmjED6ylJJU3Cj8/Z sGfc+rz8UXD2tv92BVRmqgo32SmDwxTW8sVu2qpxPj2g1u0708MzHKM1bahbDNaLxiR1 8VxPfKgJk6BpkIyhlfmxidFXZDAT9A+8u+U7jI4m5tq1uWwhPKgRuD4A4yEHL7mlUv7/ tRDiDEUrv3jBSZs/IALjObVR6G9LC8yBB18qBE5/7tB40P2QEf6EExA0vz6xWW1WKPBr Mwaa2qtL1szjVFdOvWTzNltViljQ7wlhmogs8Waih1dV/8B2x2uAfHb4sj/JAHM5Gwzn 2SlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=6HOrR4qmfAakZ/7uWsrl1Qukt1zxw5O/8qjsnvuz+Bs=; b=PPF16l6bIM1ezVgJm3UCW4NbPX1Y94c/CAPbPgs3lIxdDPV089hkY2IKUBt0vQRFRo FHwE38AQ4f6XwnfBB0mbIS34nc1N4YMHpFDBoXYcF3a1D8BiOlOuX9BsreoIQNZHNo/z nLACoNK05rSwdB+u12wcdqe39SPjbkkelB6TkiEgCguDVQfz0AdHUIabmDyuZBDFjRi/ /JDC8BKlt3VduamgF0QpFM3Lh5S0LDwYLMaUNXB71+tBqXnpPiJr7i8y2iNSjP1fagff hjCdmMuPRw73Q7QqoQ+de3ug3KJNd6YEzdRoZ/I93quzX9cXYwzg+Hyd7PFF7sJh73eg GELQ== X-Gm-Message-State: AKGB3mKdsuEKmq0oc6smz92kdPR+Gkq953qDVfL/zw0/z2PuL5RdyKjO D4poysrrgqJd0OBK79nUEfFQcw== X-Google-Smtp-Source: ACJfBovwPVcokub9JpMkPWfKZiyCfCQfI+hSdDtOJsR6iSZy+FL/o5Misguf0IT3pXOxv4n2wHkq+g== X-Received: by 10.55.77.65 with SMTP id a62mr28256181qkb.249.1515616518335; Wed, 10 Jan 2018 12:35:18 -0800 (PST) Received: from raichu (toroon0560w-lp140-02-70-49-169-112.dsl.bell.ca. [70.49.169.112]) by smtp.gmail.com with ESMTPSA id w41sm11122582qtc.19.2018.01.10.12.35.17 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 12:35:17 -0800 (PST) Sender: Mark Johnston Date: Wed, 10 Jan 2018 15:35:15 -0500 From: Mark Johnston To: Warner Losh Cc: Warner Losh , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r326964 - head/sys/cam Message-ID: <20180110203515.GD78524@raichu> References: <201712190413.vBJ4DMY9090982@repo.freebsd.org> <20180110202442.GC78524@raichu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.2 (2017-12-15) 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: Wed, 10 Jan 2018 20:35:19 -0000 On Wed, Jan 10, 2018 at 01:32:29PM -0700, Warner Losh wrote: > On Wed, Jan 10, 2018 at 1:24 PM, Mark Johnston wrote: > > > On Tue, Dec 19, 2017 at 04:13:22AM +0000, Warner Losh wrote: > > > Author: imp > > > Date: Tue Dec 19 04:13:22 2017 > > > New Revision: 326964 > > > URL: https://svnweb.freebsd.org/changeset/base/326964 > > > > > > Log: > > > When doing a dump, the scheduler is normally not running, so this > > > changed worked to capture dumps for me. However, the test for > > > SCHEDULER_STOPPED() isn't right. We can also call the dump routine > > > from ddb, in which case the scheduler is still running. This leads to > > > an assertion panic that we're sleeping when we shouldn't. Instead, use > > > the proper test for dumping or not. This brings us in line with other > > > places that do special things while we're doing polled I/O like this. > > > > > > Noticed by: pho@ > > > Differential Revision: https://reviews.freebsd.org/D13531 > > > > > > Modified: > > > head/sys/cam/cam_periph.c > > > > > > Modified: head/sys/cam/cam_periph.c > > > ============================================================ > > ================== > > > --- head/sys/cam/cam_periph.c Tue Dec 19 04:06:07 2017 (r326963) > > > +++ head/sys/cam/cam_periph.c Tue Dec 19 04:13:22 2017 (r326964) > > > @@ -38,6 +38,7 @@ __FBSDID("$FreeBSD$"); > > > #include > > > #include > > > #include > > > +#include > > > #include > > > #include > > > #include > > > @@ -1158,7 +1159,7 @@ cam_periph_runccb(union ccb *ccb, > > > struct bintime *starttime; > > > struct bintime ltime; > > > int error; > > > - bool sched_stopped; > > > + bool must_poll; > > > struct mtx *periph_mtx; > > > struct cam_periph *periph; > > > uint32_t timeout = 1; > > > @@ -1182,7 +1183,13 @@ cam_periph_runccb(union ccb *ccb, > > > devstat_start_transaction(ds, starttime); > > > } > > > > > > - sched_stopped = SCHEDULER_STOPPED(); > > > + /* > > > + * We must poll the I/O while we're dumping. The scheduler is > > normally > > > + * stopped for dumping, except when we call doadump from ddb. > > While the > > > + * scheduler is running in this case, we still need to poll the > > I/O to > > > + * avoid sleeping waiting for the ccb to complete. > > > + */ > > > + must_poll = dumping; > > > > Hmm, unfortunately this introduces a new problem: after a panic we call > > adashutdown() as part of the shutdown_post_sync event. This occurs > > before we call doadump(), so dumping == 0 and we don't poll for the > > spindown command's completion. But since we've panicked, the scheduler > > is stopped, and so we just hang. > > > > So "dumping || SCHEDULER_STOPPED()" then is needed? It seems so, unfortunately.