From owner-freebsd-hackers@freebsd.org Thu Aug 29 03:28:29 2019 Return-Path: Delivered-To: freebsd-hackers@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 29BF8EF09E for ; Thu, 29 Aug 2019 03:28:29 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from new3-smtp.messagingengine.com (new3-smtp.messagingengine.com [66.111.4.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 46Jp3d0LkDz46Sd; Thu, 29 Aug 2019 03:28:28 +0000 (UTC) (envelope-from yuripv@yuripv.net) Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailnew.nyi.internal (Postfix) with ESMTP id 5F4CE3ABE; Wed, 28 Aug 2019 23:28:28 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Wed, 28 Aug 2019 23:28:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yuripv.net; h= subject:to:cc:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=/ 3FPaOvJv1vYX9XTW0LvY9XEt9NQy8JtKK3pBhHqUmU=; b=qZJMJ5Z2O4aNtabDq Ndzlke5gTJ+jtY+Z6eyYOEevoK/l7hiJPB6apbMDVBjtBjU/7f+FIeKSsrRZ62yP lrpJuqbErnmRe0xSXb+HtWFpRwn6Rsw5t5ZOLlYo1lMkCHF0rgeORIvwLJXChkwR Jdk4ukoYPVUbZySbZ9NEuClkwUGqei7i+qlZaMUO28mk+4F9Fl0EAO8iHLceEP/L tSLt4Doj3wGrLsPgjLWP3pVpbD0tPn1dQtT4xsrU0g3N+ffzBbbFNgsCgRP3OVHE H7HcZ0lfeRz6if9tJjaOaTsd59V0Mlr7CehrnLMSpP5FZMlbQzSwTq4ta+Y8/qiy OiawA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=/3FPaOvJv1vYX9XTW0LvY9XEt9NQy8JtKK3pBhHqU mU=; b=BkWPwh/1nQUCA2xez7KVZFcscWEYJBFWWSvp7CMKZ1POpmLoZFrjF4Up1 aw27smetXeN0HMDSVAr3KqPrg48ldlBNlHnfwre2Q1uocfML6lBj4OuoQSzgaGB3 xTnMU9h26vsmCSpy981RSNV8y4jId3HeXed4yEAgs7FWNQECKNfyqt7gt8WojCIO t7bq2hkpJIRtg17B+4Crsuj+C1pwBKfpObJQHe4umNvLHOupeJNY4X8H5ARP+6Aw Z0aL2sF5qb6deK91n8IKph4RizAXxQZ/Wmf8kFj4XGBQysbmMn1qpUlwu9sTW/7j AKJxLJqjQjVd7vxS7DMW7vyN+/9tg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrudeiuddgjedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomhepjghurhhi ucfrrghnkhhovhcuoeihuhhrihhpvheshihurhhiphhvrdhnvghtqeenucffohhmrghinh epfhhrvggvsghsugdrohhrghenucfkphepudelhedrvddtiedrudekfedrudeijeenucfr rghrrghmpehmrghilhhfrhhomhephihurhhiphhvseihuhhrihhpvhdrnhgvthenucevlh hushhtvghrufhiiigvpedt X-ME-Proxy: Received: from [192.168.1.2] (unknown [195.206.183.167]) by mail.messagingengine.com (Postfix) with ESMTPA id 51E8F8005A; Wed, 28 Aug 2019 23:28:27 -0400 (EDT) Subject: Re: ichsmb(4) and msleep() To: cem@freebsd.org Cc: Warner Losh , FreeBSD Hackers References: <7dfebbd3-85d6-c7b7-b83b-fae8b644649e@yuripv.net> <478965aa-5256-e356-5339-de6fb82c3459@selasky.org> <63daa36a-5c22-6b08-3cd7-562fa961ab61@yuripv.net> <7f6de96d-8b56-e242-8950-04a20b197bce@selasky.org> <311a21e3-ed61-8679-b416-b2a4c255c6e7@yuripv.net> <1f91f7a6-050d-d690-d374-6b06950d2ce2@yuripv.net> <4201916c-0f7f-0bf6-2d17-e9f6a1879ba7@yuripv.net> From: Yuri Pankov Message-ID: <950652dd-1020-a27c-bb2b-fb3bbeea50bf@yuripv.net> Date: Thu, 29 Aug 2019 06:28:25 +0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 46Jp3d0LkDz46Sd X-Spamd-Bar: ------ Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-6.96 / 15.00]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; NEURAL_HAM_SHORT(-0.96)[-0.964,0]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; REPLY(-4.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 29 Aug 2019 03:28:29 -0000 Conrad Meyer wrote: > On Wed, Aug 28, 2019 at 6:35 AM Yuri Pankov wrote: >> >> Warner Losh wrote: >>> What's the advantages of doing this instead of deferring attach until the >>> interrupts are running? >> >> None that I can think of, just going with what was suggested and seeing >> other drivers doing the same. Could you please name a driver that >> defers attach until !cold? > > I think pretty much all drivers attach when interrupts are enabled > (not the same as !cold)? At least x86 enables interrupts on BSP at > SI_SUB_INTR, and DRIVER_MODULE drivers *load* at SI_SUB_DRIVERS, and > the INTR one is ordered before the other. My skim read is that > drivers do not actually attach until SI_SUB_CONFIGURE. > > I think the panic / test in sleepq_set_timeout_sbt is maybe overly > strong? !cold indicates the entire autoconfigure process has > concluded. But interrupts are available long before that. Seems like > hardclock is started at ~SI_SUB_CLOCKS? Which is admittedly after > DRIVERS, but still long before !cold. I'm not sure what set of > interrupt/timer functionality is needed for sleepq, but likely that > condition can be relaxed. > > If it cannot be relaxed enough for your driver, you could expand your > DRIVER_MODULE() into the expanded macro, replacing SI_SUB_DRIVERS with > a later stage. Yes, thank you. I guess it's already sorted out with Ian's help, please see the review: https://reviews.freebsd.org/D21452