lkml.org 
[lkml]   [2008]   [Mar]   [28]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
/
FromNick Piggin <>
SubjectRe: [PATCH v2 -mm] likeliness accounting change and cleanup
DateFri, 28 Mar 2008 16:09:32 +1100
On Friday 28 March 2008 07:25, Roel Kluin wrote:
> Daniel Walker wrote:
> > It's looks good to me .. You'll have to send it to Andrew to get it
> > included tho ..
> >
> > Daniel
>
> Store __builtin_return_address (caller) rather than __func__ in likeliness
> struct. 'line' and 'type' are combined in 'label'
>
> +/- now denotes whether expectation fails in less than 5% of the tests -
> rather than whether more unexpected than expected were encountered. The
> function at the displayed filename & line and the caller are not
> necessarily the same. A few more Likely Profiling Results changes were
> made.
>
> struct seq_operations becomes static, unsigned ints true and false
> (shadowed) are replaced by pos and neg.
>
> Signed-off-by: Roel Kluin <12o3l@tiscali.nl>

Patch looks fine to me.

Acked-by: Nick Piggin <npiggin@suse.de>

>  		if (!test_and_set_bit(0, &likely_lock)) {
> -			if (likeliness->type & LP_UNSEEN) {
> -				likeliness->type &= (~LP_UNSEEN);
> +			if (likeliness->label & LP_UNSEEN) {
> +				likeliness->label &= (~LP_UNSEEN);
>  				likeliness->next = likeliness_head;
>  				likeliness_head = likeliness;
> +				likeliness->caller = (unsigned long)
> +						__builtin_return_address(0);
>  			}
>  			smp_mb__before_clear_bit();
>  			clear_bit(0, &likely_lock);

While you're cleaning up this code, any chance you'd like to
change this to test_and_set_bit_lock() / clear_bit_unlock() ?
(in a 2nd patch).

The current usage is not wrong as such, but the _lock routines are
faster and provide a better example to follow...



\
 
 \ /
  Last update: 2008-03-28 08:45    [from the cache]
©2003-2008