From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f173.google.com (mail-pl1-f173.google.com [209.85.214.173]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id AA01C3D6465 for ; Wed, 19 Aug 2026 22:20:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787178022; cv=none; b=c9VY0EglaUoauNxuTlV8eHF6qYqcFvY4qbj5IhEQd4SmG/QM7tUAoMTmTJyQ/PyUDOk9tH+EdfVmaeH47KeCdqZFMzSrZ9CVND5F8f4cBIHDp1oJLep3V5Bp9rMXec+OKy5A6Q5g1/Uf1MyNrK3fQ+SxorrAhn6+7ro+SFd7i2U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787178022; c=relaxed/simple; bh=M1VXUNwqUwGEgfRS0NgJ6OgY6SeOvTMhCU1xDOQSQ24=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=r/j/UlY20p+SDku8ti62GeD2AJm8Ql43SniTeiFap0Dr4hzaF1+YBF1wV5Z/b0M2P/659zTktwVXBMFf80oE1YOdnO3BoYfbjE/WQ7peucB+UiATF5XWwkfN8RLW8Apnui5kJJELEPZpW9HjdaRgCg23pU1UzSm1tUB2BHC/lPQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=VkPkvuFK; arc=none smtp.client-ip=209.85.214.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VkPkvuFK" Received: by mail-pl1-f173.google.com with SMTP id d9443c01a7336-2cf52d15d88so12239455ad.2 for ; Wed, 19 Aug 2026 15:20:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1787178021; x=1787782821; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=3pxS+zsXhr0mdIotv7+6gGRpeyumkKfkIec1uTTrutY=; b=VkPkvuFKv07HXhD/1isMbBl/+FiF6yPnHEATZ7cVaAcMOyo8Xx6ZVC3M6oMpUV4oAx Fs1sQmlI9IuXKdPqObUeL24zwpgXdkhshi08r+GMiVIlLFgB6+cV9JL9nrH42jCPsBU4 +aNfi+MdOTO++mJ4d/w9hcE3kXSekoVs8HX/52jwlol1JLZNZWfgwyLTXlUVSM1zuKeC he8bVI8a2Tpgm4m7yXMAiTfSv1upeehI3xX7vQJ6npmGRGaw/J3kKdowBAPqZ8Fug7gy Mk+VQq92T8xT9b7ez/0VPvD8CzjhLqkCSLSaRrqtKeo/3uFgetXWYVO2dGJavaY4O2gm IUVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787178021; x=1787782821; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=3pxS+zsXhr0mdIotv7+6gGRpeyumkKfkIec1uTTrutY=; b=lLgEbP7d0XKjysH+MJ5kHA/5m7Pgb2yGL5kWNZP9WxVuc2FoiBD9XNcTSZOWqUT43x GHMA+fxXGekzLA37g+Mq8FbJpCxNxOYCq3+sor3E6jqF01SFjyvORyxfZkX3n7MXnjnh eDoq45eB0upBKgqAMsYcYj7PNoUcAB1ekY90d1xxkA81UvRbA2B7TszRCISUiTUKQ/La hVrAlD1eLlfwdhXo+s2FjTP8YLHUVOLK7s5myw4aJLqlBYKaVi+VBPF26RhIbfGlxsHy oAT2BdeXfaxCtqKDC6duKePQnzPW/l4KxmnfPLock+xaUCUGtBJvAOlayK+xTeOtdC/i joSg== X-Forwarded-Encrypted: i=1; AHgh+RqSGNv/tZFpv+oSG/ayYJkiLGbBImv7v/wt/lQs3ecW9eP9vimfukvauTXAyJRXQWmQXS0gWXxVmj6dVd4=@vger.kernel.org X-Gm-Message-State: AFuF++nT33j8zFrUBqMC1nVFIr0QTWETM7rncX7TxuvDOlyHs/sFlPAT YBOIupInDyuKe9I5W4xPJfWhV/r0mcM2YpG4SGPR+dxjgIAlw5HcvlwD X-Gm-Gg: AR+sD12+VO8KXCPv8sP0jGDRIb8ZgedCgM+KYHf/50mdnXfIgUg9CHKv0f3u/KsQZtv XWyUOFDHkio3fLJqp+xV0Hya+so+ZVysQ2v4prrtbgjCo4G4gqv6lKkiODmb8++qanF13lRsRDZ 2WwAWRCdS9Rfe+/vwHEBarrr1JEszy/SFz1BqPE0iUvZ7ybATfP3r7JcD5BjVGItgWzpDNxj8pk 3xoK8peof3oWwDtESAglSdb1e0NXh4AZtpy1itwcdC8j3gLs9Lp2MWpoptgQKhRrUNkbGty6sws wP8niM1wEnE5uK5t9c184bx9tgJpbgu1DzDBX4vCY9vmmXYPq/MgWu32vrcoW4nsgYm/zEMO2Bp SzoYY4DeRFvlwagGKBBErMyaufToXLrUGNQgUh63KFpyngxUHODQQnPWxAYq0uIqUYI8h/b1VHN hbYJkp/rNmpU8zOiaudbHRRXkzN9vy+HUxvJl/LXxhFt7RaKZSGMnqG/J7CzSwBOaJjDKzHrHAT sm95tSjrPXMyQ3HMug= X-Received: by 2002:a17:90b:4b8b:b0:38f:efed:5448 with SMTP id 98e67ed59e1d1-395812aa117mr13843288a91.8.1787178020794; Wed, 19 Aug 2026 15:20:20 -0700 (PDT) Received: from devvm16600.scu0.facebook.com ([2a03:2880:9ff:64::]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1416ad699c9sm10555337c88.8.2026.08.19.15.20.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 19 Aug 2026 15:20:20 -0700 (PDT) Date: Wed, 19 Aug 2026 15:20:17 -0700 From: Ziyang Men To: Tejun Heo Cc: kernel-team@meta.com, Jens Axboe , Josef Bacik , Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Eduard Zingerman , Kumar Kartikeya Dwivedi , Martin KaFai Lau , Song Liu , Yonghong Song , Jiri Olsa , Emil Tsalapatis , Shuah Khan , Johannes Weiner , Michal =?iso-8859-1?Q?Koutn=FD?= , Roman Gushchin , Shakeel Butt , JP Kobryn , Mykola Lysenko , linux-block@vger.kernel.org, bpf@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/2] block: add BPF kfuncs to read blkcg io.stat Message-ID: References: <20260817214205.723267-1-ziyang.meme@gmail.com> <20260817214205.723267-2-ziyang.meme@gmail.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: Hi Tejun, On Wed, Aug 19, 2026 at 10:43:51AM -1000, Tejun Heo wrote: >Hello, > >On Tue, Aug 18, 2026 at 04:01:58PM -0700, Ziyang Men wrote: >> On Tue, Aug 18, 2026 at 12:42:54PM -1000, Tejun Heo wrote: >> > On Tue, Aug 18, 2026 at 03:31:29PM -0700, Ziyang Men wrote: >> > > Ok I will add the casts bpf_get_blkcg() and bpf_put_blkcg(), and remove the >> > > check of css->ss in above functoins. >> > >> > RCU_PROTECTED is probably better than get/put(). >> >> Yes we can make the blkcg* RCU_PROTECTED but then the bpf_blkcg_flush_stats() >> needs to take the @cgroup* since it is SLEEPABLE. Does this work for you? > >Do we really need that function? css_rstat_flush() is already exposed and >css can already be obtained, right? blkcg_fill_root_iostat() is just >accessing system-wide bdev stats, which you probably don't need to begin >with or if necessary just access through bdevs. Yes the css_rstat_flush() is exposed but currently it is marked as SLEEPABLE, so it doesn't accept a RCU_PROTECTED css we proposed. This is not a problem for cpu ones since &cgrp->self is a trusted pointer. Best, Ziyang > >Thanks. > >-- >tejun