public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Matt Mackall <mpm@selenic.com>
To: Andrew Morton <akpm@osdl.org>
Cc: mingo@elte.hu, linux-kernel@vger.kernel.org,
	michael.kerrisk@gmx.net, chrisw@osdl.org,
	Michael Kerrisk <mtk-manpages@gmx.net>
Subject: [PATCH] Fix nice range for RLIMIT NICE
Date: Mon, 15 Aug 2005 13:13:11 -0700	[thread overview]
Message-ID: <20050815201311.GA12284@waste.org> (raw)
In-Reply-To: <20050729061318.GD7425@waste.org>

Looks like I let this one slip through the cracks:

Make RLIMIT_NICE ranges consistent with getpriority(2)

As suggested by Michael Kerrisk <mtk-manpages@gmx.net>, make
RLIMIT_NICE consistent with getpriority before it becomes available in
released glibc.

Signed-off-by: Matt Mackall <mpm@selenic.com>
Acked-by: Ingo Molnar <mingo@elte.hu>
Acked-by: Chris Wright <chrisw@osdl.org>

Index: lhg/kernel/sched.c
===================================================================
--- lhg.orig/kernel/sched.c	2005-08-15 13:03:05.000000000 -0700
+++ lhg/kernel/sched.c	2005-08-15 13:09:21.000000000 -0700
@@ -3378,8 +3378,8 @@ EXPORT_SYMBOL(set_user_nice);
  */
 int can_nice(const task_t *p, const int nice)
 {
-	/* convert nice value [19,-20] to rlimit style value [0,39] */
-	int nice_rlim = 19 - nice;
+	/* convert nice value [19,-20] to rlimit style value [1,40] */
+	int nice_rlim = 20 - nice;
 	return (nice_rlim <= p->signal->rlim[RLIMIT_NICE].rlim_cur ||
 		capable(CAP_SYS_NICE));
 }


-- 
Mathematics is the supreme nostalgia of our time.

      parent reply	other threads:[~2005-08-15 20:13 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-07-28 15:04 Broke nice range for RLIMIT NICE Michael Kerrisk
2005-07-28 17:43 ` Andrew Morton
2005-07-29 11:29   ` [PATCH] MAINTAINERS record -- MAN-PAGES Michael Kerrisk
2005-07-29  6:13 ` Broke nice range for RLIMIT NICE Matt Mackall
2005-07-29  8:38   ` Ingo Molnar
2005-07-29 10:42     ` Michael Kerrisk
2005-07-29 14:50       ` Nix
2005-07-29 15:14         ` Michael Kerrisk
2005-07-29 20:57           ` Nix
2005-07-29 10:40   ` Michael Kerrisk
2005-07-29 20:18   ` Chris Wright
2005-07-29 20:51     ` Chris Wright
2005-07-29 21:02       ` Lee Revell
2005-07-29 21:07         ` Chris Wright
2005-08-15 20:13   ` Matt Mackall [this message]

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=20050815201311.GA12284@waste.org \
    --to=mpm@selenic.com \
    --cc=akpm@osdl.org \
    --cc=chrisw@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.kerrisk@gmx.net \
    --cc=mingo@elte.hu \
    --cc=mtk-manpages@gmx.net \
    /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