Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1105468rdb; Wed, 6 Dec 2023 08:42:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IE2o0ZdQmEjCTTxxcegOH6W83dgh6NQGhaO33m5crS38oxhcKhiemmvlxBe9rYqQiRLF/jJ X-Received: by 2002:a05:6358:911:b0:170:7219:cfd7 with SMTP id r17-20020a056358091100b001707219cfd7mr55043rwi.4.1701880976707; Wed, 06 Dec 2023 08:42:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701880976; cv=none; d=google.com; s=arc-20160816; b=n6zut3mVzHgTkK5IkB+7YuX7uKmDhIFrePjdPjiFecsBn6yuIdgIVZ7rnyIGLpeyDG 757Bnj4jGR9HnGetLflkaFUsTRqlTKstV7mA2HAHc156AgwOa192Hku6w7SpZsMQ6aFJ m4KO9FweAOiCecfvEQv7dtHGglCpUINfcBiA29nmAgJ8QG212tZ1ACtUEZ8l7w7Ig/xp 3H9vALv+A0JxHQmdA6NKSWJJjWXPgFw44PHXMwFyU325990qlAd4QPE18WafLkurPg67 DNPUHyp2jKSDUD9GSp93YkoCz0IXzUHgOwKumLvmv8etUinejorrQ+GopXxqwEmiUV+y qb9Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=U8vjKdo8RtK9sF2zFHnjxxHr37Mkrh0m1wUp2s63Svc=; fh=NiwK52noM0vV5tgcUKuP6spYTtYu/xnWFkHZpGAhcsE=; b=Uxl6uPuLCU+jNGNMYCop0X3Opq5VDRV2oZNj7P6WxEXf7TNV9wdUiFSb1wnYQQYslK A59/NMdslxS4TPSGlcqPFCGTLnrxNd2Qm6GByKv2HbtFq3sSn1Z22gtC8VM+IOa5zUca FKH/KG6EqOTn3yzzOx+XVrpIMPIrhG6A2VRdM4tFPYvswsAGPfnElkqjM5weIggQ1Hkq 1RWybRZSEpN6Eauy+MXO/w8MslfALEkHKFTcvQEM8D2MlVEBydqAn+lsLnLQP4BvBZZM zmz+pmWeGcO+o9aJK7PiNN5E2qtdwN8DGSYWEz8J5GjG5dGc97KmOa+HgFMI6q7eE4Vs q33A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ujodJ7JU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id b14-20020a6567ce000000b005644a9be955si163061pgs.179.2023.12.06.08.42.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 08:42:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20230601 header.b=ujodJ7JU; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id EA35881C396B; Wed, 6 Dec 2023 08:42:53 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229977AbjLFQmj (ORCPT + 99 others); Wed, 6 Dec 2023 11:42:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41552 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229644AbjLFQmi (ORCPT ); Wed, 6 Dec 2023 11:42:38 -0500 Received: from mail-ua1-x92e.google.com (mail-ua1-x92e.google.com [IPv6:2607:f8b0:4864:20::92e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C7355D4E for ; Wed, 6 Dec 2023 08:42:43 -0800 (PST) Received: by mail-ua1-x92e.google.com with SMTP id a1e0cc1a2514c-7bb3e55c120so2067724241.0 for ; Wed, 06 Dec 2023 08:42:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1701880963; x=1702485763; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=U8vjKdo8RtK9sF2zFHnjxxHr37Mkrh0m1wUp2s63Svc=; b=ujodJ7JU9IgtG962SsMEjXzR6OBrYNqON6p9GLOidwYPR2d3bQZoJAT3qX9T11QyCN qvMnHK7zP7Rw/BaTJcv5HELGDiawKkraqP0MTtFmrP5G/TEFIwNcrVCbnEdt6JHj97rY xIMpyMk1zqECXDyB183vn3KCQgrgC8Ci9vyOjVR8yI6Ky6LO2tu+gQp3PTXS4X/9/MrU 9as3bBiJKI3eXeSYhNhINee9f7Kxz+azk08tuEZ9EVPbdavGjFRQpSreUkTu4fCEtDDn +PUQBzftUS/2cdKbVN1DPI96y/puz4DTTORMNBbe4D4XDuW95nJo0nyMJHf5T3I4SZVC i/Sw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701880963; x=1702485763; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=U8vjKdo8RtK9sF2zFHnjxxHr37Mkrh0m1wUp2s63Svc=; b=UCMBs3NX89kav4jNIQFbsm2mnwCINSjjqywFeuQ26yQJGlKohUtGt0HitGGI9/xvzB 99/ZAp5lVkYYKW/61/iHkCUi24DegoH5LsIA+S/Lm2KYEBsP48dUObblTwJwHRWICaDy EwgQm0nQewTMjo0r1fwv/jVvM1dx+xxqd9eADnTnatDuQGtVsfvmg3CIyY2gBRSN+EuB JAFQGO2l05OO1EPTfqaTTLyd7QLox84vOfTuAcqcmZ9EmM4Pu9uYPV2F4PHOpO2Mjstl nLp6v5vBLqHy04GhNGEMTxNihe0IbvkD8jTGkaJb/0SusOSALK9JKZ+m4QgHMDaBPxAi Dwyw== X-Gm-Message-State: AOJu0YzTbE/KsH9rULOl+t0dRaaAuM9uTe7HAqxuYgkhXQmlD7Dgd8kf 3ba1XofjquYRGGsIlEr2lpKKUDGwjha5La9yHqJWhw== X-Received: by 2002:a05:6122:3c54:b0:4b2:dbb5:bc58 with SMTP id fv20-20020a0561223c5400b004b2dbb5bc58mr1380918vkb.29.1701880962567; Wed, 06 Dec 2023 08:42:42 -0800 (PST) MIME-Version: 1.0 References: <20231206-rb-new-condvar-methods-v1-0-33a4cab7fdaa@google.com> <20231206-rb-new-condvar-methods-v1-2-33a4cab7fdaa@google.com> <20231206163945.GC36423@noisy.programming.kicks-ass.net> In-Reply-To: <20231206163945.GC36423@noisy.programming.kicks-ass.net> From: Alice Ryhl Date: Wed, 6 Dec 2023 17:42:29 +0100 Message-ID: Subject: Re: [PATCH 2/2] rust: sync: add `CondVar::wait_timeout` To: Peter Zijlstra Cc: Boqun Feng , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Ingo Molnar , Will Deacon , Waiman Long , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-8.4 required=5.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE, USER_IN_DEF_DKIM_WL autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Wed, 06 Dec 2023 08:42:54 -0800 (PST) On Wed, Dec 6, 2023 at 5:39=E2=80=AFPM Peter Zijlstra wrote: > > On Wed, Dec 06, 2023 at 08:30:06AM -0800, Boqun Feng wrote: > > On Wed, Dec 06, 2023 at 10:09:24AM +0000, Alice Ryhl wrote: > > [...] > > > + > > > +/// The return type of `wait_timeout`. > > > +pub enum CondVarTimeoutResult { > > > + /// The timeout was reached. > > > + Timeout, > > > + /// Somebody woke us up. > > > + Woken { > > > + /// Remaining sleep duration. > > > + jiffies: u64, > > > > I have a Jiffies definition in the my upcoming timer patchset: > > > > /// The time unit of Linux kernel. One jiffy equals (1/HZ) second. > > pub type Jiffies =3D core::ffi::c_ulong; > > > > Maybe you can add that (in a separate patch) in kernel::time? > > Urgh, why are we using jiffies in 2023? I assumed that the correct thing here would be to accept the same unit as what schedule_timeout takes. Should I be doing something else? Alice