From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6F29CC4320E for ; Mon, 9 Aug 2021 21:29:41 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id EA55A61040 for ; Mon, 9 Aug 2021 21:29:40 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org EA55A61040 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.cz Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 470086B0071; Mon, 9 Aug 2021 17:29:40 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3F93A6B0072; Mon, 9 Aug 2021 17:29:40 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2C1F58D0001; Mon, 9 Aug 2021 17:29:40 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0235.hostedemail.com [216.40.44.235]) by kanga.kvack.org (Postfix) with ESMTP id 128716B0071 for ; Mon, 9 Aug 2021 17:29:40 -0400 (EDT) Received: from smtpin32.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 9BC371825FC57 for ; Mon, 9 Aug 2021 21:29:39 +0000 (UTC) X-FDA: 78456834078.32.AD7A318 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf03.hostedemail.com (Postfix) with ESMTP id E6ABD30002EB for ; Mon, 9 Aug 2021 21:29:38 +0000 (UTC) Received: from relay2.suse.de (relay2.suse.de [149.44.160.134]) by smtp-out1.suse.de (Postfix) with ESMTP id 7C2FB21F6C; Mon, 9 Aug 2021 21:29:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1628544577; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HMQNCsfM55EcDNGyuVeZ/Y95f0u1E88irWEda0U0VhM=; b=Qyhsi29JZSoTngsj/2wl6iGcB+tfYHcXf9Ibdj+Ogl0+YMIdj/OQQtMaOPJKbd5P2fcrsk x34It64TOdssJNHD7D20il83KqmH2nMT5KrNzMP1XnqA86V3DOyWeqGIR1LE/BRoGCkKJj UGhvprc0zfFwj2dypqr5JDNQFfLgeTY= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1628544577; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=HMQNCsfM55EcDNGyuVeZ/Y95f0u1E88irWEda0U0VhM=; b=j/p5lE3P0VRMmomkyOqEGMqgyc6eC5IkwVwcnBe9Wd0S4rFC5df1no8lez/Y4/5kbgyQR9 BZLBIkZcvF54ELCA== Received: from quack2.suse.cz (unknown [10.100.224.230]) by relay2.suse.de (Postfix) with ESMTP id 692E8A3B81; Mon, 9 Aug 2021 21:29:37 +0000 (UTC) Received: by quack2.suse.cz (Postfix, from userid 1000) id 16E9C1E3BFC; Mon, 9 Aug 2021 23:29:34 +0200 (CEST) Date: Mon, 9 Aug 2021 23:29:34 +0200 From: Jan Kara To: Jens Axboe Cc: Jan Kara , Christoph Hellwig , Tejun Heo , linux-block@vger.kernel.org, Andrew Morton , cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH 4/5] block: move the bdi from the request_queue to the gendisk Message-ID: <20210809212934.GK30319@quack2.suse.cz> References: <20210809141744.1203023-1-hch@lst.de> <20210809141744.1203023-5-hch@lst.de> <20210809154728.GH30319@quack2.suse.cz> <2c007f99-b8f1-3f84-7575-cb6934704388@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <2c007f99-b8f1-3f84-7575-cb6934704388@kernel.dk> User-Agent: Mutt/1.10.1 (2018-07-13) X-Rspamd-Server: rspam03 X-Rspamd-Queue-Id: E6ABD30002EB Authentication-Results: imf03.hostedemail.com; dkim=pass header.d=suse.cz header.s=susede2_rsa header.b=Qyhsi29J; dkim=pass header.d=suse.cz header.s=susede2_ed25519 header.b="j/p5lE3P"; dmarc=none; spf=pass (imf03.hostedemail.com: domain of jack@suse.cz designates 195.135.220.28 as permitted sender) smtp.mailfrom=jack@suse.cz X-Stat-Signature: mst3r5otk98ma7158oxqro9dikwipzd3 X-HE-Tag: 1628544578-306749 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Mon 09-08-21 11:57:42, Jens Axboe wrote: > On 8/9/21 9:47 AM, Jan Kara wrote: > > On Mon 09-08-21 16:17:43, Christoph Hellwig wrote: > >> The backing device information only makes sense for file system I/O, > >> and thus belongs into the gendisk and not the lower level request_queue > >> structure. Move it there. > >> > >> Signed-off-by: Christoph Hellwig > > > > Looks mostly good. I'm just unsure whether some queue_to_disk() calls are > > safe. > > > >> diff --git a/block/blk-mq.c b/block/blk-mq.c > >> index 2c4ac51e54eb..d2725f94491d 100644 > >> --- a/block/blk-mq.c > >> +++ b/block/blk-mq.c > >> @@ -525,7 +525,7 @@ void blk_mq_free_request(struct request *rq) > >> __blk_mq_dec_active_requests(hctx); > >> > >> if (unlikely(laptop_mode && !blk_rq_is_passthrough(rq))) > >> - laptop_io_completion(q->backing_dev_info); > >> + laptop_io_completion(queue_to_disk(q)->bdi); > >> > > > > E.g. cannot this get called for a queue that is without a disk? > > Should be fine, as it's checking for passthrough. Maybe famous last > words, but we should not be seeing regular IO before disk is setup. > > >> @@ -359,8 +359,8 @@ static void wb_timer_fn(struct blk_stat_callback *cb) > >> > >> status = latency_exceeded(rwb, cb->stat); > >> > >> - trace_wbt_timer(rwb->rqos.q->backing_dev_info, status, rqd->scale_step, > >> - inflight); > >> + trace_wbt_timer(queue_to_disk(rwb->rqos.q)->bdi, status, > >> + rqd->scale_step, inflight); > >> > >> /* > >> * If we exceeded the latency target, step down. If we did not, > > > > Or all these calls - is wbt guaranteed to only be setup for a queue with > > disk? > > Same for this one. OK, fair enough then. Feel free to add: Reviewed-by: Jan Kara Honza -- Jan Kara SUSE Labs, CR