[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: RFC: [PATCH] Fix setpriority calling __task_priority() for processes

From: Samuel Thibault
Subject: Re: RFC: [PATCH] Fix setpriority calling __task_priority() for processes instead of threads.
Date: Wed, 31 Aug 2016 14:16:12 +0200
User-agent: Mutt/1.5.21+34 (58baf7c9f32f) (2010-12-30)

Svante Signell, on Wed 31 Aug 2016 14:10:22 +0200, wrote:
> On Wed, 2016-08-31 at 13:51 +0200, Samuel Thibault wrote:
> > Svante Signell, on Wed 31 Aug 2016 13:42:58 +0200, wrote:
> > > 
> > > 
> > > Which is the original bug then?
> > You didn't say what application you are actually trying to fix, but the
> > issue you have shown is that task_priority returns permission denied
> > when change_threads is true (and I guessed you want that to work as
> > normal user). I just said that the test was expected to have issues
> > since the nice value is negative.
> The application is openntpd, which I'm working on porting and ntpd where this
> call is made requires you to be root.

Ok. Please always provide such information from the beginning, so we
don't have to divine it.

> I would expect values [-20,19] to be OK converted to [5,44] with
> #define NICE_TO_MACH_PRIORITY(nice) ((nice) + 25) from hurd/hurd/resource.h
> and 
> #define invalid_pri(pri) (((pri) < 0) || ((pri) >= NRQS)), where NRQS = 50
> from kern/sched.h.
> to work.

Yes, but see the code changing thread priorities (since that's what is
posing problem)

> In fact, according to invalid_pri(pri) the range could be [-26,25]. but that
> would not make sense, right?

It does not really matter. Linux' notion of nice values is already not
really POSIX for root :) (POSIX doesn't define negative nice values).


reply via email to

[Prev in Thread] Current Thread [Next in Thread]