lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20140127121604.GD11314@laptop.programming.kicks-ass.net>
Date:	Mon, 27 Jan 2014 13:16:04 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Dongsheng Yang <yangds.fnst@...fujitsu.com>
Cc:	linux-kernel@...r.kernel.org, raistlin@...ux.it,
	juri.lelli@...il.com, clark.williams@...il.com, mingo@...hat.com,
	rostedt@...dmis.org
Subject: Re: [PATCH 3/3] sched: Implement task_nice and task_prio as static
 inline functions.

On Mon, Jan 27, 2014 at 08:09:54PM -0500, Dongsheng Yang wrote:
> On 01/27/2014 05:32 AM, Peter Zijlstra wrote:
> >On Mon, Jan 27, 2014 at 05:15:39PM -0500, Dongsheng Yang wrote:
> >>+/**
> >>+ * task_prio - return the priority value of a given task.
> >>+ * @p: the task in question.
> >>+ *
> >>+ * Return: The priority value as seen by users in /proc.
> >>+ * RT tasks are offset by -200. Normal tasks are centered
> >>+ * around 0, value goes from -16 to +15.
> >>+ */
> >>+static inline int task_prio(const struct task_struct *p)
> >>+{
> >>+	return p->prio - MAX_RT_PRIO;
> >>+}
> >Who would ever want to use/rely on this? It doesn't make any sense. And
> >therefore it shouldn't ever be considered time critical.
> 
> I just copy it from kernel/sched/core.c. Currently, it is used in
> fs/proc/array.c.

Just leave it there. Nobody should use this value anyhow.

> >>+/**
> >>+ * task_nice - return the nice value of a given task.
> >>+ * @p: the task in question.
> >>+ *
> >>+ * Return: The nice value [ -20 ... 0 ... 19 ].
> >>+ */
> >>+static inline int task_nice(const struct task_struct *p)
> >>+{
> >>+	return TASK_NICE(p);
> >>+}
> >Urgh, no. Just remove the macro already. Although arguably we should
> >remove ->static_prio and clean up that entire mess.
> >
> 
> Oops, sorry for the noise. I am a newbie here, could you help to point out
> that
>  which tree is the latest version for sched. Thanx :)

tip/sched/core or tip/master, but that's not the issue. There's no point
in having an inline and a macro that do the exact same thing.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ