mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: 王志强 <00107082@163.com>
To: linux-kernel@vger.kernel.org
Subject: How can I make cgroup cpu quota and task priority work together without cpuset?
Date: Wed, 26 Oct 2022 18:29:51 +0800 (CST)	[thread overview]
Message-ID: <42b40adf.4dfd.18413d75a0e.Coremail.00107082@163.com> (raw)


Hi~!


I am not sure whether this has been raised before:
I have two tasks with different priorities, and I set those two task into
 a cpu cgroup with cpu_quota equal to cpu_period, hence the two tasks 
would only use up 1 cpu core at most,  and the node has multi-cores.
But it turn out cpu cgroup dose not take process priority into 
consideration, what I got is that when the task with higher priority 
need cpu resources, it would only take 50% if the task with lower 
priority is scheduled on another cpu, while the expectation would be >90%.
The problem could be solved if I assign a cpu core statically to those two tasks via cpuset cgroup.....
Is there other solution for this?  

If those two tasks would be scheduled on same cpu anytime, not necessarily
 on the same cpu during each scheduling period, it would be enough.
I tried PR_SCHED_CORE prctl, but no luck.


I think this issue is typical when moving from VM to container,  an API 
in kernel which would bind a group of task together during scheduling 
would be nice, or better if cpu cgroup could take priority into account?




Thanks
David

                 reply	other threads:[~2022-10-26 10:30 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=42b40adf.4dfd.18413d75a0e.Coremail.00107082@163.com \
    --to=00107082@163.com \
    --cc=linux-kernel@vger.kernel.org \
    /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

all inboxes | Powered by JetHome®