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]
Date:	Wed, 25 Mar 2009 11:46:41 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Philipp Reisner <philipp.reisner@...bit.com>
Cc:	Andi Kleen <andi@...stfloor.org>, linux-kernel@...r.kernel.org,
	gregkh@...e.de
Subject: Re: [PATCH 02/12] DRBD: activity_log

On Wed, Mar 25, 2009 at 11:27:22AM +0100, Philipp Reisner wrote:
> md_io_page gets allocated with GFP_KERNEL (no GFP_HIGHMEM either).
> 
> 
> [...]
> > > +
> > > +		spin_lock_irq(&mdev->al_lock);
> > > +		lc_changed(mdev->act_log, al_ext);
> > > +		spin_unlock_irq(&mdev->al_lock);
> > > +		wake_up(&mdev->al_wait);
> >
> > The wake_up outside the lock looks a little dangerous.
> >
> 
> Please share you thoughts, why this looks a little dangerous ?

I haven't double checked the whole path, but unlocked wake up
is often a good recipe to potentially lose wake ups.

> [...]
> > > +	mutex_lock(&mdev->md_io_mutex); /* protects md_io_buffer, al_tr_cycle,
> > > ... */
> >
> > Doing checksumming inside a lock looks nasty.
> >
> 
> Well, that is a mutex, not a spinlock. We need to hold that lock here,

Yes it's independent. If it takes a lot of CPU time you'll likely have
a bottle neck. It's normally a bad idea to do anything CPU intensive
under a lock covering more than your current limited object.

-Andi

-- 
ak@...ux.intel.com -- Speaking for myself only.
--
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