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
| ||
|
Date: Thu, 12 Mar 2009 14:05:05 -0500 From: Timur Tabi <timur@...escale.com> To: Peter Zijlstra <peterz@...radead.org> Cc: Grant Likely <grant.likely@...retlab.ca>, Benjamin Herrenschmidt <benh@...nel.crashing.org>, Alan Cox <alan@...rguk.ukuu.org.uk>, linux-kernel@...r.kernel.org, rdreier@...co.com, jirislaby@...il.com, will.newton@...il.com, hancockrwd@...il.com, jeremy@...p.org Subject: Re: [PATCH v4] introduce macro spin_event_timeout() On Thu, Mar 12, 2009 at 11:50 AM, Peter Zijlstra <peterz@...radead.org> wrote: > sched_clock() does that, but: > - it falls back to jiffies on poor platforms I think it's ok to fall back to jiffies where necessary, but these two functions are too heavy-weight for my tastes. > But something that seems to always work, is simply count loops and rely > on whatever delay is in the specified loop. > > #define spin_until_timeout(condition, timeout, rc) \ > for (unsigned long __timeout = 0; \ > !(rc = (condition)) && __timeout < (timeout); \ > __timeout++) But that's the thing - I don't want a required delay inside the loop. I guess I'm going to have to think about this for a while. I'd like to see something like cycles_per_usec() as a companion function to get_cycles(). -- Timur Tabi Linux kernel developer at Freescale -- 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