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: <20130820100651.32e1b79c@gandalf.local.home>
Date:	Tue, 20 Aug 2013 10:06:51 -0400
From:	Steven Rostedt <rostedt@...dmis.org>
To:	Sebastian Andrzej Siewior <bigeasy@...utronix.de>
Cc:	Fernando Lopez-Lezcano <nando@...ma.Stanford.EDU>,
	Kent Overstreet <kmo@...erainc.com>,
	linux-rt-users <linux-rt-users@...r.kernel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Thomas Gleixner <tglx@...utronix.de>,
	John Kacur <jkacur@...hat.com>
Subject: Re: [ANNOUNCE] 3.10.6-rt3

On Tue, 20 Aug 2013 09:14:15 +0200
Sebastian Andrzej Siewior <bigeasy@...utronix.de> wrote:

> On 08/20/2013 03:02 AM, Steven Rostedt wrote:
> > Looking at it more, I can now see why they did what they did.
> 
> He is the only user in the whole kernel. It is somehow hard to believe
> that it can't be solved differently.
> 

Perhaps. But if I understand the code, this is what they have.

When a request is sent out, the writes must wait till it is complete
before it can do anything, thus the writers wait. When the request
finishes (by a different thread), it releases the reader, then the
writers can continue.

The problem is that the task that sends the request does not wait for
it to finish. But until the request does finish, all writers must wait.
To complicate the matter, it appears that more than one request can be
in transition at a time. That is, its not just a single request the a
writer must wait for, it could be many.

The only way I can think of at the moment to fix this without
non-owner, is to set up a wait queue, and a ref count. Basically have
this:

writer:

  again:
	down_write(lock);
	if (refcount) {
		up_write(lock);
		wait_event(wq, !refcount);
		goto again;
	}

reader:
	down_read(lock);
	refcount++;
	request();
	up_read(lock);

completion:

	down_read(lock);
	refcount--;
	up_read_(lock);

The refcount would need to be an atomic, but I think this would work.

Maybe I'll submit it to get rid of the one user of non_owner().

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