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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id A5D65C4167B for ; Mon, 12 Dec 2022 08:53:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231629AbiLLIx6 (ORCPT ); Mon, 12 Dec 2022 03:53:58 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231466AbiLLIxk (ORCPT ); Mon, 12 Dec 2022 03:53:40 -0500 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B918DC29; Mon, 12 Dec 2022 00:53:27 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=UihVLPIukW76e6Gh9tWRjReOJ5OZce6kDic8r4IuSmU=; b=qQfZ2XqQABCzgYROcbAC+dV6vV AzZ9femTZMLYhSeXz6ZMH3q3bLXKukUXNn60OdfWE5u5teHQXFA5JGlrFYflhYtplVeRn5uxxl7bO mS3bAHKx9NiXUyqNkMI8izrJgxpK4imqcuaw3MbPRBdkUYQFVzUtxNndISwnQanEDHy/Cak7W/pQ4 VJWAo6B1+AH/stAEuUwC+Lx5mMvyDFWUfVFKgAUkn8t3SLCVGVLuRVSyzmnxdRWxjAgUOpB56mAOC 3w0n7+9i6g6PCzuaoMZrgeAJFsEU822SKnduSJP+JWTrQbOgkCBEAQrM8fWZ4up4G2v55wXR8j8ld 3iA0wyXQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1p4eYw-00AcCC-Cv; Mon, 12 Dec 2022 08:53:26 +0000 Date: Mon, 12 Dec 2022 00:53:26 -0800 From: Christoph Hellwig To: Tejun Heo Cc: Jens Axboe , linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, darklight2357@icloud.com, Josef Bacik , Linus Torvalds , cgroups@vger.kernel.org Subject: Re: [PATCH 2/2 block/for-6.2] blk-iolatency: Make initialization lazy Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org > +static int blk_iolatency_try_init(char *input) > +{ > + static DEFINE_MUTEX(init_mutex); > + struct block_device *bdev; > + int ret = 0; > + > + bdev = blkcg_conf_open_bdev(&input); > + if (IS_ERR(bdev)) > + return PTR_ERR(bdev); > +retry: > ret = blkg_conf_prep(blkcg, &blkcg_policy_iolatency, buf, &ctx); > + if (ret == -EOPNOTSUPP) { > + ret = blk_iolatency_try_init(buf); It's a little sad to do two block device lookups here (even if it obviously doesn't matter for performance). I wonder if it would make sense to explicitly support the lazy init pattern in blkg_conf_prep somehow. Otherwise I'm all for the lazy init.