From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=95.215.58.240 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796131597; b=LTvIh5HL+qu6tpfR5aLSiSfFmmQymvLy5eQSEXv8Yeb+3sjIf+BUblhiVG1CB26BoIzs C33zrFM0iN0nAYafPD8aLlaAEVJvxy+4EqJYset6bpsu2+HepOIwTe1uU2tS1xD4S+Ad5 ZSHVGkCTlqlzJMFq6acmSMFrGFK6NZU7cNmjA1R18fyKimLfA1z3JGhFtEWvm4o0/pgDe GiWLVPlSMcWckU6KBnwHXVF0ZY/77fnVGfgpitys+O+kvJCtkEGcG/eqV60uRzSrvds2i +HqxMd+WCcxixIhDWEOVK3EAoYBRigCHnC8uI9mHQNmPfRboJ3VHrzkKn8gRK/dbWCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796131597; 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=NZG6wLWiBncvZvd3zPO7RYH6X0XSO9tXB3G0AB9OR0vPeBMRPQUcwbFMCE14ckbxGlsE 46iLBbNyiOhLI6QE4nYJHLE8ygkYBxWw+5bhzJ4ZB/TBIrFMqxcQnKTyuNGRA9omd/U91 Rp+w6RdEgBtzlZT6OZoQ+pvM0Zp8EEFnvgYA4TRtr4mOJHVXaFq27PbO+WrnqA3XsNlYO ueyvckNXRNcxDfOKJ0YNTuT1HINmIcLDetUqcQJ4EkLsBlFKr/CagP/0FCkZhAX339Xxq n1MuLDn6yPe1mCPX8MeJr28X0dLlxCE4vfi4AIEuU34+oBg2RMfyBC628PmpeZ5JXvg== 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=95.215.58.240 Received: from mta1.migadu.com (out-240.mta1.migadu.com [95.215.58.240]) (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 1DFFD606A32C for ; Tue, 1 Dec 2026 13:26:30 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 1DFFD606A32C 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: cgroups@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: cgroups@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: cgroups@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