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: <d36bb30d0811230023i2d80d93fv2fc45d518ecaf04a@mail.gmail.com>
Date:	Sun, 23 Nov 2008 16:23:03 +0800
From:	"Yang Xi" <yangxilkm@...il.com>
To:	"Peter Zijlstra" <a.p.zijlstra@...llo.nl>
Cc:	linux-kernel@...r.kernel.org, mingo@...e.hu,
	chyyuu <chyyuu@...il.com>, "Fu, Michael" <michael.fu@...el.com>
Subject: Re: [PATCH 2.6.28-rc4]lock_stat: Add "con-hungry" to show that how many person-time fight for the ticket spinlock

On Sun, Nov 23, 2008 at 9:40 AM, Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:
> On Thu, 2008-11-20 at 16:09 +0800, Yang Xi wrote:
>> > I of course meant folding cpu and isspinlock into a combined bitfield
>> > (sorry for not being more clear), thereby saving space, this still takes
>> > 2*sizeof(int).
>> >
>> > We can safely take some bits from the cpu number as there currently are
>> > no plans for a 2g cpu machine, right SGI? :-)
>> Thanks, ok, 31bits enough for cpu at now stage. 1bit for isticketspinlock.
>> Here is the new one. Welcome more comments :).
>
> Looks good, one more question :-)
>
>> --- a/include/linux/spinlock.h
>> +++ b/include/linux/spinlock.h
>> @@ -127,6 +127,12 @@ do {
>>                  \
>>  #define spin_is_contended(lock)
>> __raw_spin_is_contended(&(lock)->raw_lock)
>>  #endif
>>
>> +#ifdef CONFIG_HAVE_TICKET_SPINLOCK
>> +#define spin_nr_contended(lock) __ticket_spin_nr_contended(&(lock)->raw_lock)
>> +#else
>> +#define spin_nr_contended(lock) (0)
>> +#endif
>> +
>
> Does it make sense to make the alternative case return
> spin_is_contended()?
You mean do it like this?
#ifdef CONFIG_HAVE_TICKET_SPINLOCK
#define spin_nr_contended(lock) __ticket_spin_nr_contended(&(lock)->raw_lock)
#else
#define spin_nr_contended(lock) (spin_is_contended(lock) ? 1: 0)

If we do it like this, for some architectures which donot have ticket
spinlock, we can know that the percentage of contentions which involve
more than two threads (con-hungry/ contention times). But i donot know
whether there are some guys are interested in this number.

Best regards

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