mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "gnehzuil.lzheng@gmail.com" <gnehzuil.lzheng@gmail.com>
To: Rob Landley <rob@landley.net>
Cc: Jens Axboe <axboe@kernel.dk>,
	linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: Why does ionice(1) ban the user to set back to 'none' class?
Date: Tue, 19 Jun 2012 10:07:36 +0800	[thread overview]
Message-ID: <4FDFDEE8.2030108@gmail.com> (raw)
In-Reply-To: <4FDF3AAA.9020101@landley.net>

On 06/18/2012 10:26 PM, Rob Landley wrote:

> On 06/18/2012 06:48 AM, Zheng Liu wrote:
>> Hi Jens,
>>
>> I meet a problem when I use ionice(1) to adjust a process's io priority.
>> I do the following operations:
>>
>> $ ionice -p${pid}
>> none: prio 0
>> $ ionice -p${pid} -c2 -n4
>> $ ionice -p${pid}
>> best-effort: prio 4
>> $ ionice -p${pid} -c0 -n0
>> $ ionice -p${pid}
>> best-effort: prio 0
>>
>> So I cannot set scheduling class back to 'none'.  If I call ioprio_set(2)
>> directly, it will be fine.  But if I use ionice(1), I cannot change it.  I
>> read the docs about ionice in [1].  I notice this code:
>>
>> switch (ioprio_class) {
>> 	case IOPRIO_CLASS_NONE:
>> 		ioprio_class = IOPRIO_CLASS_BE;
>>                                ^^^^^^^^^^^^^^^^
>>                                *It means that we cannot set back to none.*
>> 		break;
>> 	case IOPRIO_CLASS_RT:
>> 	case IOPRIO_CLASS_BE:
>> 		break;
>> 	case IOPRIO_CLASS_IDLE:
>> 		ioprio = 7;
>> 		break;
>> 	default:
>> 		printf("bad prio class %d\n", ioprio_class);
>> 		return 1;
>> }
>>
>> My question is why we need to ban the user to set back to 'none'.  Is there
>> some reasons?  Thank you.
> 
> Since I'm CC'd, I'll explicitly say I haven't a clue why it does this.


Thank you all the same. :-)

Regards,
Zheng

      reply	other threads:[~2012-06-19  2:07 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-18 11:48 Zheng Liu
2012-06-18 13:28 ` Jens Axboe
2012-06-19  2:11   ` gnehzuil.lzheng
2012-06-19  6:40     ` Bernhard Voelker
2012-06-19  8:15       ` gnehzuil.lzheng
2012-06-18 14:26 ` Rob Landley
2012-06-19  2:07   ` gnehzuil.lzheng [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=4FDFDEE8.2030108@gmail.com \
    --to=gnehzuil.lzheng@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rob@landley.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

Powered by JetHome