public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Heiko Carstens <heiko.carstens@de.ibm.com>
To: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
Cc: linux-kernel@vger.kernel.org, joe@perches.com,
	peterz@infradead.org, mingo@kernel.org, tglx@linutronix.de
Subject: Re: [PATCH 01/15] sched/prio: Add a macro named NICE_TO_RLIMIT in prio.h.
Date: Tue, 11 Mar 2014 09:17:30 +0100	[thread overview]
Message-ID: <20140311081730.GA4298@osiris> (raw)
In-Reply-To: <f475972d21de5738cf3302ab9c95c90fd4407815.1394513466.git.yangds.fnst@cn.fujitsu.com>

On Tue, Mar 11, 2014 at 12:59:16PM +0800, Dongsheng Yang wrote:
> This patch add a macro named NICE_TO_RLIMIT in prio.h to
> convert nice value [19,-20] to rlimit style value [1,40].
> 
> Signed-off-by: Dongsheng Yang <yangds.fnst@cn.fujitsu.com>
> ---
>  include/linux/sched/prio.h | 5 +++++
>  1 file changed, 5 insertions(+)
> 
> diff --git a/include/linux/sched/prio.h b/include/linux/sched/prio.h
> index ac32258..8e78c47 100644
> --- a/include/linux/sched/prio.h
> +++ b/include/linux/sched/prio.h
> @@ -41,4 +41,9 @@
>  #define TASK_USER_PRIO(p)	USER_PRIO((p)->static_prio)
>  #define MAX_USER_PRIO		(USER_PRIO(MAX_PRIO))
>  
> +/*
> + * Convert nice value [19,-20] to rlimit style value [1,40].
> + */
> +#define NICE_TO_RLIMIT(nice)	(MAX_NICE - nice + 1)

Where is MAX_NICE defined? The s390 patch fails to compile.

Also you probably want at least extra braces around the 'nice' usage to
avoid subtle side effects. (or make NICE_TO.. a function, whatever).


  reply	other threads:[~2014-03-11  8:17 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-03-11  4:59 [PATCH 00/15] A series patch for priority Dongsheng Yang
2014-03-11  4:59 ` [PATCH 01/15] sched/prio: Add a macro named NICE_TO_RLIMIT in prio.h Dongsheng Yang
2014-03-11  8:17   ` Heiko Carstens [this message]
2014-03-11  8:20     ` Dongsheng Yang
2014-03-11  8:36       ` Heiko Carstens
2014-03-11  8:44         ` Dongsheng Yang
2014-03-11  4:59 ` [PATCH 02/15] kernel/sys: Replace opened code implementation with NICE_TO_RLIMIT macro Dongsheng Yang
2014-03-11  4:59 ` [PATCH 03/15] workqueue: Replace hardcoding of -20 with MIN_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 04/15] locktorture: Replace hardcoding of 19 with MAX_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 05/15] tools/mq_perf_tests: Replace hardcoding of -20 with MIN_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 06/15] mm: Replace hardcoding of 19 with MAX_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 07/15] ioprio: Add a macro named NICE_TO_IOPRIO Dongsheng Yang
2014-03-11  4:59 ` [PATCH 08/15] fs/hearbeat: Replace hardcoding of -20 with MIN_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 09/15] driver/block: " Dongsheng Yang
2014-03-11  4:59 ` [PATCH 10/15] driver/char: Replace hardcoding of 19 with MAX_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 11/15] drivers/s390: " Dongsheng Yang
2014-03-11  4:59 ` [PATCH 12/15] driver/staging/android: Use RLIMIT_TO_NICE to replace opened code implementation Dongsheng Yang
2014-03-11  4:59 ` [PATCH 13/15] sched/prio: Add a macro named RLIMIT_TO_NICE in prio.h Dongsheng Yang
2014-03-11  4:59 ` [PATCH 14/15] driver/staging/lustre: Replace hardcoding of -20 with MIN_NICE Dongsheng Yang
2014-03-11  4:59 ` [PATCH 15/15] driver/scsi: Replace hardcoding of 20 " Dongsheng Yang

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=20140311081730.GA4298@osiris \
    --to=heiko.carstens@de.ibm.com \
    --cc=joe@perches.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    --cc=yangds.fnst@cn.fujitsu.com \
    /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