Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp476588iob; Thu, 28 Apr 2022 06:38:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzMjZb9vLoU1jRiEKzXKdkhFr+zTf+v2SK8hCrmwBU/cnkjIkFe0a+YceX3/U469pf/Ztt1 X-Received: by 2002:a05:651c:b23:b0:24f:260f:6735 with SMTP id b35-20020a05651c0b2300b0024f260f6735mr6744804ljr.198.1651153123741; Thu, 28 Apr 2022 06:38:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651153123; cv=none; d=google.com; s=arc-20160816; b=suKkgJ3G+uOKfLAlcoxHTIe4zWGMuZxQoJW4zqTedVcs9vSjLchsctr4Py/1IdsB/7 3D+tnIHj6JXadlJAvfRL0Q8gdR0a57vjrboVsmPhvEzQuMsnxeVVBc0N4yCpwR37EecH jedRnmDRIByItPoHRvRnNU8hxTWQVVr2Ia5n+sM+FHEh89+shOSyGHoJ6hlljiSF7/Th fyXQk3tPIh2BJ8+QWJXkuPIiQOcR7RL9CIbn2Zmfd8K5bzGE5hoD9nABzQwKClRwO2yL Q4tZKSETZt0FoiGAVnpWnDf/XV1jUDd0fwHXDcvrfrgZ/aWqalmxVu3A++XEz8XHFJjH N+VA== 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:references:in-reply-to:subject:cc:to:dkim-signature :dkim-signature:from; bh=7RlxAeFcKDl76ZPnOksBCZRs3r20R5jQitVN8scKDEU=; b=hln6n0Q/Y5bXm/k3qRq9uv9aO530Fq0XEgR38cGKYXZ2yAEhicaT/84IQVRsjAGS4n WQCF6K/ifnXqEvWbtg6oNt3ECHM+EP0Hkh52Qjwzk93UyeppY0DivvdrPjZkQ5E+2PK3 vWjL4kab4QjqYw43SiAyZfsI9FiPXfNp9sOTNpOge7prx/2l0ysi6bUAi3T9byP99qgf 6I+j6o2za5vWqWiWzEozqm5BeJolyJu3MAKk0tc+R+qHlZWggSx717viQuTdMawEzttZ LSnWGgLHRjwaUqLpJnFJDkHMoYxrr98WX40hpnbPJNVQEN5ZqNDENG1YL6HQ3TEZw5j6 B4NA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=hMTA9mvs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k16-20020a0565123d9000b004723ff5f1bdsi546596lfv.534.2022.04.28.06.38.15; Thu, 28 Apr 2022 06:38:43 -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=hMTA9mvs; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e; 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 S241572AbiD1HuX (ORCPT + 99 others); Thu, 28 Apr 2022 03:50:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49786 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231452AbiD1HuW (ORCPT ); Thu, 28 Apr 2022 03:50:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1C1C752E75 for ; Thu, 28 Apr 2022 00:47:08 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651132026; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7RlxAeFcKDl76ZPnOksBCZRs3r20R5jQitVN8scKDEU=; b=hMTA9mvsIiyk1Ca/XlyX8AeY2QC/cmtn/usvFpT5/Djp2goDLAtZlPBFoaafnhmo+gsWV0 gAA2qJKgj+qZimhPbfNxUOJs8iWWDeCzkvBoaIfs+zro0Y4fF3SFLYMDiDyTnwHWPaNLrV AvIgvITEN7NkdG0z5l0R0y/yrgHAIpqud/B7JWkaLB3YzmVAP5S2xlFEiZXd4LEppAzy5D 2Ny5t1DIzzUI8uhvA9ItgQ7p+p8cGwWHA3kN21Q4/QhuluA/7C2nf0d/exdQ4NzXXUN2/P G82lHLTpRGIfCBH3yYGX6aXYEfph6CUEJScfB+DN2eklX7Qqflvm/qjIIKs2ZA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651132026; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=7RlxAeFcKDl76ZPnOksBCZRs3r20R5jQitVN8scKDEU=; b=LpsodpvZXHe8SZw4Uj003NnlKa01r3Z9hXv2mXM1y2TK3CC6Cqf9uZRqvWw5y9i1ksLcSK b1pb9Zss/p9Q0UBg== To: Prakash Sangappa Cc: "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "peterz@infradead.org" Subject: Re: [PATCH] ipc: Update semtimedop() to use hrtimer In-Reply-To: References: <1650333099-27214-1-git-send-email-prakash.sangappa@oracle.com> <87k0baw59j.ffs@tglx> Date: Thu, 28 Apr 2022 09:47:06 +0200 Message-ID: <878rrpwsxx.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable 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 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 On Wed, Apr 27 2022 at 23:42, Prakash Sangappa wrote: >> On Apr 27, 2022, at 3:06 PM, Thomas Gleixner wrote: >> Converting to ktime first makes this cheaper: >>=20 >> expires =3D ktime_get() + timespec64_to_ns(timeout); > > Since user provided timespec is added to current time, shouldn=E2=80=99t = it check for overflow? > > So, perhaps=20 > > expires =3D ktime_add_safe(ktime_get(), timespec64_to_ns(timeout)); Of course. This was just for illustration and I assumed you figure it out, which you did. :) Thanks, tglx