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:	Tue, 23 Jul 2013 17:15:02 +0100
From:	David Howells <dhowells@...hat.com>
To:	Jeff Layton <jlayton@...hat.com>
Cc:	dhowells@...hat.com, torvalds@...ux-foundation.org,
	linux-nfs@...r.kernel.org, linux-kernel@...r.kernel.org,
	linux-cachefs@...hat.com, Milosz Tanski <milosz@...in.com>,
	Yacine Belkadi <yacine.belkadi.1@...il.com>
Subject: Re: [PATCH] Fix __wait_on_atomic_t() to call the action func if the counter != 0

Jeff Layton <jlayton@...hat.com> wrote:

> > @@ -333,7 +333,8 @@ int __wait_on_atomic_t(wait_queue_head_t *wq, struct wait_bit_queue *q,
> >  		prepare_to_wait(wq, &q->wait, mode);
> >  		val = q->key.flags;
> >  		if (atomic_read(val) == 0)
> > -			ret = (*action)(val);
> > +			break;
> > +		ret = (*action)(val);
> >  	} while (!ret && atomic_read(val) != 0);
> 
> nit: can you now eliminate the check for "val" in the while condition?
> It doesn't look like it harms anything, but eliminating it would
> probably simplify the code slightly...

Its presence means that we don't have to call prepare_to_wait() again if val
became 0.

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