Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp8690592rwl; Tue, 10 Jan 2023 17:49:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXtMhNvartTSDJBDTilOMX6oCIbB0gAHroMigedZG7xMboRtKzvOcY9UmpVKN06z0JjKbStn X-Received: by 2002:a05:6a20:1586:b0:9d:efd3:66c1 with SMTP id h6-20020a056a20158600b0009defd366c1mr99586036pzj.8.1673401758274; Tue, 10 Jan 2023 17:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673401758; cv=none; d=google.com; s=arc-20160816; b=HaLgDOK1BVNJboTa8vVasWRb4IPvPl6oCUjeeKYIjo4LbDhypUe/vCDyy8CQ/KvG9S pKJMn0UvfnUPqo85X4A1TzjJYJ4IR3EpCO62zfb9bgULe/yWbxz3rBnixHIud69x1ZbY wP4XRwVaqGimKPPLDwX4695JlWkLACIthzNfyuwUjn62WjLYj683BrWmKkECD6mj60UL fv10la97tgVyvl8IFWBxhynKnNobAfsxJmLe9FghDT9lLRk38KINDQKQU+51IPr8GQ2y YmSP81PVGA11Ha1jepff0xiJddalNDoN9Facyhk8JPHZLeOrYwH06jlaEfiwmiOC5YV9 UycA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:references:cc:to :subject; bh=m0DoBjLqqIChd/NFOBdg+0qLuE5Due7k0kWhrgCncG8=; b=DT2/T8yKZvDizRpMfElElF2d8DpOTgbR+96w/R94ZyCaGedYmx0PYKXzRJC7LO6aKY C5iD+w4pYwyP1gVfMcvMMf31cJen4NnHBBxP8HX9/HJ4FO32A9M4xNtSTU3yWko0KuDT IGbNnrUjP8hNrF+sXuXc9Dd9cXoVQwpWFri2PLJzfTTjEn2g6czfQkwx7Aa5Avm14GcJ UOBUKwdsDZqUBmajsW5LwgEu/zdp2xVfhbpCqqGvX9MtD1ec0lskYKVl6EqmZ8DxX7x2 O8R7fpVVvDS0aWYnBsA/RN4g6m1FytAZ4/seHYE1j7ZaYi8Sw4K6U7KXeWr01VKWi1/m 4LPg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id g11-20020a65580b000000b0047701022c7dsi13054198pgr.729.2023.01.10.17.49.11; Tue, 10 Jan 2023 17:49:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233245AbjAKBgj (ORCPT + 53 others); Tue, 10 Jan 2023 20:36:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55266 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231332AbjAKBgg (ORCPT ); Tue, 10 Jan 2023 20:36:36 -0500 Received: from dggsgout12.his.huawei.com (unknown [45.249.212.56]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08D82BF5C; Tue, 10 Jan 2023 17:36:33 -0800 (PST) Received: from mail02.huawei.com (unknown [172.30.67.153]) by dggsgout12.his.huawei.com (SkyGuard) with ESMTP id 4Ns9J83YFVz4f3wQQ; Wed, 11 Jan 2023 09:36:24 +0800 (CST) Received: from [10.174.176.73] (unknown [10.174.176.73]) by APP1 (Coremail) with SMTP id cCh0CgDX9zGZEr5j9HiXBQ--.59805S3; Wed, 11 Jan 2023 09:36:27 +0800 (CST) Subject: Re: [PATCH v2 1/2] blk-iocost: add refcounting for iocg To: Tejun Heo , Yu Kuai Cc: hch@infradead.org, josef@toxicpanda.com, axboe@kernel.dk, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com, "yukuai (C)" References: <20221227125502.541931-1-yukuai1@huaweicloud.com> <20221227125502.541931-2-yukuai1@huaweicloud.com> <7dcdaef3-65c1-8175-fea7-53076f39697f@huaweicloud.com> <875eb43e-202d-5b81-0bff-ef0434358d99@huaweicloud.com> From: Yu Kuai Message-ID: <53b30ac8-d608-ba0b-8b1b-7fe5cfed6d61@huaweicloud.com> Date: Wed, 11 Jan 2023 09:36:25 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=gbk; format=flowed Content-Transfer-Encoding: 8bit X-CM-TRANSID: cCh0CgDX9zGZEr5j9HiXBQ--.59805S3 X-Coremail-Antispam: 1UD129KBjvdXoWrtrWxuF1fCw15Cr1kGw48Zwb_yoWfCrb_uF yFva98uwn8Jr1kC3W3Kr4YvrWkKFWjgryxGFs2ga4IyF98Xa93urWIq34xua45J34rtrnx Zrs8J3Wjqwn2kjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUIcSsGvfJTRUUUb3kFF20E14v26r4j6ryUM7CY07I20VC2zVCF04k26cxKx2IYs7xG 6rWj6s0DM7CIcVAFz4kK6r1j6r18M28lY4IEw2IIxxk0rwA2F7IY1VAKz4vEj48ve4kI8w A2z4x0Y4vE2Ix0cI8IcVAFwI0_tr0E3s1l84ACjcxK6xIIjxv20xvEc7CjxVAFwI0_Gr1j 6F4UJwA2z4x0Y4vEx4A2jsIE14v26rxl6s0DM28EF7xvwVC2z280aVCY1x0267AKxVW0oV Cq3wAS0I0E0xvYzxvE52x082IY62kv0487Mc02F40EFcxC0VAKzVAqx4xG6I80ewAv7VC0 I7IYx2IY67AKxVWUJVWUGwAv7VC2z280aVAFwI0_Jr0_Gr1lOx8S6xCaFVCjc4AY6r1j6r 4UM4x0Y48IcVAKI48JM4x0x7Aq67IIx4CEVc8vx2IErcIFxwACI402YVCY1x02628vn2kI c2xKxwCYjI0SjxkI62AI1cAE67vIY487MxAIw28IcxkI7VAKI48JMxC20s026xCaFVCjc4 AY6r1j6r4UMI8I3I0E5I8CrVAFwI0_Jr0_Jr4lx2IqxVCjr7xvwVAFwI0_JrI_JrWlx4CE 17CEb7AF67AKxVWUtVW8ZwCIc40Y0x0EwIxGrwCI42IY6xIIjxv20xvE14v26r1j6r1xMI IF0xvE2Ix0cI8IcVCY1x0267AKxVWUJVW8JwCI42IY6xAIw20EY4v20xvaj40_WFyUJVCq 3wCI42IY6I8E87Iv67AKxVWUJVW8JwCI42IY6I8E87Iv6xkF7I0E14v26r1j6r4UYxBIda VFxhVjvjDU0xZFpf9x0JUdHUDUUUUU= X-CM-SenderInfo: 51xn3trlr6x35dzhxuhorxvhhfrp/ X-CFilter-Loop: Reflected X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, ?? 2023/01/11 2:36, Tejun Heo ะด??: > Hello, > > On Tue, Jan 10, 2023 at 09:39:44AM +0800, Yu Kuai wrote: >> As I tried to explain before, we can make sure blkg_free() is called >> in order, but blkg_free() from remove cgroup can concurrent with >> deactivate policy, and we can't guarantee the order of ioc_pd_free() >> that is called both from blkg_free() and blkcg_deactivate_policy(). >> Hence I don't think #3 is possible. > > Hahaha, sorry that I keep forgetting that. This doesn't really feel like > that important or difficult part of the problem tho. Can't it be solved by > synchronizing blkg free work item against the deactivate path with a mutex? > I'm not sure, of course this can fix the problem, but two spinlock 'blkcg->lock' and 'q->queue_lock' are used to protect blkg_destroy() currently, add a mutex??disk level?) requires a refactor, which seems complex to me. Thanks, Kuai