From patchwork Tue May 2 10:05:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Geert Uytterhoeven X-Patchwork-Id: 89304 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp502073vqo; Tue, 2 May 2023 03:32:17 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6NplAuYcTLNx6jYCmqpRsWLXkP7Y4Uq8inQfaEatJgjhmM8YreODiIkROTtwuO41xt9NG9 X-Received: by 2002:a05:6a00:170b:b0:632:c041:270c with SMTP id h11-20020a056a00170b00b00632c041270cmr25128677pfc.28.1683023537242; Tue, 02 May 2023 03:32:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683023537; cv=none; d=google.com; s=arc-20160816; b=UWQS+CDQljuJ717fa9bzRT0tmoH6VzSH+OXzzGAZOAP82H8EGENQAvJHZQZKGJnTWZ 3/QH/6oV9MzJ4MelXinV2iJaOyi2Z4zqPGUnEPMHzewAHb0HIBvqQB1dch9OtfXCM2zU 6c6rhYXrzD0JJ1/AxgrTmr6mBeo2b43TsQxzaGBWnuxgqAdraaogrjjis3sczcaKhvsD eK2jtSJu0HZwjGyuOVflss6hmFnZ7CndS9w/ubl2FHdVT294XTqrTcINwGw9QiQMpN4p ybqiQJ/CoDan1jX3ntNId1YNZNZt4cRBVGotQKVz51zdKbLf08TDmeXQ1SxMpQbkM7Hp QlQw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=WP45UZLouH7P7XcytGuJeWboTruXHCfJHtUPyso3Pdk=; b=SP6mZWvtEBrsHHrq97qtAlZwLJLn1dt/+/XM/VMfQC4jsszHd9h6IePVYqdxRH2+hz SeYi7OnR+WopMI3gJcQBBHxJoadBFFkZimlxijDCrxlu5lVcZNLjKPbOUa8nfxOb1QDA 56GycNl5NogJsYakiu+iKOnp8/G41UVsnsVsp35lHlhSY9lQg5zWBGSB9aO66s4wGQ9I gMIZM1dQ1BRKS2kmwU9LlzzdaQK9kjPDTNAHDQSendNUyr32DBoVu5td2dJPUUaXVhbf V3qQEPO31weGPIaL65KBfNJkxKQ4DLtzSO3yjeTi73uVX+CsbZqN6Lk4eRQYarW5V5xY yiZw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id r187-20020a632bc4000000b0052868a865d8si18428466pgr.430.2023.05.02.03.32.04; Tue, 02 May 2023 03:32:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233610AbjEBKFX (ORCPT + 99 others); Tue, 2 May 2023 06:05:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231608AbjEBKFT (ORCPT ); Tue, 2 May 2023 06:05:19 -0400 Received: from xavier.telenet-ops.be (xavier.telenet-ops.be [IPv6:2a02:1800:120:4::f00:14]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 398404EC1 for ; Tue, 2 May 2023 03:05:16 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed30:f07a:92a2:297:162b]) by xavier.telenet-ops.be with bizsmtp id rm5C2900X5FQxRj01m5CsF; Tue, 02 May 2023 12:05:13 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtp (Exim 4.95) (envelope-from ) id 1ptmse-000ykg-9i; Tue, 02 May 2023 12:05:12 +0200 Received: from geert by rox.of.borg with local (Exim 4.95) (envelope-from ) id 1ptmsi-00AtFX-7Q; Tue, 02 May 2023 12:05:12 +0200 From: Geert Uytterhoeven To: John Stultz , Thomas Gleixner , Jonathan Corbet Cc: Randy Dunlap , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH] Documentation: timers: hrtimers: Make hybrid union historical Date: Tue, 2 May 2023 12:05:10 +0200 Message-Id: <59250a3d1c2c827b5c1833169a6e652ca6a784e6.1683021785.git.geert+renesas@glider.be> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_LOW,SPF_HELO_NONE,SPF_NONE, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1764778088945476770?= X-GMAIL-MSGID: =?utf-8?q?1764778088945476770?= Non-scalar time was removed from the ktime hybrid union in v3.17, and the union itself followed suit in v4.10. Make it clear that ktime_t is always a 64bit scalar type, to avoid confusing the casual reader. While at it, fix a spelling mistake. Fixes: 24e4a8c3e8868874 ("ktime: Kill non-scalar ktime_t implementation for 2038") Fixes: 2456e855354415bf ("ktime: Get rid of the union") Signed-off-by: Geert Uytterhoeven Reviewed-by: Thomas Gleixner --- Randy did several fruitless attempts to fix the typo before. --- Documentation/timers/hrtimers.rst | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/Documentation/timers/hrtimers.rst b/Documentation/timers/hrtimers.rst index 7ac448908d1ffd97..f88ff8bae89c8acf 100644 --- a/Documentation/timers/hrtimers.rst +++ b/Documentation/timers/hrtimers.rst @@ -123,17 +123,12 @@ equivalent to timer_delete() and timer_delete_sync()] - so there's no direct potential for code sharing either. Basic data types: every time value, absolute or relative, is in a -special nanosecond-resolution type: ktime_t. The kernel-internal -representation of ktime_t values and operations is implemented via -macros and inline functions, and can be switched between a "hybrid -union" type and a plain "scalar" 64bit nanoseconds representation (at -compile time). The hybrid union type optimizes time conversions on 32bit -CPUs. This build-time-selectable ktime_t storage format was implemented -to avoid the performance impact of 64-bit multiplications and divisions -on 32bit CPUs. Such operations are frequently necessary to convert -between the storage formats provided by kernel and userspace interfaces -and the internal time format. (See include/linux/ktime.h for further -details.) +special nanosecond-resolution 64bit type: ktime_t. +(Originally, the kernel-internal representation of ktime_t values and +operations was implemented via macros and inline functions, and could be +switched between a "hybrid union" type and a plain "scalar" 64bit +nanoseconds representation (at compile time). This was abandoned in the +context of the Y2038 work.) hrtimers - rounding of timer values ----------------------------------- @@ -148,7 +143,7 @@ a given clock has - be it low-res, high-res, or artificially-low-res. hrtimers - testing and verification ----------------------------------- -We used the high-resolution clock subsystem ontop of hrtimers to verify +We used the high-resolution clock subsystem on top of hrtimers to verify the hrtimer implementation details in praxis, and we also ran the posix timer tests in order to ensure specification compliance. We also ran tests on low-resolution clocks.