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: <20080416164404.GM9191@parisc-linux.org>
Date:	Wed, 16 Apr 2008 10:44:04 -0600
From:	Matthew Wilcox <matthew@....cx>
To:	Oliver Neukum <oliver@...kum.org>
Cc:	Ingo Oeser <ioe-lkml@...eria.de>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	Andi Kleen <andi@...stfloor.org>,
	Peter Zijlstra <peterz@...radead.org>,
	Bart Van Assche <bart.vanassche@...il.com>,
	Roland Dreier <rdreier@...co.com>, Ingo Molnar <mingo@...e.hu>,
	Daniel Walker <dwalker@...sta.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] Replace completions with semaphores

On Wed, Apr 16, 2008 at 06:42:50PM +0200, Oliver Neukum wrote:
> Am Mittwoch, 16. April 2008 18:34:14 schrieb Matthew Wilcox:
> > On Wed, Apr 16, 2008 at 06:31:08PM +0200, Oliver Neukum wrote:
> > > Am Mittwoch, 16. April 2008 18:16:52 schrieb Matthew Wilcox:
> > > > The basic idea is that you get back a cookie from the kcounter_claim()
> > > > which you have to hand to the kcounter_release() function so it
> > > > knows which one you released. ?It's similar to mutex debugging except
> > > 
> > > So in addition to the kcounter we need to save a token in a data structure?
> > > In fact, there must be a data structure that can house that token. So you
> > > can no longer live with a pointer just to a device descriptor, but every
> > > individual use of a resource must have an associated data structure?
> > 
> > That's right.  Do you have an example where this would be inconvenient?
> > I couldn't find one.  For example, with USB, you could place one in the
> > struct urb.
> 
> That's a data structure we really want to shrink. And furthermore, the needs
> of the use cases should shape the locking primitives, not the reverse.

The cookies aren't checked by the kcounter implementation if
CONFIG_DEBUG_KCOUNTER isn't set.  So you can avoid storing them if it's
*really* that important to shrink your data structures.

You'll still have to check the return value from the various
kcounter_claim* APIs for errors, of course.

-- 
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours.  We can't possibly take such
a retrograde step."
--
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