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 4AF8BCCA47F for ; Thu, 23 Jun 2022 16:26:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230329AbiFWQ0Y (ORCPT ); Thu, 23 Jun 2022 12:26:24 -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) Precedence: bulk List-ID: X-Mailing-List: linux-block@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