mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Peter Zijlstra <peterz@infradead.org>
To: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
Cc: Juri Lelli <juri.lelli@gmail.com>,
	Dario Faggioli <raistlin@linux.it>,
	lkml <linux-kernel@vger.kernel.org>,
	linux-man <linux-man@vger.kernel.org>
Subject: Re: SCHED_DEADLINE, sched_getscheduler(), and sched_getparam()
Date: Mon, 12 May 2014 14:24:52 +0200	[thread overview]
Message-ID: <20140512122452.GB13467@laptop.programming.kicks-ass.net> (raw)
In-Reply-To: <CAKgNAkiA23kAFyXQkFV4z0aUE+y5K7AFNwRW+4LqwAyVj=tQtQ@mail.gmail.com>

On Mon, May 12, 2014 at 02:09:58PM +0200, Michael Kerrisk (man-pages) wrote:
> Hi Peter,
> 
> Looking at the code of sched_getparam() and sched_setscheduler() (to
> see what might need to land in the man pagea with respect to
> SCHED_DEADLINE changes), I see that the former fails (EINVAL) if the
> target is a SCHED_DEADLINE process, while the latter succeeds
> (returning SCHED_DEADLINE).
> 
> The sched_setscheduler() seems fine, but what's the rationale for
> having sched_getparam() fail in this case, rather than just returning
> a sched_priority of zero (since sched_priority is in any case unused,
> as for SCHED_OTHER, right)? My point is that the change seems to
> needlessly break applications that employ sched_getparam(). Maybe I am
> missing something...

s/setscheduler/getscheduler/ ?

I'm a proponent of fail hard instead of fail silently and muddle on.

And while we can fully and correctly return sched_getscheduler() we
cannot do so for sched_getparam().

Returning sched_param::sched_priority == 0 for DEADLINE would also break
the symmetry between sched_setparam() and sched_getparam(), both will
fail for SCHED_DEADLINE.



  reply	other threads:[~2014-05-12 12:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 12:09 Michael Kerrisk (man-pages)
2014-05-12 12:24 ` Peter Zijlstra [this message]
2014-05-12 12:33   ` Michael Kerrisk (man-pages)
2014-05-12 15:25     ` Peter Zijlstra
2014-05-12 19:42       ` Michael Kerrisk (man-pages)
2014-05-12 20:50         ` Peter Zijlstra
2014-05-19 13:06           ` [tip:sched/core] peter_zijlstra-sched-change_sched_getparam_behaviour_vs_sched_deadline tip-bot for Peter Zijlstra
2014-05-22 12:25           ` [tip:sched/core] sched/deadline: Change sched_getparam() behaviour vs SCHED_DEADLINE tip-bot for Peter Zijlstra
2014-05-13  8:14 SCHED_DEADLINE, sched_getscheduler(), and sched_getparam() Michael Kerrisk (man-pages)

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=20140512122452.GB13467@laptop.programming.kicks-ass.net \
    --to=peterz@infradead.org \
    --cc=juri.lelli@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=mtk.manpages@gmail.com \
    --cc=raistlin@linux.it \
    /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

all inboxes | Powered by JetHome®