Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp6024974iog; Thu, 23 Jun 2022 09:47:57 -0700 (PDT) X-Google-Smtp-Source: AGRyM1seDNMaOrieHsHu8qLHBIjIjbmEK3ptPYckmCPx//4faWG6nve9ILX4lETwaMbhvfZZq61q X-Received: by 2002:a63:4746:0:b0:3fd:fd53:5fee with SMTP id w6-20020a634746000000b003fdfd535feemr8211215pgk.338.1656002877603; Thu, 23 Jun 2022 09:47:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1656002877; cv=none; d=google.com; s=arc-20160816; b=GYQi8ziJQswLautqNOtx7m5ah33heaUhO8g7CYL1w57aU5r0qFpZ/t3C57euK9po2C zxkZDh7CikMZEHGc8wHpow3dlK0NFkbwqci/ENDKgHjc5xqdpk/DReOg8pd9ldFBSLUQ CUc5AVZhF7nsDsP9ErjgGJfPzqwlGDmYRwD1kdRvSJnF04gFLQg383qFQK5pf2xzsL8j sSxSBrmsjyi8xVUKlvXIg6H5vvRgmWQ1qgruUOkKDkmMijDLpB8XA1h3N0+RTA8DfwJw 3+qU0myGGV3izNcklJp2Mr+iAxtcnpjvt+lCVrGpcV/1twGndIG3twJpobIAdlLlx6rE w6Ig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=BfdpS31BTnx0upscG9ltmSRSibzpIJMh1VIKXZtFzy8=; b=QkG8khFE3m97yZPd8BeyWEo2B9lM3mODQnAyO8tzkFCOrHH4KjvfVYsXZHPhg0/5sF Rk5d9ujyDhmLV0H1Bzp2e2QKLodAw4YC2wmTo3SZpjGOHGLJaMeO4unJCNaxoOIriJ74 iyRiVM7Zk9i9BR6MMrza+AiVgibuoVpKXggWNDNGdO2RPcSUZejUBUafBSvl8+fOL+cr kOKA++oT3tEvUJdBcvHtNlCeO5kjxXVVSDd2G8eKZ1KvFv7i+CDSg1fKgmMrRezKE5FQ /Zfsq5QpQV0tW8DHyJqcu6xYxDGzn+HunyECjRmW3bWHijhRS3Jd2hd/qZ+YUoo8fxMt cUPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.com header.s=susede1 header.b="LufHh/Pd"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o10-20020a170902d4ca00b0016a11ae0396si15355plg.347.2022.06.23.09.47.45; Thu, 23 Jun 2022 09:47:57 -0700 (PDT) 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; dkim=pass header.i=@suse.com header.s=susede1 header.b="LufHh/Pd"; 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; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=suse.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232224AbiFWQ0Z (ORCPT + 99 others); Thu, 23 Jun 2022 12:26:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57648 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231948AbiFWQ0Y (ORCPT ); Thu, 23 Jun 2022 12:26:24 -0400 Received: from smtp-out2.suse.de (smtp-out2.suse.de [195.135.220.29]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 855CE44A19; Thu, 23 Jun 2022 09:26:23 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out2.suse.de (Postfix) with ESMTPS id 444791F37C; Thu, 23 Jun 2022 16:26:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1656001582; 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=BfdpS31BTnx0upscG9ltmSRSibzpIJMh1VIKXZtFzy8=; b=LufHh/PdbNvvhLTzX1RWsvnJuM3y52l0dG9D43ioTReJGZFKFYUG8gZr79KxgrXTi8h0Ja kjyYipDKbiTR3dQZjA2un27ED1YROrmJUCX2pHkcRRpIFenPpA2klysDHKFknPxpHr7ke0 Q99rJXpqTNuxDeCSsIfc/Wvik9/VqqM= Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 13DEE133A6; Thu, 23 Jun 2022 16:26:22 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id 1w3gAy6UtGLtAwAAMHmgww (envelope-from ); Thu, 23 Jun 2022 16:26:22 +0000 Date: Thu, 23 Jun 2022 18:26:20 +0200 From: Michal =?iso-8859-1?Q?Koutn=FD?= To: Yu Kuai Cc: tj@kernel.org, axboe@kernel.dk, ming.lei@redhat.com, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, yi.zhang@huawei.com Subject: Re: [PATCH -next v5 4/8] blk-throttle: fix io hung due to config updates Message-ID: <20220623162620.GB16004@blackbody.suse.cz> References: <20220528064330.3471000-1-yukuai3@huawei.com> <20220528064330.3471000-5-yukuai3@huawei.com> <20220622172621.GA28246@blackbody.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE 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 On Thu, Jun 23, 2022 at 08:27:11PM +0800, Yu Kuai wrote: > > Here we may allow to dispatch a bio above current slice's > > calculate_bytes_allowed() if bytes_skipped is already >0. > > Hi, I don't expect that to happen. For example, if a bio is still > throttled, then old slice is keeped with proper 'bytes_skipped', > then new wait time is caculated based on (bio_size - bytes_skipped). > > After the bio is dispatched(I assum that other bios can't preempt), With this assumptions it adds up as you write. I believe we're in agreement. It's the same assumption I made below (FIFO everywhere, i.e. no reordering). So the discussed difference shouldn't really be negative (and if the assumption didn't hold, so the modular arithmetic yields corerct bytes_skipped value). Michal