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 EB6B0E7C4F0 for ; Wed, 4 Oct 2023 19:31:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S244240AbjJDTb6 (ORCPT ); Wed, 4 Oct 2023 15:31:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58852 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S244749AbjJDTbo (ORCPT ); Wed, 4 Oct 2023 15:31:44 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 599CF90; Wed, 4 Oct 2023 12:31:41 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1c60a514f3aso972225ad.3; Wed, 04 Oct 2023 12:31:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1696447901; x=1697052701; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:from:to:cc:subject:date:message-id :reply-to; bh=W5HfVM4fCCGY68ob5MM+ty4dyWUo6GBaDagauhTzLa4=; b=Oa4MzZ0JEIgnoPl4BhpcvNMRm+cW1j9ZmGBxLQ04OuZTUIumiSBxsMI+kZ732pMQxo ROAWWtOF9hCO4+tXRrpEuQdwWbcbnAfitkThEjtqtpzF3lDxFqGIa53Lh/Oef7Gm9A7o 6ayfbiL99VoEOReq4xUvUG1/2703xw9ZawpExyMeWVX0r0o+Vdp/kEhRS+UPmqAbv69L BJC33+qhGI8XP7/wFEYatGuzWHFiPyOroAiHLe/OJrXoVZFmaiJPCiWAFdwmV/5Sgd56 T8qmOwNY1Z31JoLpYhbhYPqIxihmiNFH7wfo3Uzbb7qVorkaIeTuVvDI6zTFluqY7WSD H1QA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1696447901; x=1697052701; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:sender:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=W5HfVM4fCCGY68ob5MM+ty4dyWUo6GBaDagauhTzLa4=; b=A8qR6aTvNELXhIE4NdlAwbyFhz9ma4FUNYa2S5OLzu6VqyzSphUaYd8cNVw0Tw+8Ba 8lf7fpdBLR+Bt9Pn/Jqrlzsu258YBoPX8dHj7280FZpPQ1rnMzm9506XujNFtSsGEnye +JGrdKa9RcQy5b8DBFMaTjkiQmxpcWoNn1E5AtGxCCJPx9Vkignv6ESZfxu777SYqyuh qd17qP1IkCd+ASkZ4F3HcyEfPEKj+FY2lbt8tj3tZ6PNsvMy14bbwbAI6uRfIY+9R9oC Ammqpz4LVnYq9A4JTXlowpK+Wc2YnUDQprVJ8RXUBO6spYAle3nWMLTcig3JIExXEMxQ fwxg== X-Gm-Message-State: AOJu0YxJUQzZLvsyTgNgjCleZ4DwmT0YGQ2gf+SFvZTTETfnm6nFVNGi 31vw9crrhFXqr9X7j2HYkpk= X-Google-Smtp-Source: AGHT+IGZVPAbnXzw1VU0d3EYLakJJsXUlO6LA/FUAriMf/+lkcNF8C6IYLBjMpnG89KJvtciD7X+lQ== X-Received: by 2002:a17:902:6946:b0:1bf:27a2:b52b with SMTP id k6-20020a170902694600b001bf27a2b52bmr3238653plt.58.1696447900827; Wed, 04 Oct 2023 12:31:40 -0700 (PDT) Received: from localhost ([2620:10d:c090:400::4:cef]) by smtp.gmail.com with ESMTPSA id a7-20020a170902ecc700b001bc6e6069a6sm4079064plh.122.2023.10.04.12.31.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Oct 2023 12:31:40 -0700 (PDT) Sender: Tejun Heo Date: Wed, 4 Oct 2023 09:31:38 -1000 From: Tejun Heo To: linan666@huaweicloud.com Cc: josef@toxicpanda.com, axboe@kernel.dk, yukuai3@huawei.com, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linan122@huawei.com, yi.zhang@huawei.com, houtao1@huawei.com, yangerkun@huawei.com Subject: Re: [PATCH] blk-throttle: Calculate allowed value only when the throttle is enabled Message-ID: References: <20230928015858.1809934-1-linan666@huaweicloud.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20230928015858.1809934-1-linan666@huaweicloud.com> Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org Hello, On Thu, Sep 28, 2023 at 09:58:58AM +0800, linan666@huaweicloud.com wrote: > From: Li Nan > > When the throttle of bps is not enabled, tg_bps_limit() returns U64_MAX, > which is be used in calculate_bytes_allowed(), and divide 0 error will > happen. calculate_bytes_allowed() is just return mul_u64_u64_div_u64(bps_limit, (u64)jiffy_elapsed, (u64)HZ); The only division is by HZ. How does divide by 0 happen? Thanks. -- tejun