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: <20090420123034.ffa17e14.akpm@linux-foundation.org>
Date:	Mon, 20 Apr 2009 12:30:34 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Steven Rostedt <rostedt@...dmis.org>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu
Subject: Re: [PATCH 3/4] tracing: fix recursive test level calculation

On Mon, 20 Apr 2009 13:38:22 -0400
Steven Rostedt <rostedt@...dmis.org> wrote:

>  static int trace_irq_level(void)
>  {
> -	return hardirq_count() + softirq_count() + in_nmi();
> +	return (hardirq_count() >> HARDIRQ_SHIFT) +
> +		(softirq_count() >> + SOFTIRQ_SHIFT) +
> +		!!in_nmi();
>  }

hah, tricked you!

IMO hardirq_count() and softirq_count() should do the shift internally.
They're terribly misleading at present.
--
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