From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=91.218.175.160 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796131592; b=citOL4exSXwTJRvhMrV/c6nbV6Nt3R9yXHXTlEtnKGxEPk6xM6UuIOcbzQffF6GQlvGO e+xJuSkzoXXfQIUmIT0YkFIqdIwYkVipCst3gVLwEiNwEe46r4Tj4BWTnAc2TioF2nXqU MShwn9w/LMelGWvdnSwvT+5rU25YGg0Sgn7tJXjHfad/P6TKNIAEcJvvX8DhCr3J0MX6S Te9s9IuY2OFrbYEeQ8VFD+JS7vcBRXmYH/DaHWQ6R3tcOyzmlxjK4lqW+uVxqWMtumvKi P9QVmxh9RDzrjH/8iBcQPDGCkuOhPiSzNGU7yCy1TaFO4QmzDjc9mamcRmiBheM1l0g== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131592; h=DMARC-Filter:X-Envelope-To:DKIM-Signature:X-Envelope-To:Received: X-Mizu-Trace-ID:X-Migadu-Flow:Message-ID:Date:MIME-Version:User-Agent: Cc:Subject:To:References:From:In-Reply-To:Content-Type: Content-Transfer-Encoding; bh=uDa+i15PKQk1mI4F5gkGY6r2anRkXlXKYyJ+BzEvwaw=; b=MV0FvOZkQlZENPZKg61eKF1J6sH/naPbbb1KLgeBLutM8RYCqG5+3H5gRQsALkFpJEJO LWC3qD7RtABt54u15JMoAbFp1burmunMeLdiN4Aih7g7dZL4V1vLdSThR92qnf7866Dpf zNFNWVDcew33J+uKEh20UnjPXquU9pTo1m14TseYLcsCcttQY8sLvLAxaGWDOuKXwESod rt6i3iJjW9SDlWGfFhokpeM4dKDcDYwzusa3tkDkBsJ6XmLOwo/M1qqYWgHWmj4Hco+4y Csf7T7X7vGcNujygjWjclW+WggXQML4PpzawtVHfHoVBhYGYvqH1d1Uq0kexlwOSreA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=linux.dev; spf=pass smtp.mailfrom=linux.dev; dkim=pass header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=AOTJg28Q; arc=none smtp.remote-ip=91.218.175.160 Received: from mta0.migadu.com (out-160.mta0.migadu.com [91.218.175.160]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 20E7C606A32D for ; Tue, 1 Dec 2026 13:26:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 20E7C606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linux.dev Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linux.dev Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key, unprotected) header.d=linux.dev header.i=@linux.dev header.a=rsa-sha256 header.s=key1 header.b=AOTJg28Q X-Envelope-To: linux-kselftest@vger.kernel.org DKIM-Signature: a=rsa-sha256; bh=qwaxDJ5ucYda6T0hQLi4nUIezys1kXQxsIAzqiBba7w=; c=simple/simple; d=linux.dev; h=from:to:subject:date:message-id:mime-version:content-type; s=key1; t=1796131589; v=1; x=1796736389; b=AOTJg28Qvs5dfxzSv25p5gVMxyY65q7Tj35vHCO3oSbXn0V71pu64UrQr545yMoyXYGuIuz2 JRQWP7mvt+M9l/Pnquoo19rYHBscyuuyyYYR9nNn9iWDhx2HvGpXRlrnXUFujaYcbw3aw+V+vFi AMyZmKoln47s715kLNo1aZdY= X-Envelope-To: linux-kselftest@vger.kernel.org Received: by smtp.migadu.com with ESMTPS id abe8a60d076bfac6; Tue, 01 Dec 2026 13:26:28 +0000 X-Mizu-Trace-ID: abe8a60d076bfac6 X-Migadu-Flow: FLOW_OUT Message-ID: <2f386c09-dce8-4d0a-8947-c216738b352c@linux.dev> Date: Tue, 1 Dec 2026 21:26:21 +0800 X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Cc: cui.tao@linux.dev, cgroups@vger.kernel.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, bpf@vger.kernel.org, andrii@kernel.org, eddyz87@gmail.com, daniel@iogearbox.net, linux-kselftest@vger.kernel.org, cuitao@kylinos.cn, ameryhung@gmail.com Subject: Re: [RFC PATCH v14 0/4] blk-iocost: BPF struct_ops cost model To: tj@kernel.org, josef@toxicopanda.com, axboe@kernel.dk, ast@kernel.org, alexei.starovoitov@gmail.com References: <20261118131029.797007-1-cui.tao@linux.dev> From: Tao Cui In-Reply-To: <20261118131029.797007-1-cui.tao@linux.dev> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Hello, Tejun, 在 2026/11/18 21:10, Tao Cui 写道: > This series lets a BPF program take over the cost model of one > device. The BPF model provides calc_cost() for charged IOs plus two > transfer coefficients for the completion-time sizing, io.cost.model > selects between the attached model and the builtin one, and enabling > and disabling the controller stays with io.cost.qos. > > The builtin model is a linear formula derived from a handful of device > parameters, and the right formula is device specific. A BPF model can > be adapted to the device and updated without rebuilding the kernel. I've been testing the model switching from this series locally. One test runs two sequential 4K direct readers in the same cgroup, first with model=linear, then switched to the BPF model. With model=linear, both streams get priced as random by the cursor heuristic and the cgroup builds up a large abs_vdebt; throughput drops to about 2 MB/s. Switching to the BPF model prices the same streams sequential and throughput goes back to around 30 MB/s. The question is what happens to the per-iocg vtime state on the switch. The debt and delays built up under the old model were priced with coefficients that don't apply anymore, and paying them back can keep the cgroup stalled for a long time. My current branch treats a model switch as a fresh start: abs_vdebt and delay are cleared and each active iocg's vtime is moved to the activation target budget, the same one iocg_activate() gives a newly activated iocg. I'd like to hear your opinion on this. Thanks, Tao