From patchwork Tue Apr 25 18:49:14 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Gleixner X-Patchwork-Id: 87516 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:b0ea:0:b0:3b6:4342:cba0 with SMTP id b10csp3605256vqo; Tue, 25 Apr 2023 11:51:19 -0700 (PDT) X-Google-Smtp-Source: AKy350asLrTZ5gnq1rKkwv4JU491aTjaE4KRpVlmTO4MwOwP72f2N+6/MnlP8SwW3GWk13GcdGsZ X-Received: by 2002:a17:902:c745:b0:1a0:48c6:3b43 with SMTP id q5-20020a170902c74500b001a048c63b43mr18292608plq.37.1682448678768; Tue, 25 Apr 2023 11:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682448678; cv=none; d=google.com; s=arc-20160816; b=xtl8ojH/Zy4Pxnq4PotT8BAsRF3wgDRIGMVQSwYYkps5ohNpJEKHwxVYPNYM7mOryN +j/RlqmH6zKfcrhYR8tn5iakphmCwOGUmMOckkFlpUC0Iel1j+cdaD1WdlPonK4f4KrX stNp735nCk1b/YBq7g/xUBkQPyN/kkCJ5QELj4qsVHqtWcAnmqnk5u/iJxvHlwPZdn3S u6OuGXGwBIxfIFExLlWX9gMqSp3vmLT/PBazNoX7sVcMmQZKUwJAiryUzhMJvBjEWrt7 jMPBRiT9PV284CZrgLFfaICtV5eIVHNbjR0pYSIqVpjoLOLKiUgfV0BsQ2eF1AZ93Lsr 7Lgg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:date:mime-version:references:subject:cc:to:from :dkim-signature:dkim-signature:message-id; bh=Zmf4oijJ4qkmpNPO93IBkLhAnn4mWoGj5cJI22MX9Lg=; b=HUsBRu8atAaepuze8JtKL5sNtc5av3+vWkWiklCoJ8X8j6i86gYXAcSQtuGeWN1vKX px7dpnXAfgrqreQ6nbu/odXbsLoEemU0yPecPDZp5VWWEfk6yCxGDchxIz2f1sE63Azi MUhMt3VeJwhB2HAZoenqW2JGdgI+Ks14PyQRbBcSOkey0LVerpKdBIWEhdc+o9duhH9q H+l/af4ZQ3yNEdcz7u+aJwnrfi0brgfPdynAlCO/SPkoHgQbKxOUuxmyDwncCednzWBi clKA/6ViTzJ0WFQg7uoi+FH+ESelp4xhj9zEd6Aa443+IeQ990pLNcDGWT1adi2VFFhK dJGQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uqHMREOy; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=KG0gt4Qf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id j7-20020a170903028700b001a649370ff3si14619249plr.401.2023.04.25.11.51.04; Tue, 25 Apr 2023 11:51:18 -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; dkim=pass header.i=@linutronix.de header.s=2020 header.b=uqHMREOy; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b=KG0gt4Qf; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234865AbjDYSty (ORCPT + 99 others); Tue, 25 Apr 2023 14:49:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234804AbjDYSt2 (ORCPT ); Tue, 25 Apr 2023 14:49:28 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8AC2717DEB for ; Tue, 25 Apr 2023 11:49:16 -0700 (PDT) Message-ID: <20230425183313.462051641@linutronix.de> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1682448555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=Zmf4oijJ4qkmpNPO93IBkLhAnn4mWoGj5cJI22MX9Lg=; b=uqHMREOyx+/aWTaOduKAvl9umoYnudFh45Ah+mMG2jN6FF6M2YBU7Fe9k/lHJn0kRrqCjm iB5qiNoegoQAEp8Vaxaj4m6dsiCu1lJEEflHT1kKQ+rUqsWRm8aGq57w6f64CDnNgMkIuC hrCI08xetzruHArKygkP1BJE5/fC7aEVrfotrljAX0g2Hi3yzH7CBB46qIalJAKfYmapHw mA6ta4eMTmuwRNzWbUUjhcN4Znkc3eZCib1/I9Zok+N2qMAhaa9Vgofaxh7xu2mzSl1Z2Z 1pXarTS4Lsz+NCuLF+OKosRyzCQtBavUFIA/bU0RT4L72u28rJj+sJVwu5QCqQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1682448555; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: references:references; bh=Zmf4oijJ4qkmpNPO93IBkLhAnn4mWoGj5cJI22MX9Lg=; b=KG0gt4QfS2XTE0+++hT+G3wWq05Wv2hCSSmhElz37nqd1tnCsNKiXNvir6eLU5cbJkCr2u PJ2UBSKwxyEuCkBg== From: Thomas Gleixner To: LKML Cc: Frederic Weisbecker , Anna-Maria Behnsen , Peter Zijlstra , Michael Kerrisk , Sebastian Siewior , syzbot+5c54bd3eb218bb595aa9@syzkaller.appspotmail.com, Dmitry Vyukov Subject: [patch 12/20] posix-timers: Document sys_clock_getoverrun() References: <20230425181827.219128101@linutronix.de> MIME-Version: 1.0 Date: Tue, 25 Apr 2023 20:49:14 +0200 (CEST) X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED 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?1764175305624188796?= X-GMAIL-MSGID: =?utf-8?q?1764175305624188796?= Document the syscall in detail and with coherent sentences. Signed-off-by: Thomas Gleixner Cc: Michael Kerrisk Reviewed-by: Frederic Weisbecker --- kernel/time/posix-timers.c | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) --- a/kernel/time/posix-timers.c +++ b/kernel/time/posix-timers.c @@ -782,14 +782,23 @@ SYSCALL_DEFINE2(timer_gettime32, timer_t #endif -/* - * Get the number of overruns of a POSIX.1b interval timer. This is to - * be the overrun of the timer last delivered. At the same time we are - * accumulating overruns on the next timer. The overrun is frozen when - * the signal is delivered, either at the notify time (if the info block - * is not queued) or at the actual delivery time (as we are informed by - * the call back to posixtimer_rearm(). So all we need to do is - * to pick up the frozen overrun. +/** + * sys_timer_getoverrun - Get the number of overruns of a POSIX.1b interval timer + * @timer_id: The timer ID which identifies the timer + * + * The "overrun count" of a timer is one plus the number of expiration + * intervals which have elapsed between the first expiry, which queues the + * signal and the actual signal delivery. On signal delivery the "overrun + * count" is calculated and cached, so it can be returned directly here. + * + * As this is relative to the last queued signal the returned overrun count + * is meaningless outside of the signal delivery path and even there it + * does not accurately reflect the current state when user space evaluates + * it. + * + * Returns: + * -EINVAL @timer_id is invalid + * 1..INT_MAX The number of overruns related to the last delivered signal */ SYSCALL_DEFINE1(timer_getoverrun, timer_t, timer_id) {