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=-15.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_SANE_1 autolearn=ham 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 1DEB2C4320A for ; Mon, 9 Aug 2021 17:57:47 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 970686113C for ; Mon, 9 Aug 2021 17:57:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 970686113C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 0A1128D0001; Mon, 9 Aug 2021 13:57:46 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 050596B0071; Mon, 9 Aug 2021 13:57:46 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id E815E8D0001; Mon, 9 Aug 2021 13:57:45 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0197.hostedemail.com [216.40.44.197]) by kanga.kvack.org (Postfix) with ESMTP id CC4A66B006C for ; Mon, 9 Aug 2021 13:57:45 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 7768E1B3FF for ; Mon, 9 Aug 2021 17:57:45 +0000 (UTC) X-FDA: 78456300090.12.1F6B55D Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) by imf07.hostedemail.com (Postfix) with ESMTP id C8AA310004EC for ; Mon, 9 Aug 2021 17:57:44 +0000 (UTC) Received: by mail-ot1-f53.google.com with SMTP id d10-20020a9d4f0a0000b02904f51c5004e3so14551284otl.9 for ; Mon, 09 Aug 2021 10:57:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=CQFaNzQzJrk6MErWJ+eofTzgW919Cz/LICK5EdRu2O4=; b=OCsdWUkSNnhvzgS8bElHmmkjdbZS0zrbwwpAMlwY9cuFhsHQ8eDrMpfxpLsGR3WgKe tEU0/IEcBigi6V5cP+32KnLPrhFSzKQ9Zq62XuNJUf3GbAzBnYMfPnYxQT2bqMYv37gH jdppPqPVoZhuLhW8EN4nS7nE6aghrJvxPRTaTaepALonKUIde0paOsDMbo/8Y57uZw/Z zu/Z0xoSyMKC0lvkuPA/esnGbaon/tFO/jxgLqhLAm5b/E3cuE+nmXUirHzWH7Od59y8 tDOpM5ut/q+/WvWAWxyP8KPIOl77vqpfjlJhxNe1icfxml6qI1k9LjIuCqnih/ERPyue a6jQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=CQFaNzQzJrk6MErWJ+eofTzgW919Cz/LICK5EdRu2O4=; b=Ct4Gv/SqaTREGcidpeOT0GLW4jY184Bz680qd9Y/HXZmauJw/9e3lsz7Xsg12+6w5P G1kQsH57PtB4OQO0ejUF1KjSQDqf6Dy2Zf6qKPocPEh5NyB/URhGGvvKdRlaK2EuFvJA 5Az1iFvfS+AFotAYvECsYzA0uB25t7hmMk/dHVhjVY42zccD/pDf9tRXY7kQVpVuG26b B/JC3VHriwYN4mnZqmno00kxOi/SQwoD5MZZj6CJ1iZT4R+JIFHk1ldT+eo5BzMz1v7X yRHEv8o/QxUiQuIyGuEqmuh9e/NcWTIohLEKO7gLrwAs4ffyrsUc66wec1JUlWEuu4SY aSPg== X-Gm-Message-State: AOAM533l7kx1W6knLyLs+WolRWpok8oO/janlKbEf4eXV8WLPU8IadQb JQp4xceFfk+LHW3JCdkv8OLIGx/qKMnERdoK X-Google-Smtp-Source: ABdhPJzFgHS0/Ao51EjGoMRZW6DDDktpHc29Tn8/9efV7V4JDaWK1V1d/jyRlPbzikJeCMarsdZZ7g== X-Received: by 2002:a05:6830:1bf3:: with SMTP id k19mr14626324otb.335.1628531863729; Mon, 09 Aug 2021 10:57:43 -0700 (PDT) Received: from [192.168.1.30] ([207.135.234.126]) by smtp.gmail.com with ESMTPSA id e19sm3380805oii.39.2021.08.09.10.57.42 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 09 Aug 2021 10:57:43 -0700 (PDT) Subject: Re: [PATCH 4/5] block: move the bdi from the request_queue to the gendisk To: Jan Kara , Christoph Hellwig Cc: Tejun Heo , linux-block@vger.kernel.org, Andrew Morton , cgroups@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org References: <20210809141744.1203023-1-hch@lst.de> <20210809141744.1203023-5-hch@lst.de> <20210809154728.GH30319@quack2.suse.cz> From: Jens Axboe Message-ID: <2c007f99-b8f1-3f84-7575-cb6934704388@kernel.dk> Date: Mon, 9 Aug 2021 11:57:42 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 In-Reply-To: <20210809154728.GH30319@quack2.suse.cz> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=kernel-dk.20150623.gappssmtp.com header.s=20150623 header.b=OCsdWUkS; dmarc=none; spf=pass (imf07.hostedemail.com: domain of axboe@kernel.dk designates 209.85.210.53 as permitted sender) smtp.mailfrom=axboe@kernel.dk X-Stat-Signature: fpw9et7murs3g1oqdgxghpnpcs71tspx X-Rspamd-Queue-Id: C8AA310004EC X-Rspamd-Server: rspam01 X-HE-Tag: 1628531864-62311 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 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. -- Jens Axboe