Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1097988rdb; Wed, 6 Dec 2023 08:30:52 -0800 (PST) X-Google-Smtp-Source: AGHT+IGsY2/zUHC8L4OBsdAewRr/2z5ZC48t4t787oxFA+vP5yxIMcgznnL5FAk3Wit//tH7W2BV X-Received: by 2002:a05:6a20:8f0e:b0:18f:d694:e899 with SMTP id b14-20020a056a208f0e00b0018fd694e899mr994502pzk.7.1701880252313; Wed, 06 Dec 2023 08:30:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701880252; cv=none; d=google.com; s=arc-20160816; b=F4/ggl+9OrORz4VOnY6vUY5pa4vrKi9Zd0t9UpPZORyEHzCqiAeqKN3AZ1UyiMmynv gZikNg6/yRNbZ0BcO2m0QxQuM1WZJArsWDEMDTTBjr5lqJAIBbrCj0YsWW+pJS7vDTo3 hvjqUDOvJsCF4qqwqg2RSAz2GnU+EEsMiXjkn3LZF1K+f2YsRQFRjVRlpNvQJmJILXy/ ECKWFzet+EK2Yk7DSSJiGGOO+CvASD6snd/7E6TfI+eOPYXhvAYhaefM8CnD730sgVKS qcyBxCpLi950PtIV3n9Fj0FHxMMg8iDldZ3aU3XHS3nhYepkTrTF+phs5agoNS4mrj9S iOJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:feedback-id :dkim-signature; bh=MfrENQZMpwmFIEWGgMUijz+SvZACHv6cKia/JgD/FyM=; fh=99QuRCTQ1okhSjMn+8e6wDBZajfICVvbC1Z9yI0Gz2Y=; b=Ynl1ByONtEgiHxl4xghCznTPR/WOsbgZhYwwPbiI17WxxHbFpywwri0gUh+4JMl6l0 mNc/49xHCuh9RcrkDLonyP5G3bjiBO7qgOPF3XbFuBzACPLew/yr/lUU+1pIaTbi7kPo pbtk6Xk37TDuvPmnaAVoMtGphWPEbdzCK5frR1Y1zclf6rBjI2gHt+m6Zz/zgMmllqxI p5cUHbHg38R3/mwrgZ+tY/eguiPxWSRuhDgqubylzvfjXFlHLmsN0ItfKCCCRIGNYcUS D/QsT/vLFxbYGUEnYL4quzL39QraN+Wyw+nz/6mEW2abo2s5Ol6ct7z2iiZ7IgGj6w8V TuYA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PdBWe4uG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id dr3-20020a056a004a8300b006ce7ff254c2si165577pfb.368.2023.12.06.08.30.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 08:30:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=PdBWe4uG; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 7231D8343958; Wed, 6 Dec 2023 08:30:44 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379338AbjLFQaP (ORCPT + 99 others); Wed, 6 Dec 2023 11:30:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1378366AbjLFQaG (ORCPT ); Wed, 6 Dec 2023 11:30:06 -0500 Received: from mail-qt1-x832.google.com (mail-qt1-x832.google.com [IPv6:2607:f8b0:4864:20::832]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CAFA010D9; Wed, 6 Dec 2023 08:30:11 -0800 (PST) Received: by mail-qt1-x832.google.com with SMTP id d75a77b69052e-423a9cb7e80so6388221cf.3; Wed, 06 Dec 2023 08:30:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1701880211; x=1702485011; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:from:to:cc:subject:date :message-id:reply-to; bh=MfrENQZMpwmFIEWGgMUijz+SvZACHv6cKia/JgD/FyM=; b=PdBWe4uGqYJDFPPWGzTsbex9z73JsarQvA0hWVayhIyXmyJYNUec6/bRsU2yL5uUsF Z4tPClxgK3k3EV/8tXf3UWiUJggn0ByS3+0A6i5msgNKowkqHqiZyRTPCRrfxdnIiCJJ o9ACwSlQ0ToOlwbn+Glg4lqvl7fGBgYV+LczDeTK2td8D+fhM9ggh5L3ZfwUwsRJjL2c SJS+0QLcYBQYX+N9WpdGGLDyH9cT1E6nlgd/wIGxEvUIJ70Zyq3HZ8UgnMApDIRC2E7Z Ey4zHtVbHPA9yYigwBDqaQwExNn5eLkBC7sgk00LutK8cvKr+igs1ZLL30LjH1bofGHq Is8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701880211; x=1702485011; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:feedback-id:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=MfrENQZMpwmFIEWGgMUijz+SvZACHv6cKia/JgD/FyM=; b=Mf/cYDREhsivOv2xdZ6NweoW4P8k1nMwYhV+DQvBUZY0KAC5NOshy/d1vX4S8tF7Pn R/l99Sf89X/KfWVcKUWSGTdzD3h8EHF+1+pIoJorSfG5W4djdP4lfqTIu33Wq0v5M8XO 0p1sIG2pOqnLE+p0RkTdXgXF2ZRLTY4sRU1sYFiLpPTZn/dJA/Sk8/Qx7HkJdSJKHjkU g6tU9KitN1Wg720tnCdaJ8Obd6EzmgjHXMvVB9GHPMnzLs4gnweUmnPxkwB9h4YILuLX 1Kb4/qNgYWmd11CkhFCZ406zcuDf1l9UFyVUsGAO9OBwNoaB8rNfWUtR27DsdpYf1tzQ mpxQ== X-Gm-Message-State: AOJu0YxGQDrGLtxSyNLTbLMK/SSpnu2Mxda+HAWvWgY+oD1MOcbfAQCl 0WhGFGwGzzOBvevhXs2lg9of/Gdy41o= X-Received: by 2002:ac8:7d41:0:b0:425:4043:41da with SMTP id h1-20020ac87d41000000b00425404341damr1511637qtb.134.1701880210955; Wed, 06 Dec 2023 08:30:10 -0800 (PST) Received: from auth2-smtp.messagingengine.com (auth2-smtp.messagingengine.com. [66.111.4.228]) by smtp.gmail.com with ESMTPSA id f23-20020ac84997000000b00423e8909bfesm73439qtq.6.2023.12.06.08.30.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 08:30:10 -0800 (PST) Received: from compute6.internal (compute6.nyi.internal [10.202.2.47]) by mailauth.nyi.internal (Postfix) with ESMTP id 0422C27C005B; Wed, 6 Dec 2023 11:30:10 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute6.internal (MEProxy); Wed, 06 Dec 2023 11:30:10 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrudektddgleduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvfevuffkfhggtggujgesthdtredttddtvdenucfhrhhomhepuehoqhhu nhcuhfgvnhhguceosghoqhhunhdrfhgvnhhgsehgmhgrihhlrdgtohhmqeenucggtffrrg htthgvrhhnpeehudfgudffffetuedtvdehueevledvhfelleeivedtgeeuhfegueeviedu ffeivdenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe gsohhquhhnodhmvghsmhhtphgruhhthhhpvghrshhonhgrlhhithihqdeiledvgeehtdei gedqudejjeekheehhedvqdgsohhquhhnrdhfvghngheppehgmhgrihhlrdgtohhmsehfih igmhgvrdhnrghmvg X-ME-Proxy: Feedback-ID: iad51458e:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 6 Dec 2023 11:30:08 -0500 (EST) Date: Wed, 6 Dec 2023 08:30:06 -0800 From: Boqun Feng To: Alice Ryhl Cc: Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] rust: sync: add `CondVar::wait_timeout` Message-ID: References: <20231206-rb-new-condvar-methods-v1-0-33a4cab7fdaa@google.com> <20231206-rb-new-condvar-methods-v1-2-33a4cab7fdaa@google.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231206-rb-new-condvar-methods-v1-2-33a4cab7fdaa@google.com> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.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 (howler.vger.email [0.0.0.0]); Wed, 06 Dec 2023 08:30:44 -0800 (PST) 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 = core::ffi::c_ulong; Maybe you can add that (in a separate patch) in kernel::time? Regards, Boqun > + }, > + /// A signal occurred. > + Signal { > + /// Remaining sleep duration. > + jiffies: u64, > + }, > +} [...]