linux-rt-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: John Kacur <jkacur@redhat.com>
To: David Sommerseth <davids@redhat.com>
Cc: Carsten Emde <C.Emde@osadl.org>,
	RT-users <linux-rt-users@vger.kernel.org>
Subject: Re: [PATCH 1/2] do-not-allow-prio-less-than-one-in-cyclictest.patch
Date: Tue, 9 Mar 2010 19:12:36 +0100	[thread overview]
Message-ID: <520f0cf11003091012w6218931fmcb494dd280c96d0f@mail.gmail.com> (raw)
In-Reply-To: <4B968D3F.3070106@redhat.com>

On Tue, Mar 9, 2010 at 7:02 PM, David Sommerseth <davids@redhat.com> wrote:
> On 07/03/10 23:37, John Kacur wrote:
>> On Sun, Mar 7, 2010 at 9:39 PM, Carsten Emde <C.Emde@osadl.org> wrote:
>>> If not in SMP testing mode, the priority may go below 1, if the specified
>>> priority is lower than the number of threads, e.g.
>>> # cyclictest -p2 -t3
>>> T: 0 (21970) P: 2 [..]
>>> T: 1 (21971) P: 1 [..]
>>> T: 2 (21972) P: 0 [..]
>>>
>>> Do not allow priority to go below 1.
>>>
>>> Signed-off-by: Carsten Emde <C.Emde@osadl.org>
>>>
>>> Index: rt-tests/src/cyclictest/cyclictest.c
>>> ===================================================================
>>> --- rt-tests.orig/src/cyclictest/cyclictest.c
>>> +++ rt-tests/src/cyclictest/cyclictest.c
>>> @@ -1304,7 +1304,7 @@ int main(int argc, char **argv)
>>>                }
>>>
>>>                par->prio = priority;
>>> -               if (!sameprio)
>>> +               if (priority > 1 && !sameprio)
>>>                        priority--;
>>>                 if      (priority && policy <= 1) par->policy = SCHED_FIFO;
>>>                 else if (priority && policy == 2) par->policy = SCHED_RR;
>>>
>>> --
>>
>> I'm not sure about this, why not allow a priority below 1? The code
>> below properly sets the third thead to SCHED_OTHER.
>> I could imagine wanting to test that too. If you don't want to go
>> below 1 then just set a higher prio, p3 in the scenario you
>> showed.
>
> Maybe I'm misreading and misunderstanding the patch ... but I believe
> the if statement should say:
>
>        if (priority > 0 && !sameprio)
>                priority--;
>
> Just to avoid the situation the commit log says, priority to go below 0.
>
>
> kind regards,
>
> David Sommerseth

The code in general there was buggy, so I reverted the patch that
caused the problems in the first place.
(assuming Clark merges it).

Now the code will read (as it did before)

 if (priority && !histogram && !smp && !numa)
                        priority--;
--
To unsubscribe from this list: send the line "unsubscribe linux-rt-users" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  reply	other threads:[~2010-03-09 18:12 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-07 20:39 [PATCH 0/2] [rt-tests] Two minor fixes of cyclictest Carsten Emde
2010-03-07 20:39 ` [PATCH 1/2] do-not-allow-prio-less-than-one-in-cyclictest.patch Carsten Emde
2010-03-07 22:37   ` John Kacur
2010-03-09 18:02     ` David Sommerseth
2010-03-09 18:12       ` John Kacur [this message]
2010-03-09 18:14         ` David Sommerseth
2010-03-07 20:39 ` [PATCH 2/2] remove-incorrect-options-from-smp-help-message-in-cyclictest.patch Carsten Emde
2010-03-07 23:10   ` John Kacur
2010-03-07 23:49     ` John Kacur

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=520f0cf11003091012w6218931fmcb494dd280c96d0f@mail.gmail.com \
    --to=jkacur@redhat.com \
    --cc=C.Emde@osadl.org \
    --cc=davids@redhat.com \
    --cc=linux-rt-users@vger.kernel.org \
    /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).