From mboxrd@z Thu Jan 1 00:00:00 1970 From: Thomas Monjalon Subject: Re: Bit spinlocks in DPDK Date: Fri, 06 Dec 2013 23:24:27 +0100 Message-ID: <4656219.tgqzelRNOJ@x220> References: <6895EAE0CA8DEE40B92D7CA88BB521F332BA572E6B@HQ1-EXCH02.corp.brocade.com> <6733914.61HpXdIraN@x220> <6895EAE0CA8DEE40B92D7CA88BB521F332BA572E7A@HQ1-EXCH02.corp.brocade.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7Bit Cc: "dev-VfR2kkLFssw@public.gmane.org" To: Pashupati Kumar Return-path: In-Reply-To: <6895EAE0CA8DEE40B92D7CA88BB521F332BA572E7A-7bu+sH2UtuFYKLnPCdnYV+N5nnCVAcvGQQ4Iyu8u01E@public.gmane.org> List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces-VfR2kkLFssw@public.gmane.org Sender: "dev" 06/12/2013 14:12, Pashupati Kumar : > From: Thomas Monjalon > > 06/12/2013 13:04, Pashupati Kumar : > > > We use bit spinlocks extensively to have compact data structures. Are > > > there any plans for adding them to DPDK in some future release? > > > > Not sure to understand your request. > > Are you looking for that? > > http://dpdk.org/doc/api/rte__spinlock_8h.html > > I am looking for spinlocks that use a single bit (bit 31) of a 32 bit word > for locking. The rest of the bits in the word are left undisturbed. This > enables more compact data structures as only 1 bit is consumed for the > lock. Oh yes, like test_and_set_bit_lock() in Linux: http://lxr.free-electrons.com/source/arch/ia64/include/asm/bitops.h?v=3.12#L205 I think that a patch would be appreciated :) PS: please try to answer below the question. It's far easier to read. -- Thomas