From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750970AbcBFCPu (ORCPT ); Fri, 5 Feb 2016 21:15:50 -0500 Received: from mga01.intel.com ([192.55.52.88]:6393 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750757AbcBFCPt (ORCPT ); Fri, 5 Feb 2016 21:15:49 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.22,403,1449561600"; d="scan'208";a="878225345" Subject: Re: [PATCH] prctl: Add PR_SET_TIMERSLACK_PID for setting timer slack of an arbitrary thread. To: John Stultz , Andrew Morton References: <1454695723-4393-1-git-send-email-john.stultz@linaro.org> <20160205121353.63d65c6b33a153bd9f863d8b@linux-foundation.org> <20160205123230.bd8bd228a0f3798a281266eb@linux-foundation.org> <20160205125008.15ccbdbe82afc3521a8ee381@linux-foundation.org> Cc: Kees Cook , lkml , Ruchi Kandoi , Thomas Gleixner , Oren Laadan , Rom Lemarchand , Android Kernel Team From: Arjan van de Ven Message-ID: <56B55753.6080606@linux.intel.com> Date: Fri, 5 Feb 2016 18:15:47 -0800 User-Agent: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.5.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2/5/2016 4:51 PM, John Stultz wrote: > On Fri, Feb 5, 2016 at 2:35 PM, John Stultz wrote: >> On Fri, Feb 5, 2016 at 12:50 PM, Andrew Morton >> wrote: >>> On Fri, 5 Feb 2016 12:44:04 -0800 Kees Cook wrote: >>>> Could this be exposed as a writable /proc entry instead? Like the oom_* stuff? >>> >>> /proc//timer_slack_ns, guarded by ptrace_may_access(), documented >>> under Documentation/? Yup, that would work. It's there for all >>> architectures from day one and there is precedent. It's not as nice, >>> but /proc nasties will always be with us. >> >> Ok. I'll start working on that. > > Arjan/Thomas: One curious thing I noticed here while writing some > documentation. The timer_slack_ns value in the task struct is a > unsigned long. > > So this means PR_SET_TIMERSLACK limits the maximum slack on 32 bit > machines to ~4 seconds. Where on 64bit machines it can be quite a bit > longer (unreasonably long, really :). originally when we created timerslack, 4 seconds was an eternity and good enough for everyone by a mile... (assumption was practical upper limit being in the 15 msec range) and most of the RT guys would only tolerate a little bit of it is there any real/practial use of going longer than 4 seconds? if there is then yeah fixing it makes sense. if it's just theoretical... shrug... 32 bit systems have a bunch of other limits/differences a well.