linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Steven Rostedt <rostedt@goodmis.org>
To: Sebastian Andrzej Siewior <bigeasy@linutronix.de>
Cc: Fernando Lopez-Lezcano <nando@ccrma.Stanford.EDU>,
	Kent Overstreet <kmo@daterainc.com>,
	linux-rt-users <linux-rt-users@vger.kernel.org>,
	LKML <linux-kernel@vger.kernel.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	John Kacur <jkacur@redhat.com>
Subject: Re: [ANNOUNCE] 3.10.6-rt3
Date: Tue, 20 Aug 2013 10:06:51 -0400	[thread overview]
Message-ID: <20130820100651.32e1b79c@gandalf.local.home> (raw)
In-Reply-To: <52131747.4010105@linutronix.de>

On Tue, 20 Aug 2013 09:14:15 +0200
Sebastian Andrzej Siewior <bigeasy@linutronix.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

  reply	other threads:[~2013-08-20 14:06 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-12 16:34 [ANNOUNCE] 3.10.6-rt3 Sebastian Andrzej Siewior
2013-08-12 19:48 ` Steven Rostedt
2013-08-13  0:47   ` Paul Gortmaker
2013-08-13  1:03     ` Steven Rostedt
2013-08-13  1:12     ` Carsten Emde
2013-08-13 10:54       ` Thomas Gleixner
2013-08-13 12:08         ` Steven Rostedt
     [not found] ` <CAF+KLxsGtt_+0shjSGbjC4MG7i_yg1NL1zUXuVb-RiN=C44_nA@mail.gmail.com>
2013-08-14 18:17   ` Sebastian Andrzej Siewior
2013-08-14 18:21     ` Staffan Tjernstrom
2013-08-15 18:42 ` Fernando Lopez-Lezcano
2013-08-15 19:22   ` Steven Rostedt
2013-08-15 19:39     ` Fernando Lopez-Lezcano
2013-08-16  7:01     ` Sebastian Andrzej Siewior
2013-08-19 17:23       ` Fernando Lopez-Lezcano
2013-08-20  0:29         ` Steven Rostedt
2013-08-20  0:34           ` Fernando Lopez-Lezcano
2013-08-20  1:02           ` Steven Rostedt
2013-08-20  7:14             ` Sebastian Andrzej Siewior
2013-08-20 14:06               ` Steven Rostedt [this message]
2013-08-20 18:58           ` Fernando Lopez-Lezcano
     [not found]             ` <CAFfPn7iqf5EntPKdRO3cFhd=PFostp3mVLGEtt3ksLQHonMhkw@mail.gmail.com>
2013-08-27 16:19               ` Steven Rostedt

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20130820100651.32e1b79c@gandalf.local.home \
    --to=rostedt@goodmis.org \
    --cc=bigeasy@linutronix.de \
    --cc=jkacur@redhat.com \
    --cc=kmo@daterainc.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rt-users@vger.kernel.org \
    --cc=nando@ccrma.Stanford.EDU \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).