Received: by 2002:a05:7412:b112:b0:f9:3106:f1c0 with SMTP id az18csp119737rdb; Mon, 18 Dec 2023 00:33:05 -0800 (PST) X-Google-Smtp-Source: AGHT+IEGErfTqQtXz1+BNh7rJXYcIyujiAXnlXilydvXBkZO6UWdGFYL0M9fWWuD1RiKg3g/Eeik X-Received: by 2002:a17:907:e8b:b0:a23:59e0:5340 with SMTP id ho11-20020a1709070e8b00b00a2359e05340mr557058ejc.54.1702888384989; Mon, 18 Dec 2023 00:33:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702888384; cv=none; d=google.com; s=arc-20160816; b=LdKRY50Uree7xZiTLIeCWDXZI0agVwiLPIb+R7zoDdVN+VWLzREqlVs9akD7s69I/d f9UaGzBiu7mKH1gE8V2dFpvzWLRBNQzgCpoz0ZUhROMpoVrLB35UgbgtHXdAdtJ4L93+ IpLqFOal/Um4cyJp/Ml51nJ53MmpXCp/k/c8cAJ5vHTPEE7AKGQc0x9rtBWsum0hxiuR vSht/cSCME6Np8hDWmD+3b3fQOqhrvQlhMU/WCTI56gnYxvQ2DNI3MqYPNbKoO62+56A VM2Lzjxw6Qa7+lVLLyFz/yAxRJBgK/MqwmU8LANf0pB7VfzZ4jLYbl2nzSOYjxucKsZj 3xXA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=KuTpLAn0ifEofUaY2LsWGW2GH2ZKQjCbSzshhn3wDKU=; fh=UKWYSmnN/maZQksiiwOqsrhbwCK6TieG3ZyN6z3whbA=; b=cPk6bhIDU4cKMrp4aVdlOPob0yt9XgENfEYYcnZ5c28lae9WByFg7D8s5Mb9fMTL2l ipl4GJgUkUMkDsEztPJ86afzSHXCk/wfPMy9lFXsYLK2tVsY5El/Vuym9AUWfzACPs7f ZQ38JfNJOTcIj6QN22b52OQ65L3v13ie0EyNsD5QF4UnVdNUGMld+jKaSog4eWseiEef ofDrKZMMyJvJN/n9vujFTBeRue/C0F/KLpRyrifqLm3lWQjDin+ZBNSl69lEyNMLz5OV KfQX4p4gABpEGg+T/R3AoFFCsgciAjT06chT/0i0pmDZ4afvJUYgIVUVVwTc1oO9Yjeh S4PQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FYVM1k3d; spf=pass (google.com: domain of linux-kernel+bounces-3161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id e26-20020a170906249a00b00a1cabd54ceasi9331347ejb.27.2023.12.18.00.33.04 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 Dec 2023 00:33:04 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-3161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=FYVM1k3d; spf=pass (google.com: domain of linux-kernel+bounces-3161-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-3161-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.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 BBA451F22EF2 for ; Mon, 18 Dec 2023 08:33:04 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 87172125A3; Mon, 18 Dec 2023 08:32:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="FYVM1k3d" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-wr1-f41.google.com (mail-wr1-f41.google.com [209.85.221.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 39D9D11C91; Mon, 18 Dec 2023 08:32:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-3365b5d6f0eso1354091f8f.3; Mon, 18 Dec 2023 00:32:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1702888348; x=1703493148; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=KuTpLAn0ifEofUaY2LsWGW2GH2ZKQjCbSzshhn3wDKU=; b=FYVM1k3d2hJjkBfG5x7M5wn3YRQsFfGTNR1MsrpXZ564Kn3QSDJDOVtscs/EkTx+mO H1QNmvTpKHWyCuDsCF80c/cVILwr8Uer6oFoiBofrB5qYDuXGZE3QCsfPXJKl4xHr8tT 19HObt8SJ9Y8SAvqOGNEiVD1qx1NE/RpwfKytrKmExGwN2+5Dz1FljQKNTdsQaQ2KaPJ Swi0SrZvQe/tbn5I7fto1r29JWNUk6v8sVLPUGeTVJaTjWEeWqPiAII8dW1x+bwGkBhW CMHSTknY5k8pCbUIoJZOD9HIhR0oPcokRqDfBUuDo/6kAuXP/eYRx2A/B41+WQ+JUrNh uIhQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702888348; x=1703493148; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=KuTpLAn0ifEofUaY2LsWGW2GH2ZKQjCbSzshhn3wDKU=; b=g//Iln6W3kxxNcG9cMXG0+20QNP4BcJxPQC7BfVJQ+v31gHhoeMhgSVTqhW81jwgz6 ctPYBzHnq+2fFzsj3Y4IPenZaa5nkFZRwnGMQkD0fLO+XF0Gvmi+6KQIlztac9eqCKJK /PD/4gJpGO/kOsdHWkEMzYuYkKCP4IMfBD6oP+0JmlbIwrMFOE3iQhzD+7UGc+inauAi 07IpDeYtlyLIflRl4O4Y8dCjybAeyKBWyFS79UvQgpruHEEGfWv13YQbvWYnyEwqKyvJ koUbrrX7xRQoTiZR4bPjXVB/GVXJC41C9HyvqP1p4XsfpyyuSybSJCtLYH88NryQGldD /b2w== X-Gm-Message-State: AOJu0YwHiSpcQ52We8vaDZv3E6ldBEVP13Km6rZGKEUWfZzMBgIMbn7M SIwQEYW0xd1qpJnawMDddw== X-Received: by 2002:adf:e10f:0:b0:333:2e1c:9553 with SMTP id t15-20020adfe10f000000b003332e1c9553mr9291141wrz.32.1702888348338; Mon, 18 Dec 2023 00:32:28 -0800 (PST) Received: from [192.168.1.148] (224.69.114.89.rev.vodafone.pt. [89.114.69.224]) by smtp.googlemail.com with ESMTPSA id w15-20020adfec4f000000b003366cc543casm537184wrn.102.2023.12.18.00.32.26 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Dec 2023 00:32:28 -0800 (PST) Message-ID: Date: Mon, 18 Dec 2023 08:32:26 +0000 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2 2/4] rust: time: add msecs to jiffies conversion Content-Language: en-GB To: Alice Ryhl , Miguel Ojeda , Alex Gaynor , Wedson Almeida Filho , Boqun Feng , Gary Guo , =?UTF-8?Q?Bj=C3=B6rn_Roy_Baron?= , Benno Lossin , Andreas Hindborg , Peter Zijlstra , Ingo Molnar , Will Deacon , Waiman Long , Thomas Gleixner Cc: rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org References: <20231216-rb-new-condvar-methods-v2-0-b05ab61e6d5b@google.com> <20231216-rb-new-condvar-methods-v2-2-b05ab61e6d5b@google.com> From: Tiago Lam In-Reply-To: <20231216-rb-new-condvar-methods-v2-2-b05ab61e6d5b@google.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit On 16/12/2023 15:31, Alice Ryhl wrote: > Defines type aliases and conversions for msecs and jiffies. > > 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. > > 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. > > Suggested-by: Boqun Feng > Signed-off-by: Alice Ryhl Reviewed-by: Tiago Lam