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]
Message-ID: <4A033EAB.8010700@garzik.org>
Date:	Thu, 07 May 2009 16:03:55 -0400
From:	Jeff Garzik <jeff@...zik.org>
To:	Alan Cox <alan@...rguk.ukuu.org.uk>
CC:	"H. Peter Anvin" <hpa@...or.com>, Christoph Lameter <cl@...ux.com>,
	Alok Kataria <akataria@...are.com>,
	Ingo Molnar <mingo@...e.hu>,
	Thomas Gleixner <tglx@...utronix.de>,
	the arch/x86 maintainers <x86@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] x86: Reduce the default HZ value

Alan Cox wrote:
> jiffies is *really* expensive...

Certainly.


> However you don't need HZ

Thus I said "libata would be happy to use milliseconds rather than 
jiffies; the unit does not matter."

All crucial constants and variables are already in useful units, and we 
are forced to convert them to jiffies, and test against 'jiffies' global 
var, because the API does not provide other reasonable alternatives.

Pretty much all users of time -- including users of timers -- are forced 
to convert from a useful unit of time to jiffies, because that's what 
the API requires.


> and you can do that really easily by making your timer switch a single
> value to the correct state for the time and in your loops just checking
> 
> 	while ( ap->reset_state == WIBBLING_RANDOMLY) {
> 		wobble = readl(ap->ioaddr.wibble);
> 		mdelay(1);
> 		if (wobble & WIBBLED) {
> 			...
> 		}
> 	}

And when the deadline changes, you need mod_timer rather than a simple 
non-global-variable increment.

And when you consider all the bits of state, spread across not only 
libata core __but drivers as well__, a timer-based solution gets even 
uglier.

But you're still missing the point.  jiffies are just a unit, a unit 
forced upon us by all the time-based kernel API functions that take 
jiffies rather than usec or msec.

I would rather fix the API, than investigate hacky solutions that 
complicate the code even more.

	Jeff



--
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