Received: by 2002:ab2:6203:0:b0:1f5:f2ab:c469 with SMTP id o3csp735287lqt; Fri, 19 Apr 2024 08:55:39 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCXtNY6klrq4ql7JMMf2/rtoqxKqW5FtBLafXPrc58nX/+w/0XXoPpUz5cec8fQ0WhudaEp/LvM+pOL81+B3G/Lm0IS5CbTBpU8GTY3E9Q== X-Google-Smtp-Source: AGHT+IEPA5NeyTsI079bpvX+qgVLWk+Y//hclBQpVUDrA7eGkQoilm4lxAkvsXikp8Wkp2CI3/0G X-Received: by 2002:a05:6a00:22c3:b0:6ed:de6f:d72f with SMTP id f3-20020a056a0022c300b006edde6fd72fmr3234546pfj.20.1713542138660; Fri, 19 Apr 2024 08:55:38 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713542138; cv=pass; d=google.com; s=arc-20160816; b=ntKhRjJ0LoZSUCKn66xuYHLSis3XW2RjUIXHu1fy1U0BT5qmgKFSDil/VK6gz94ycE HNYlcisBm3fnTUiJ4QkcuTmOT98ZlHpFem2g8rF/ATE0EIqrvgmAXOmZIXHli1v25Dhz 9mXXIaz3EtrWV+eTgFv7XPvsBptoivkwm8JzauI9NVGo0bn6CbN9szyS1tugIXYr22DF 81ZYB0kCcPQBTE4c7LTG4CYlARBaBZjNBMvzKCIxyXVR3MUItCai9VwIDZ/JcaT38/pe Qrn2E/P2jHCI/324YW9g+o5tZ5YSdlMIFiiS9Vm1wnRkZq99O5gTEposkM1eaw8edH/b kJoA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=iE4hhVvwHRHgajo2pFWitmyjQjnJcnFa/MZwUfqPkTs=; fh=q4UXWtcyd1MFDR47RrPgEwGOSJCQezDRAV0OMmsdobo=; b=m4DK4xP9qlFJws6e8qqZaxZvgCZbzz5VfUtfgd+IrYbujzXM4+NwTUOxezHTZhkcL+ uh2sAmIJhZsQ7fpvVbp7FZc/GcBQdrV6OXjXRpZs1wanK45B5xVzGz/wtohY1ov9wRp/ JqdJOEoHz1MS5KNLDQ+V7QBxNT7smiLYXVXVQG16XT1WCTDYLf4VWVedjTYB+azYliv0 CEBYhdSOdugHrbPzDl8aweiwnwfFOSeAXXhkKgXtzeTFmdhZM8AM4zc/9jzsYsHFYlsO YaHcAF6IIGM+7BJsJvNQIOXKKg7kxaKX5hGombZeEbLurc2bujU8Fho2h0teRzvzm/e+ csqQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cr4H5TbJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id v26-20020a62a51a000000b006e6857da47asi3389882pfm.366.2024.04.19.08.55.38 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 19 Apr 2024 08:55:38 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-151713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=Cr4H5TbJ; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-151713-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-151713-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sv.mirrors.kernel.org (Postfix) with ESMTPS id 15A8F286733 for ; Fri, 19 Apr 2024 15:55:38 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 354BF130A73; Fri, 19 Apr 2024 15:55:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cr4H5TbJ" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 573711304A5; Fri, 19 Apr 2024 15:55:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713542130; cv=none; b=j0ekU7IL0tRrbV7TrniHlHcOglxounnqsR08h5w+4RE/PYamYiEeHiHr8cVlnvQDS04VKo4udWKG1T8z9PdG0D27UoNgb61Bs93QErZpVZTa6MN1jrmvkiJ/2ACua8Dyk9HoxB4C8VxrIGEbfDWV6GjTksFKUUwiExFSXdR8SvU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713542130; c=relaxed/simple; bh=AdnkUZ4BxyxoMF4croWKhJcA1cUJ96+sbBUrt1HWBp0=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=m1CyVP5yGzrPAm3rCXkLiHaeBfjauac+bSLkNkGh7PdguMJn0baZTGP/MdIAUapMeGFDV6TnoyKTjz+iSXLf8GQFNJ6uNrWCyVLTT8zoY/q4/gB2L9kJCeqYW/B2zoDxvI4dts+D8TFvBImw6Y9uCtaW/ZjRiUweyP1QwgSAN3w= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=Cr4H5TbJ; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C06EC3277B; Fri, 19 Apr 2024 15:55:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1713542129; bh=AdnkUZ4BxyxoMF4croWKhJcA1cUJ96+sbBUrt1HWBp0=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=Cr4H5TbJTo7tzx1BNWZxjH7hWqblNLozEhIN3T5lkjSv12y8/Fpf7nkpyD91BrAZe qEgJGBsPr8dBFGZdPrlnvROC7IWkMie/odW5skJyu0TVte72KgLsYETxBA+K9r+fLk I5gPpmSzTiICULjPr30mt/FV9IOLL0lroMhU+ENYMeIwdTB/bfSwi+GhfDc9vlOKVB +BiU2To0dds8a+DtM1kLzluQmbeowvwVNG+xWGrakBKL5/+ErHlehhXu/DQSGlqCPS 3uIEEYDqrD82OrWkYny9a20MMYkbAidfh2QHBVvu+S3QdtY+NRfvsDmdmikdbJ9f8W i8pLYKb08RScA== Date: Fri, 19 Apr 2024 17:55:23 +0200 From: Benjamin Tissoires To: Alexei Starovoitov Cc: Alexei Starovoitov , Daniel Borkmann , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , John Fastabend , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Mykola Lysenko , Shuah Khan , bpf , LKML , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH bpf-next 11/18] bpf: wq: add bpf_wq_init Message-ID: <6zslg7atmsexqi3htt7auka3gvwx7pouxva4zsxv2pn5syun35@hgqunkasn2id> References: <20240416-bpf_wq-v1-0-c9e66092f842@kernel.org> <20240416-bpf_wq-v1-11-c9e66092f842@kernel.org> 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=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Apr 19 2024, Alexei Starovoitov wrote: > On Fri, Apr 19, 2024 at 8:12 AM Benjamin Tissoires wrote: > > > > > > It's something I added while adding the tests. And some tests were passing > > in case I was having a non sleepable callback. But if we have > > bpf_rcu_read_lock(), we are all fine and can reduce the complexity. > > Not quite following what was the issue. > Since the verifier is unconditionally verifying such callback as sleepable > the callback won't be able to access rcu pointers without doing > explicit bpf_rcu_read_lock() first (and few other code patterns > might be rejected), but that's a good thing. Oh, I missed that. Well, given that the verifier enforces everything, I guess we are good :) > Maybe next to set_cb kfunc add a comment that wq callbacks are sleepable. > I think bpf prog writers are often with kernel background, > so it will be their natural assumption that cb is sleepable. I assume so as well. Cheers, Benjamin