From nobody Thu May 05 22:12:37 2022 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id A73C31AC9E31 for ; Thu, 5 May 2022 22:12:45 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from www121.sakura.ne.jp (www121.sakura.ne.jp [153.125.133.21]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4KvScW4sZ9z3lrM; Thu, 5 May 2022 22:12:43 +0000 (UTC) (envelope-from junchoon@dec.sakura.ne.jp) Received: from kalamity.joker.local (123-1-111-80.area1b.commufa.jp [123.1.111.80]) (authenticated bits=0) by www121.sakura.ne.jp (8.16.1/8.16.1/[SAKURA-WEB]/20201212) with ESMTPA id 245MCbip009479; Fri, 6 May 2022 07:12:38 +0900 (JST) (envelope-from junchoon@dec.sakura.ne.jp) Date: Fri, 6 May 2022 07:12:37 +0900 From: Tomoaki AOKI To: Warner Losh Cc: FreeBSD Current , Warner Losh Subject: Re: Massive "Found bio_cmd = 0x5" with options CAM_IOSCHED_DYNAMIC Message-Id: <20220506071237.31a11f26398bcd5a698cac85@dec.sakura.ne.jp> In-Reply-To: References: <20220505090316.1df9a1bc2e07e69b1da8cb64@dec.sakura.ne.jp> Organization: Junchoon corps X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; amd64-portbld-freebsd13.0) List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 4KvScW4sZ9z3lrM X-Spamd-Bar: - Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=none (mx1.freebsd.org: domain of junchoon@dec.sakura.ne.jp has no SPF policy when checking 153.125.133.21) smtp.mailfrom=junchoon@dec.sakura.ne.jp X-Spamd-Result: default: False [-1.48 / 15.00]; RCVD_TLS_LAST(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; ARC_NA(0.00)[]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; MV_CASE(0.50)[]; NEURAL_HAM_LONG(-1.00)[-0.996]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[sakura.ne.jp]; AUTH_NA(1.00)[]; HAS_ORG_HEADER(0.00)[]; TO_MATCH_ENVRCPT_SOME(0.00)[]; TO_DN_ALL(0.00)[]; NEURAL_HAM_SHORT(-0.99)[-0.994]; NEURAL_HAM_MEDIUM(-0.89)[-0.891]; MLMMJ_DEST(0.00)[freebsd-current]; R_SPF_NA(0.00)[no SPF record]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:7684, ipnet:153.125.128.0/18, country:JP]; RCVD_COUNT_TWO(0.00)[2]; MID_RHS_MATCH_FROM(0.00)[]; RECEIVED_SPAMHAUS_PBL(0.00)[123.1.111.80:received] X-ThisMailContainsUnwantedMimeParts: N On Wed, 4 May 2022 20:37:41 -0600 Warner Losh wrote: > On Wed, May 4, 2022 at 6:03 PM Tomoaki AOKI > wrote: > > > Hi. > > > > After updating src main git: f44280bf5fbb to git: 1599fc904d35, > > with options CAM_IOSCHED_DYNAMIC on kernel config file, > > A plenty of "Found bio_cmd = 0x5" appear on console and dmesg. > > > > With quick look under src/sys/, bio_cmd = 0x5 means BIO_FLUSH, > > and the printf() only appears on src/sys/cam/cam_iosched.c line 1621.[1] > > > > Maybe it actually wouldn't be harmful (just annoying), but possibly > > any conditions blocking BIO_FLUSH to reach there would be lost. > > (The printf() itself was already there at git: f44280bf5fbb.) > > > > If it's actualy not at all harmful, and BIO_FLUSH case is coming > > through here is intentional change, is it really needed to be printed? > > > > It's a useless printf. I've removed it and posted an analysis in the commit > message. Basically, read_bias == 0 will queue other operations to bio_queue > now, so the printf is a false positive to find transactions that shouldn't > be > on the queue. > > If you set read_bias = 1, then the messages will go away until you can > recompile. > > I also don't need to know the storage, since this is independent of the > periphs... > > Warner Thanks! Confirmed that... *Setting kern.cam.iosched.read_bias to any value from 1 to 100 via sysctl command didn't stop the flood. Even though it's defined via SYSCTL_INT() [not TUNABLE_INT()], it seems to act as pure tunable. *Setting kern.cam.iosched.read_bias=1 on /boot/loader.conf stopped the flood BEFORE rebuild. *Updating after git: a85fea31c5cb (actually, git: 9f580526e45a for me) stopped the flood even if kern.cam.iosched.read_bias=0 on boot. (Obvious from git: a85fea31c5cb.) > > > > There were 4 commits to cam_iosched.c within the span. > > > > cc1572ddeb8cd82879ce0cca634bf6a8830c0f40 [2] > > cam iosched: Remove write bias when read bias = 0 > > b65803ba5773d5fb37fa2403105db199569a5811 [3] > > cam iosched: default to no read bias in dynamic ioscheduling > > d592c0db8ba773c143eeea28610288f800fa651a [4] > > cam: add hw.cam.iosched.read_bias > > 1599fc904d35cfa8eecad92818d1f4b55de6818f [5] > > iosched: Move bio_next() inside of the CAM_IOSCHED_DYNAMIC ifdef > > > > > > [1] https://cgit.freebsd.org/src/tree/sys/cam/cam_iosched.c#n1621 > > > > [2] > > > > https://cgit.freebsd.org/src/commit/?id=cc1572ddeb8cd82879ce0cca634bf6a8830c0f40 > > > > [3] > > > > https://cgit.freebsd.org/src/commit/?id=b65803ba5773d5fb37fa2403105db199569a5811 > > > > [4] > > > > https://cgit.freebsd.org/src/commit/?id=d592c0db8ba773c143eeea28610288f800fa651a > > > > [5] > > > > https://cgit.freebsd.org/src/commit/?id=1599fc904d35cfa8eecad92818d1f4b55de6818f > > > > > > Regards. > > > > -- > > Tomoaki AOKI > > -- Tomoaki AOKI