Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp1684818iob; Fri, 29 Apr 2022 10:25:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyuClS4TYySXS3l3Nd+BPTF8iqVRqCaciVQ2gIKArwEH8NljlX1bioFzAlxVm+ybUxKRW9s X-Received: by 2002:a17:902:6b0b:b0:158:f889:edd9 with SMTP id o11-20020a1709026b0b00b00158f889edd9mr234516plk.122.1651253104841; Fri, 29 Apr 2022 10:25:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651253104; cv=none; d=google.com; s=arc-20160816; b=JQQSHbZ1LJuFvpYPf10ho50AgsheGVWRvMi6U8/ucZNex73ovwqg4jq3Q67Ws5YZ6c cZPQskg50b7oDvqMazTXbk2uBpvb80xIi7QDFbwWDRlPO2xe1Nc7IopBg3Qn8FZy8BbY vXWFlhaLNFu7UUjtdgCbgvo2RktB87T/q7YYt13sSb0awnivjV/8h82so3ZsJ9jC+RtA EDxUavjAHaQJoMHa0m4CqM0tF1rLmDrxL3jE1HfygVQtbpFUIS4aRYXTrvgOw3hzpX+b JZx4WVz1O+2kEJxsamykuKuWgPh96t+SmV10aLZtj3iAHkiK1MEDcplMTyWDHfadFd6A V61g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=tXbnnfydFtroMbNf34p+LMQVaGaqhjbOTNCg6WDSgTo=; b=CyhCpABRAnS1BLSNsdfyQNM66MLbFACcn+eOWMz68qbccTknh1tcIazJjC5Ev5jHTw TjTrjL1ZyNYAF4iDvXbDdKE9jxyuOFZgmGKkiPwiYbZbqNOub3RI14ynllkQPRV/i5JI dse7UU8Vr33XBsB3eYYYNBst00glHg+3FpjdZschBXiNGWowUyAUQaCKrTwi3ld9jXT2 Wv5Cq/ju//hyZfyFdrgQ4ZkVYT4Hs1s1vqCq/zI+5+j84fw9++XzgZQYwFEBopR4pkBB bqwWc3gpFOWxTJpPuG9pevoQZe3cpvlPrzdfLs7KoACTFiflku5YGNHyEE3Vp6gCG8fx wSCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=Jr8aBFOk; dkim=neutral (no key) header.i=@linutronix.de header.b=aIy4s3fe; 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 u81-20020a627954000000b0050d6ea9b033si7385475pfc.225.2022.04.29.10.24.48; Fri, 29 Apr 2022 10:25:04 -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=Jr8aBFOk; dkim=neutral (no key) header.i=@linutronix.de header.b=aIy4s3fe; 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 S1352975AbiD1WoX (ORCPT + 99 others); Thu, 28 Apr 2022 18:44:23 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36922 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352944AbiD1WoW (ORCPT ); Thu, 28 Apr 2022 18:44:22 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 340BB8C7FD for ; Thu, 28 Apr 2022 15:41:05 -0700 (PDT) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1651185663; 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: in-reply-to:in-reply-to:references:references; bh=tXbnnfydFtroMbNf34p+LMQVaGaqhjbOTNCg6WDSgTo=; b=Jr8aBFOkezzGo3wUe/YArrBxSfTDbhAZxqyJN+hdWtYCak3cYpTU/1M17reSak2Ii7f76i HTdOVqMYPmCjGsSfS7jm7jG+sbxVLsWxR3uAFYB1+30WrdARXO1LwMbhuRWNnLDm2gzfYn rlGbZUVYwM1nJ0ZEWysUXhCQXoSU1qvPmtP199G9N2Fakf4d/qeuA/Qcs/m2BMjjmf/Yfx sL+rHe4dFQAUGqfAHZNwaSIKrtf8r+iKVjguaQjJ80D38oLtfXCFJgP1kpOqCNkJf46DHv YkoUyL2rcKEMHvwMgaI4+S3h+jw+DGFpyJGSQKlIj1yUI+77UDecXU+ayJVcBw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1651185663; 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: in-reply-to:in-reply-to:references:references; bh=tXbnnfydFtroMbNf34p+LMQVaGaqhjbOTNCg6WDSgTo=; b=aIy4s3felbXbltF+ChdPl8SDAn2dEbGGbdXE5jlw5rSqbiPf4QoBcev3Wx3aboiTWNA16V cqbPl/EkoVRon/DA== To: Prakash Sangappa Cc: Davidlohr Bueso , "linux-kernel@vger.kernel.org" , "akpm@linux-foundation.org" , "peterz@infradead.org" , "manfred@colorfullife.com" Subject: Re: [PATCH v3] ipc: Update semtimedop() to use hrtimer In-Reply-To: <5FEE7AB6-7560-4998-A7A3-B60A4B32E1DE@oracle.com> References: <1651178767-447-1-git-send-email-prakash.sangappa@oracle.com> <20220428205001.hiuzwpn5emxtrh4s@offworld> <87zgk4ooi6.ffs@tglx> <5FEE7AB6-7560-4998-A7A3-B60A4B32E1DE@oracle.com> Date: Fri, 29 Apr 2022 00:41:03 +0200 Message-ID: <87tuacomps.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain 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 Thu, Apr 28 2022 at 22:23, Prakash Sangappa wrote: >> On Apr 28, 2022, at 3:02 PM, Thomas Gleixner wrote: >> On Thu, Apr 28 2022 at 13:50, Davidlohr Bueso wrote: >>> On Thu, 28 Apr 2022, Prakash Sangappa wrote: >>>> - if (timeout) >>>> - jiffies_left = schedule_timeout(jiffies_left); >>>> - else >>>> - schedule(); >>>> + timed_out = !schedule_hrtimeout_range(exp, >>>> + current->timer_slack_ns, HRTIMER_MODE_ABS); >>> >>> I'm wondering if the slack parameter instead of passing the timer_slack_ns >>> value immediately, we should do a rt_task() check and pass zero if so. >> >> We should have a wrapper function which takes care of that instead of >> having checks all over the place. > > Ok it can be an inline function in sched.h which returns appropriate > slack time. Use that in futex_wait() and sigtimedwait() also in addition to > semtimedop() & mqueue codepath? No. What I meant is a function which handles this internally, not an inline function which has to be invoked on various call sites. > Should that be a separate patch? Definitely. That's an orthogonal problem. Thanks, tglx