Received: by 2002:ac2:464d:0:0:0:0:0 with SMTP id s13csp3265336lfo; Mon, 23 May 2022 00:17:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9+vRjyZOLQEL81s18we5tQxKc5swCS6MnaF501UC8oUkb0BwkSHtjaI3jB4adOkDGKa3S X-Received: by 2002:a17:90b:3e8d:b0:1e0:3d95:a0e1 with SMTP id rj13-20020a17090b3e8d00b001e03d95a0e1mr6562891pjb.61.1653290274181; Mon, 23 May 2022 00:17:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1653290274; cv=none; d=google.com; s=arc-20160816; b=ek6QkM8R37afVxsYbQNr+2DkuQLaI6YdNBZF5QuZ1OrcHoT5XefSigS9AFUASDVC1I trKmLxD8n2W+j8WdhQG5Fbc4ajq/R3Te/FCE6KyS6mYJnSu73jAVaffMFzEhcDm6WV28 A1CpQoUobMo7dAJke7gLVCWIMghzek06pg7tielIAlzy9hjahKFM2m0O1rJDopMi5LLZ NTBT+/kfBQEWGDk2lHOycwTDNoHLVzvkJctBPlqbHLfMMMGRdbrdvDfMhgEaNjAnNl21 yhK1yR/iqTqldVSZP1NC4cZfSRH84kHE2jU6OJxgyBTxIxFW9X2RGyhCCMDs9lBiHeBw vz9Q== 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=5VKe9GUN9s0AOPFTdhgH/gwghuVGF4FUk0H1YjRhrFU=; b=GeKHZ2j6MeotDAyP2MuS5Nw6wjUDhCz5EnxHxuNIZ6LQ4zqBci/DpADvxR+1gZpRZB a4um7bH18AIGo8pIzrT0NO69ifvoXBGKpKKiIxEnp2+Y/5HGwG9x8pFk/iwZJM5EZkyP 0qaW7Y3eA494z6dzHo7ou2fCSNgWv1Pl7R0bbsRi5zfeEM3ZBlR7BWSx2comF+l0wW4g XTKw83dKOKFhNSw9+RuUM/nOVbvFIxMU1qgdUc74LtaEVUXqJV5DX6Cnn0MwFczf4YCH iMsoPEqG+m1pjeihIL+s1V34hWtKDyaLnCa4qL+nqODxSakxhOMBXb625j8CVZlSdzpt RtEw== 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:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id 129-20020a621587000000b0050d6182e323si12057355pfv.146.2022.05.23.00.17.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 May 2022 00:17:54 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 4E7FE3B575; Sun, 22 May 2022 23:35:23 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229773AbiEUDv2 (ORCPT + 99 others); Fri, 20 May 2022 23:51:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54980 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1354490AbiEUDvT (ORCPT ); Fri, 20 May 2022 23:51:19 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8B5A0DF41; Fri, 20 May 2022 20:51:15 -0700 (PDT) Received: from kwepemi500009.china.huawei.com (unknown [172.30.72.54]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L4qNX0XZszgY8y; Sat, 21 May 2022 11:49:48 +0800 (CST) Received: from kwepemm600009.china.huawei.com (7.193.23.164) by kwepemi500009.china.huawei.com (7.221.188.199) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 21 May 2022 11:51:13 +0800 Received: from [10.174.176.73] (10.174.176.73) by kwepemm600009.china.huawei.com (7.193.23.164) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Sat, 21 May 2022 11:51:12 +0800 Subject: Re: [PATCH -next v3 2/2] blk-throttle: fix io hung due to configuration updates To: Tejun Heo , =?UTF-8?Q?Michal_Koutn=c3=bd?= CC: , , , , , , References: <20220519085811.879097-1-yukuai3@huawei.com> <20220519085811.879097-3-yukuai3@huawei.com> <20220519095857.GE16096@blackbody.suse.cz> <20220519161026.GG16096@blackbody.suse.cz> <73464ca6-9412-cc55-d9c0-f2e8a10f0607@huawei.com> <20220520160305.GA17335@blackbody.suse.cz> From: "yukuai (C)" Message-ID: <97be6af0-ea94-f4ee-5ab2-02b6fc02cbff@huawei.com> Date: Sat, 21 May 2022 11:51:11 +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="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.174.176.73] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemm600009.china.huawei.com (7.193.23.164) X-CFilter-Loop: Reflected X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A, RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 在 2022/05/21 0:20, Tejun Heo 写道: > Hello, > > On Fri, May 20, 2022 at 06:03:05PM +0200, Michal Koutný wrote: >>> Then io hung can be triggered by always submmiting new configuration >>> before the throttled bio is dispatched. >> >> How big is this a problem actually? Is it only shooting oneself in the leg >> or can there be a user who's privileged enough to modify throttling >> configuration yet not privileged enough to justify the hung's >> consequences (like some global FS locks). > > So, the problem in itself is of the self-inflicted type and I'd prefer to > ignore it. Unfortunately, the kernel doesn't have the kind of isolation > where stalling out some aribtrary tasks is generally safe, especially not > blk-throtl as it doesn't handle bio_issue_as_root() and thus can have a > pretty severe priority inversions where IOs which can block system-wide > operations (e.g. memory reclaim) get trapped in a random cgroup. Hi, Tejun It's right the problem is self-inflicted. However, I do think with Michal's suggestion, how throttled bios are handled while new config is submitted really make sense from the functional poinit of view. Do you think the solution is OK? Thnaks, Kuai > > Even ignoring that, the kernel in general assumes some forward progress from > everybody and when a part stalls it's relatively easy to spread to the rest > of the system, sometimes gradually, sometimes suddenly - e.g. if the stalled > IO was being performed while holding the mmap_sem, which isn't rare, then > anything which tries to read its proc cmdline will hang behind it. > > So, we wanna avoid a situation where a non-priviledged user can cause > indefinite UNINTERRUPTIBLE sleeps to prevent local DoS attacks. I mean, > preventing local attacks is almost never fool proof but we don't want to > make it too easy at least. > > Thanks. >