Received: by 2002:a05:7412:1e0b:b0:fc:a2b0:25d7 with SMTP id kr11csp1129679rdb; Fri, 16 Feb 2024 06:20:22 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCX6Q640jk9OWZzY6ry9qODCzsd+NMcoD5cMonDdyxgsP5J+27mxr1Cs4wr9x26U81n3gGJpHiAQIULMAjPfsC5jDVLE0vY504k8LhXBSw== X-Google-Smtp-Source: AGHT+IGd2CjLxZMSfRcUT4lMyhOnPQv8vQaDVv8Brqx94AgNQMAPqDXWzInegmWpRKlKA4zcFKz+ X-Received: by 2002:a17:906:ae96:b0:a3c:7f7b:2cd8 with SMTP id md22-20020a170906ae9600b00a3c7f7b2cd8mr3688401ejb.32.1708093222605; Fri, 16 Feb 2024 06:20:22 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708093222; cv=pass; d=google.com; s=arc-20160816; b=aVaQ5Wv3oAVAyj5tQc8M3GL4qjn0tI+R7XJ9bQqPitxQbPlCD6Eu5ggOvgz8QLdm4V WK2H4dTNSl1GtMU8DzzRUdM7IbYW8FYszVEiAdXJaEWsxxcJ3MhLFTjKh3ZEPY67ovSi Z/lnmqZV8rBVC0gskjaRjwrhh6zaR4kT4BRIpQY0ZOcwnCXaY70Y5H7G5jVfBuLkZyP3 6O09nVqJ+PCbFh5153Z9QKjeRYqUn1h+u3iCADJO+PHdSjVhRCvQUMb6xBdrvgsIrWzB Kg2eA2knPh7xpC+/69VkXhvvK29GG7NQZG82zbcJRLHIdHspPekkQSysz1BjHsZPjXt7 +/7Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=mime-version:list-unsubscribe:list-subscribe:list-id:precedence :message-id:date:references:in-reply-to:subject:cc:to:from :dkim-signature; bh=ci0yy+9I7QlXhvTWg0bk5A4FPE/qqC8wC9ZrpH68ucs=; fh=7ETIVFnzgVUg0Daxa3BlSi7nYX8g+2AJxLB0M7PH2vU=; b=bIrSvNZmmnQuvdiqKXSp1KHbqXB+O0eMKYxN8uFiHr1e2evSUdCbuWW3SFqPxYS7QP skW9OD+Wh8riRPbDPu69AsZk9k0Ro2lcbIDm+qzg9NmeU/6GJLY/8Bu1z0smzpi6LJfd +urBvr4BXq9nXJIG4m2Iln1URuArpObSlPDcM20Ygr3Mh29/mvGIIobU55BpB8w5pnHK AKLqi2owBmeNrQz7mKQdXfoY75EhGzv9SZHq0FbgEvVHRP0jeLRDLkpfwkYcD2oGi1+y s1XNj1tvfvNdQFsBc3pY+Jlm79cvTh9E4VguuryVcLDgL+/I0svZalrU6WmukIVg2jW/ NDXw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H8FrulaG; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-68733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id g17-20020a170906395100b00a3d61775460si1629042eje.176.2024.02.16.06.20.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:20:22 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-68733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=H8FrulaG; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-68733-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-68733-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 5D8E51F26399 for ; Fri, 16 Feb 2024 14:20:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 8B0C212CDA6; Fri, 16 Feb 2024 14:20:13 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="H8FrulaG" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) (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 5392D12BF24 for ; Fri, 16 Feb 2024 14:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708093212; cv=none; b=lBTy2B/pVAU6I17wK5LjWrqG2lxuvGsTp/AdMdJMyo03KUZ5gcv9JfaBT3QPUWMH4Pf5jBd8JdGqfQUkbh0DLF4I+g86f0wflLSqe4HM+U0zN7CQgBDBV00liGmU4QCvOqAUfEnCaZDEAGMrGsbZ07CJml4g/seWnzkBKxF3Sbc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708093212; c=relaxed/simple; bh=AeJy7JV2hQVTRmMq4am9/8y0pxu/DVW/wVFGgVfz4j4=; h=From:To:Cc:Subject:In-Reply-To:References:Date:Message-ID: MIME-Version:Content-Type; b=ZvbtRGSGl4D/RSRtD26c0Uyw8oK7MeODfqaVxyAIdsk5uLp4lHv4BONZgpr6lEOm02tVKiNwF13gcFryEETtp0xwUdNRx4rzgBIag3+C66jAIT9wLBRR2VtbLp0iMDjITdiuDoRsia7wcVLao64cppsLeMs+2shZqAMLN4pbjkA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=H8FrulaG; arc=none smtp.client-ip=170.10.129.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708093210; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=ci0yy+9I7QlXhvTWg0bk5A4FPE/qqC8wC9ZrpH68ucs=; b=H8FrulaGkaJe2AXkijdslaJrWtIlT0nweaiakmkMhcp6poLyAOMSuyWFLK8f8YMzSgHgCn SJPOO6uxgDQ0l4jgElIBzv2rnLXaZ0YkAFyw/mc6aomQV3flxfXRk6Iz8WNdnCQvUD+MiM srstVEsHZ5tpYAQpagNut0VJVpaEq28= Received: from mail-ej1-f69.google.com (mail-ej1-f69.google.com [209.85.218.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-155-msgdNx5dOWCrPvVRT_-Ymw-1; Fri, 16 Feb 2024 09:20:08 -0500 X-MC-Unique: msgdNx5dOWCrPvVRT_-Ymw-1 Received: by mail-ej1-f69.google.com with SMTP id a640c23a62f3a-a2c4e9cb449so152008566b.1 for ; Fri, 16 Feb 2024 06:20:08 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1708093208; x=1708698008; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ci0yy+9I7QlXhvTWg0bk5A4FPE/qqC8wC9ZrpH68ucs=; b=j30rvHSt9YTzchj3FpWnZFXX2eFsrHwRXWp9MSIvgNHu6NRYd8Al5UzoaeCMaGSVv+ 6RhGZ1Jcng/oUfrjz8DJFhFw/ZyHT0Kd0KEDua6Rge391N9ziwHYD5INlA13yNjG7BQT zhOPDVlMDIeDoJBgko9Cy4yDTfQPGOgTw/j8fBxAKvZXqSe8ycxx0Zk1t//yaG0m29Qa WYxMehQVd0WZ1SpGMJEneVgXhCdyof+eOyATCYz6eqmarIoOKpJBvDsysGk4lEufVW3S ScS6AcSA+jsRmd5ajvoMtTuU5ypI6a6epuDyl6FcJwq/VoU46jeovfVRLUhWRhZ2Eneq frug== X-Forwarded-Encrypted: i=1; AJvYcCWDVazzSmxaLpBP4sbPUJJ+jcvCuyCwbqpuUO3zEI8lNQheOM+/Kf4ve3BXU2zeg92TeCjf6yxW9+jgLx6XDlY7pJ0B7jno01lTGkiN X-Gm-Message-State: AOJu0YxK3wR+cBc+VfVNL18A5WHlMc+MFrrysGPI8np+Q7/DpwKAyjeL bLsncji5vqrEI+8lgniq+o8TdVoWP8+9DmdGwazqcWXAioCsCkuzMi1l/8cdBhP9Th7EJ+rgOlD NxsUDaqStOiL6037dYsXCnG4HgSy7mjxNXtjfnw1ZVKRIRbwPT7K9REGJsWpiEw== X-Received: by 2002:a17:906:eca9:b0:a3c:dbf1:ef8b with SMTP id qh9-20020a170906eca900b00a3cdbf1ef8bmr3930970ejb.76.1708093207884; Fri, 16 Feb 2024 06:20:07 -0800 (PST) X-Received: by 2002:a17:906:eca9:b0:a3c:dbf1:ef8b with SMTP id qh9-20020a170906eca900b00a3cdbf1ef8bmr3930948ejb.76.1708093207508; Fri, 16 Feb 2024 06:20:07 -0800 (PST) Received: from alrua-x1.borgediget.toke.dk ([2a0c:4d80:42:443::2]) by smtp.gmail.com with ESMTPSA id rs28-20020a170907037c00b00a3c66ac512asm1592316ejb.214.2024.02.16.06.20.07 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Feb 2024 06:20:07 -0800 (PST) Received: by alrua-x1.borgediget.toke.dk (Postfix, from userid 1000) id C2A8D10F5BF0; Fri, 16 Feb 2024 15:20:06 +0100 (CET) From: Toke =?utf-8?Q?H=C3=B8iland-J=C3=B8rgensen?= To: Benjamin Tissoires , Alexei Starovoitov , Daniel Borkmann , John Fastabend , Andrii Nakryiko , Martin KaFai Lau , Eduard Zingerman , Song Liu , Yonghong Song , KP Singh , Stanislav Fomichev , Hao Luo , Jiri Olsa , Jiri Kosina , Benjamin Tissoires , Jonathan Corbet , Shuah Khan Cc: bpf@vger.kernel.org, linux-kernel@vger.kernel.org, linux-input@vger.kernel.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, Benjamin Tissoires Subject: Re: [PATCH RFC bpf-next v2 02/10] bpf/helpers: introduce sleepable timers In-Reply-To: <20240214-hid-bpf-sleepable-v2-2-5756b054724d@kernel.org> References: <20240214-hid-bpf-sleepable-v2-0-5756b054724d@kernel.org> <20240214-hid-bpf-sleepable-v2-2-5756b054724d@kernel.org> X-Clacks-Overhead: GNU Terry Pratchett Date: Fri, 16 Feb 2024 15:20:06 +0100 Message-ID: <87bk8gcwyx.fsf@toke.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Just one comment on one of your FIXMEs: > + rcu_assign_pointer(t->sleepable_cb_fn, NULL); > + /* FIXME: probably do something about the SLEEPABLE flag */ I guess we should store the flag in the timer struct somewhere, and then restrict the set_callback() functions so that the regular variant only works without the flag set, and the _sleepable version only works if the flag is set? Otherwise we may end up calling a non-sleepable function in sleepable context or vise versa... -Toke