Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1103916rdb; Wed, 6 Dec 2023 08:40:13 -0800 (PST) X-Google-Smtp-Source: AGHT+IGCSQj9A0BB0roi5EZflUFzOnpOUgulOlWsYif3A2O0QQz3k3BQjE3X4eZJiXJ0YWtKGOmn X-Received: by 2002:a17:90a:3185:b0:286:6cc1:27e with SMTP id j5-20020a17090a318500b002866cc1027emr885701pjb.73.1701880812764; Wed, 06 Dec 2023 08:40:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701880812; cv=none; d=google.com; s=arc-20160816; b=UMjNb0u1D54WgIERg6xHawjjBzYr3zaT5GQ4jAjSnMWztmdxZnA29aqPebYW73hD1h oHBfknbSFn6+SfFaLu0LpkitMi7Xaotyy5ZuRakKaiwX4OUJBzyhJkHgOmmLeQIkxLvJ J8tLw4vc9gLftz6Bempayk5wULx7rAcRdEotLaKzBk29vGCUiDhwfR2UOy+/4Vfgua/J qZKClE2P3YwhMO6XfIRLVj837vQVuP513WL8yyFzKp2pUYWNm8n0qODAM4sfrbV+3eBB EiuBX//Wj9qwQIxmqyip78L5kV1wyXeArVq3cc16pH97ktWAax+Ruauxfp/msdiyReyK taLw== 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:dkim-signature; bh=wozrE2JVwYdQea39v2odwAxayUucaERPPUek0lDwYT0=; fh=zvsJNWCkVlu5rrBKGHFYPwpm1ZHb7fYZmHrmMBi8d+4=; b=KCFL8BShKuflaJ56bhEbadMD1zEZCRe6FpeWU9nb+9vN55dDBiryiKO0C7IixPW2Hp 1sORcO8dcf1ldkmB6qrp/xlZVlWHha7N7bzJrwPtTWIfcpQts1Zoh+9Dt1FvPh3pCSgO JtIAmO2xNzqndW0c7c1UTB5jbv+8aek1OWtYcGb2wZVmAj6XuTzTbFwOpdCwjw5KN1gy +kGilu4lAo5DI3WStPu3LA7fqRY2aJ24sEpJyVSJo0fwuGO0qp0npi3DoE9rN8GcCmzW ObQNFdV3WeCsBiXVrUJvKBx6V5XARi/07Oy7rNOFnU+A8sCQYFKWlm1m2PLojgE2osbq grTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=WWF8SqBR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id mq17-20020a17090b381100b002886288d945si60012pjb.114.2023.12.06.08.40.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 08:40:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=desiato.20200630 header.b=WWF8SqBR; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 40B2080324F5; Wed, 6 Dec 2023 08:40:10 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1379359AbjLFQj4 (ORCPT + 99 others); Wed, 6 Dec 2023 11:39:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44690 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1379382AbjLFQjz (ORCPT ); Wed, 6 Dec 2023 11:39:55 -0500 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F481D4B; Wed, 6 Dec 2023 08:40:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=wozrE2JVwYdQea39v2odwAxayUucaERPPUek0lDwYT0=; b=WWF8SqBR/ol12mok8XrbFlc7fl YEOaC58edDRRgMxpvnnhTeDndYHyL6IFPhnbnJak0ECGFdjfnSbZsm/DgtWQHPQfyvHngJMSDpW4R H20VH7TT3uLbOsjTLdB3T0TL/Ub7uCPmjPui9606uR5ttR8eyhz68q7kmru/A7Sfk7in+lNjNHXHg wY4WkZXjOc1XsoVdvhcT0Bhn1eU6Ak5n/eGtVCgLHP8sDgsf2EtFaUyD5rtzSuXsFfL4ACpurcwBM 5sz0j5NB+ZXH/e4d9Kq8vuCtFxK7GDS9ES253aGL/2I39+VCGPkiTSRPoolnNn3I9X6+BbPu49Fm8 1Nm+8dZw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1rAuw6-005DDo-34; Wed, 06 Dec 2023 16:39:47 +0000 Received: by noisy.programming.kicks-ass.net (Postfix, from userid 1000) id B8EDC300451; Wed, 6 Dec 2023 17:39:45 +0100 (CET) Date: Wed, 6 Dec 2023 17:39:45 +0100 From: Peter Zijlstra To: Boqun Feng Cc: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Gary Guo , =?iso-8859-1?Q?Bj=F6rn?= Roy Baron , Benno Lossin , Andreas Hindborg , 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: <20231206163945.GC36423@noisy.programming.kicks-ass.net> 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: X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,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 fry.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 (fry.vger.email [0.0.0.0]); Wed, 06 Dec 2023 08:40:10 -0800 (PST) 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 = core::ffi::c_ulong; > > Maybe you can add that (in a separate patch) in kernel::time? Urgh, why are we using jiffies in 2023?