lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu, 4 Dec 2014 09:42:57 -0800
From:	John Stultz <john.stultz@...aro.org>
To:	John Stultz <john.stultz@...aro.org>,
	Chris Wilson <chris@...is-wilson.co.uk>,
	Intel Graphics Development <intel-gfx@...ts.freedesktop.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Daniel Vetter <daniel.vetter@...el.com>,
	Thomas Gleixner <tglx@...utronix.de>
Cc:	Daniel Vetter <daniel.vetter@...ll.ch>
Subject: Re: [Intel-gfx] [PATCH] drm/i915: compute wait_ioctl timeout correctly

On Thu, Dec 4, 2014 at 2:42 AM, Daniel Vetter <daniel@...ll.ch> wrote:
> On Wed, Dec 03, 2014 at 11:07:08AM -0800, John Stultz wrote:
>> On Wed, Dec 3, 2014 at 6:30 AM, Daniel Vetter <daniel@...ll.ch> wrote:
>> > On Tue, Dec 02, 2014 at 08:54:13AM -0800, John Stultz wrote:
>> >> On Tue, Dec 2, 2014 at 8:35 AM, Chris Wilson <chris@...is-wilson.co.uk> wrote:
>> >> > On Tue, Dec 02, 2014 at 04:36:22PM +0100, Daniel Vetter wrote:
>> >> >> +static inline unsigned long nsecs_to_jiffies_timeout(const u64 m)
>> >> >> +{
>> >> >> +     u64 usecs = div_u64(m + 999, 1000);
>> >> >> +     unsigned long j = usecs_to_jiffies(usecs);
>> >> >> +
>> >> >> +     return min_t(unsigned long, MAX_JIFFY_OFFSET, j + 1);
>> >> >
>> >> > Or more concisely and review friendly:
>> >> >
>> >> > static inline unsigned long nsecs_to_jiffies_timeout(const u64 n)
>> >> > {
>> >> >         return min_t(u64, MAX_JIFFY_OFFSET, nsecs_to_jiffies64(n) + 1);
>> >> > }
>> >>
>> >> Yea. This looks much nicer. Seems generic enough it might be better
>> >> added next to nsec_to_jiffies64() in kernel/time/time.c or jiffies.h
>> >> rather then in a driver header.
>> >
>> > Ok, that needs an EXPORT_SYMBOL for nsecs_to_jiffies64. Can I count your
>> > "Yea" above as an ack for adding that and pulling it in through
>> > drm-intel.git?
>>
>> Do you need an EXPORT_SYMBOL if you add the _timeout version next to
>> nsecs_to_jiffies64 in time.c?
>
> I wouldn't but the patch from Imre to add all the _timeout was killed with
> a few bikesheds so really not volunteering. And just moving this single
> one doesn't make a lot of sense imo. Also the next patch I'll do is just
> add the +1 that we lost to the code and call it a day, really ;-)
>

Sigh. So you're going to make me write a separate patch that moves it over?

I know you'll probably say this is bikeshedding, but the reason why
avoiding the EXPORT_SYMBOL on nsec_to_jiffies would be good is because
nsec_to_jiffies explicitly states in the comments that its not for any
use but the scheduler.

But still, I do see our change broke you here, so I'm not going to object.

thanks
-john
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ