Received: by 2002:ac8:6d01:0:b0:423:7e07:f8e4 with SMTP id o1csp6902740qtt; Mon, 18 Dec 2023 09:49:18 -0800 (PST) X-Google-Smtp-Source: AGHT+IG+NwnHX6im1d7zJQu0gkA5rml29XQ3ZU4GlarQeqRtYDuFmpfwTR5sO7MdQcW42X1tj0iF X-Received: by 2002:a05:6a20:428e:b0:190:21bf:35a8 with SMTP id o14-20020a056a20428e00b0019021bf35a8mr10415478pzj.61.1702921758480; Mon, 18 Dec 2023 09:49:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702921758; cv=none; d=google.com; s=arc-20160816; b=L7cw44p684bkuABXu19E0GIur/6rNUzjSG8wn/RlYpxSvxRG7FO8Snqwjv6fv+F1kA 1rd/hCqvCaJQaul4M68WHGyfYXXBpkRrOIfXwfuBTBRQpejQ6oKLeDsYNazMXDtNurtE jMfZzMIoleToReV6CKVxJdcMafeow2Jqv44yWSax/6K5jpKIJ0OKaffwhZzgvSUyyNPi iKuyRQxNRqG5ClJF1qXTQMkRA6r6hR4vOma6OTLWU8UfTO3lDY3g/IB6gzRm26y8P3JE lRA+3A7XDlqrfOz7BA+CZePTjoJ/e8zRpMLGEJ/YNvXEORMN1RMpkOYqD1Ds2i9rmJvq 6neQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:feedback-id:references :in-reply-to:message-id:subject:cc:from:to:date:dkim-signature; bh=AMsd/DeY8JjSzCht1IKdSI8OtsIMJA5U5odDT72i3pA=; fh=CsWGf/Awp6f0EAdsmy2FNMWdLtyOQt3rLrP7qNIXUTE=; b=UrTCYzZZKh4htsTpXjx3hiQgsu0Gx8zJ00zKgemLb3OLPBu9f31A3r4efxPWwCltZP 6gyRuvJCqn4q/+ynQRR7s4MBLhQJRlEYYYtFt6YDBs3boNkBLMh8QZDn8VZg3k2O+GQP zuRarGWHO0pkwrbZCPMh+ldeTqhVlARGSlcKyh78MmKnKr8W9dQRMPc1JZZkVtpCTtHA IhojZnFFkQprgmkB3AWOkNTgJWMZORZUjvkFrvpzbJSAkNrJD8EZZH4oJLlUsZI+tS84 KK+Kcqbr2Ea6bunOEjR5MAmLFfm5lNxu8a/d3teGGSxZ0P+r+LiKlbZO1oufJZc0L1X1 P/Ag== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=QxEwqZXa; spf=pass (google.com: domain of linux-kernel+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id y9-20020a63e249000000b005c1b2d93e52si18392219pgj.368.2023.12.18.09.49.18 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 09:49:18 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@proton.me header.s=protonmail header.b=QxEwqZXa; spf=pass (google.com: domain of linux-kernel+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-4207-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=proton.me 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 C82EC281A36 for ; Mon, 18 Dec 2023 17:49:14 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 5C04072068; Mon, 18 Dec 2023 17:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=proton.me header.i=@proton.me header.b="QxEwqZXa" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-40134.protonmail.ch (mail-40134.protonmail.ch [185.70.40.134]) (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 B2B265D742 for ; Mon, 18 Dec 2023 17:43:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=proton.me Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=proton.me DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=proton.me; s=protonmail; t=1702921420; x=1703180620; bh=AMsd/DeY8JjSzCht1IKdSI8OtsIMJA5U5odDT72i3pA=; h=Date:To:From:Cc:Subject:Message-ID:In-Reply-To:References: Feedback-ID:From:To:Cc:Date:Subject:Reply-To:Feedback-ID: Message-ID:BIMI-Selector; b=QxEwqZXa0tmDYud7wF9bUqEciSqWNsCKG5H4jkqMK2AIbbEZT0NpnaSYr0dFDsivK UVp1IDbDS+3+e1BMrU8i3Bx6CBZUUd3DVv3/SnHOKK4hQ+kVw5jvp4wzRYNG1vWRBE m2rC1ZvlVmEC7pvRECnsADhgKAV7bQJfKfLCwIiHRM98/lzfPelI6lEDpMcFA3GBaz 3D5UkTLo/3OJmOcFiogUTjZiHkRrAtDFwKffyA9TxnX48NTOtd//wz/S8wkYUMRp2/ ayroAPvjYgceiKxN8YHovvXuyQdz4vIjN+NgcjCB7iYQIPiJ85pRfmTi4pWm9shBkR R0qxYDGb/OzrA== Date: Mon, 18 Dec 2023 17:43:32 +0000 To: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?utf-8?Q?Bj=C3=B6rn_Roy_Baron?= , Andreas Hindborg , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Tiago Lam , Thomas Gleixner From: Benno Lossin Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 2/4] rust: time: add msecs to jiffies conversion Message-ID: <1ee0ed2f-fc1f-4fad-9faf-8cc4e8b47819@proton.me> In-Reply-To: <20231216-rb-new-condvar-methods-v2-2-b05ab61e6d5b@google.com> References: <20231216-rb-new-condvar-methods-v2-0-b05ab61e6d5b@google.com> <20231216-rb-new-condvar-methods-v2-2-b05ab61e6d5b@google.com> Feedback-ID: 71780778:user:proton 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-Transfer-Encoding: quoted-printable On 12/16/23 16:31, Alice Ryhl wrote: > Defines type aliases and conversions for msecs and jiffies. >=20 > This is used by Rust Binder for process freezing. There, we want to > sleep until the freeze operation completes, but we want to be able to > abort the process freezing if it doesn't complete within some timeout. > The freeze timeout is supplied in msecs. >=20 > Note that we need to convert to jiffies in Binder. It is not enough to > introduce a variant of `CondVar::wait_timeout` that takes the timeout in > msecs because we need to be able to restart the sleep with the remaining > sleep duration if it is interrupted, and if the API takes msecs rather > than jiffies, then that would require a conversion roundtrip jiffies-> > msecs->jiffies that is best avoided. >=20 > Suggested-by: Boqun Feng > Signed-off-by: Alice Ryhl Reviewed-by: Benno Lossin --=20 Cheers, Benno