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
| ||
|
Date: Wed, 9 Jan 2008 14:39:23 +0800 From: "Dave Young" <hidave.darkstar@...il.com> To: "Greg KH" <gregkh@...e.de> Cc: "Stefan Richter" <stefanr@...6.in-berlin.de>, James.Bottomley@...senpartnership.com, linux-scsi@...r.kernel.org, a.zummo@...ertech.it, peterz@...radead.org, cbou@...l.ru, linux-kernel@...r.kernel.org, "David Brownell" <david-b@...bell.net>, krh@...hat.com, stern@...land.harvard.edu, rtc-linux@...glegroups.com, spi-devel-general@...ts.sourceforge.net, linux1394-devel@...ts.sourceforge.net, dwmw2@...radead.org, davem@...emloft.net, jarkao2@...il.com Subject: Re: [PATCH 0/7] convert semaphore to mutex in struct class On Jan 9, 2008 2:37 PM, Dave Young <hidave.darkstar@...il.com> wrote: > > On Jan 9, 2008 2:13 PM, Dave Young <hidave.darkstar@...il.com> wrote: > > > > On Wed, Jan 09, 2008 at 09:32:48AM +0800, Dave Young wrote: > > > On Jan 9, 2008 6:48 AM, Greg KH <gregkh@...e.de> wrote: > > > > On Tue, Jan 08, 2008 at 03:05:10PM +0800, Dave Young wrote: > > > > > On Jan 8, 2008 1:20 AM, Greg KH <gregkh@...e.de> wrote: > > > > > > On Mon, Jan 07, 2008 at 06:13:37PM +0100, Stefan Richter wrote: > > > > > > > It's already in the driver core to the most part. It remains to be seen > > > > > > > what is less complicated in the end: Transparent mutex-protected list > > > > > > > accesses provided by driver core (requires the iterator), or all the > > > > > > > necessary locking done by the drivers themselves (requires some more > > > > > > > lock-taking but perhaps fewer lock instances overall in the drivers, and > > > > > > > respective redefinitions and documentation of the driver core API). > > > > > > > > > > > > I favor changing the driver core api and doing this kind of thing there. > > > > > > It keeps the drivers simpler and should hopefully make their lives > > > > > > easier. > > > > > > > > > > What about this? > > > > > > > > > > #define class_for_each_dev(pos, head, member) \ > > > > > for (mutex_lock(&(container_of(head, struct class, devices))->mutex), po > > > > > s = list_entry((head)->next, typeof(*pos), member); \ > > > > > prefetch(pos->member.next), &pos->member != (head) ? 1 : (mutex_unlock(& > > > > > (container_of(head, struct class, devices))->mutex), 0); \ > > > > > pos = list_entry(pos->member.next, typeof(*pos), member)) > > > > > > > I'm wrong, it's same as before indeed. > > > > > > > Eeek, just make the thing a function please, where you pass the iterator > > > > function in, like the driver core has (driver_for_each_device) > > > > > > Ok, so need a new member of knode_class, I will update the patch later. > > > Thanks. > > > > Withdraw my post, sorry :) > > > > For now the mutex patch, I will only use the mutex to lock the devices list and write an iterater function. > > Most of the iterating is for finding some device in the list, so maybe need a match function just like drivers do? > > > > Drop one more mail address of David Brownell in cc list. > Sorry for this, david > gmail web client make me crazy. -- 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