From: kbuild test robot <lkp@intel.com>
To: Srikar Dronamraju <srikar@linux.vnet.ibm.com>
Cc: kbuild-all@01.org, Ingo Molnar <mingo@kernel.org>,
Peter Zijlstra <peterz@infradead.org>,
LKML <linux-kernel@vger.kernel.org>,
Mel Gorman <mgorman@techsingularity.net>,
Rik van Riel <riel@surriel.com>, Yi Wang <wang.yi59@zte.com.cn>,
zhong.weidong@zte.com.cn, Yi Liu <liu.yi24@zte.com.cn>,
Srikar Dronamraju <srikar@linux.vnet.ibm.com>,
Frederic Weisbecker <frederic@kernel.org>,
Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH] sched/core: Don't mix isolcpus and housekeeping CPUs
Date: Wed, 24 Oct 2018 03:12:25 +0800 [thread overview]
Message-ID: <201810240330.2DUB7fst%fengguang.wu@intel.com> (raw)
In-Reply-To: <1540317297-14545-1-git-send-email-srikar@linux.vnet.ibm.com>
[-- Attachment #1: Type: text/plain, Size: 4225 bytes --]
Hi Srikar,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on tip/sched/core]
[also build test WARNING on v4.19 next-20181019]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Srikar-Dronamraju/sched-core-Don-t-mix-isolcpus-and-housekeeping-CPUs/20181024-025019
config: i386-tinyconfig (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
kernel/sched/core.c: In function 'sched_setaffinity':
>> kernel/sched/core.c:4783:10: warning: assignment discards 'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
hk_mask = housekeeping_cpumask(HK_FLAG_DOMAIN);
^
vim +/const +4783 kernel/sched/core.c
4734
4735 long sched_setaffinity(pid_t pid, const struct cpumask *in_mask)
4736 {
4737 cpumask_var_t cpus_allowed, new_mask;
4738 struct task_struct *p;
4739 struct cpumask *hk_mask;
4740 int retval;
4741
4742 rcu_read_lock();
4743
4744 p = find_process_by_pid(pid);
4745 if (!p) {
4746 rcu_read_unlock();
4747 return -ESRCH;
4748 }
4749
4750 /* Prevent p going away */
4751 get_task_struct(p);
4752 rcu_read_unlock();
4753
4754 if (p->flags & PF_NO_SETAFFINITY) {
4755 retval = -EINVAL;
4756 goto out_put_task;
4757 }
4758 if (!alloc_cpumask_var(&cpus_allowed, GFP_KERNEL)) {
4759 retval = -ENOMEM;
4760 goto out_put_task;
4761 }
4762 if (!alloc_cpumask_var(&new_mask, GFP_KERNEL)) {
4763 retval = -ENOMEM;
4764 goto out_free_cpus_allowed;
4765 }
4766 retval = -EPERM;
4767 if (!check_same_owner(p)) {
4768 rcu_read_lock();
4769 if (!ns_capable(__task_cred(p)->user_ns, CAP_SYS_NICE)) {
4770 rcu_read_unlock();
4771 goto out_free_new_mask;
4772 }
4773 rcu_read_unlock();
4774 }
4775
4776 retval = security_task_setscheduler(p);
4777 if (retval)
4778 goto out_free_new_mask;
4779
4780
4781 cpuset_cpus_allowed(p, cpus_allowed);
4782 cpumask_and(new_mask, in_mask, cpus_allowed);
> 4783 hk_mask = housekeeping_cpumask(HK_FLAG_DOMAIN);
4784
4785 /*
4786 * If the cpumask provided has CPUs that are part of isolated and
4787 * housekeeping_cpumask, then restrict it to just the CPUs that
4788 * are part of the housekeeping_cpumask.
4789 */
4790 if (!cpumask_subset(new_mask, hk_mask) &&
4791 cpumask_intersects(new_mask, hk_mask)) {
4792 pr_info("pid %d: Mix of isolcpus and non-isolcpus provided\n",
4793 p->pid);
4794 cpumask_and(new_mask, new_mask, hk_mask);
4795 }
4796
4797 /*
4798 * Since bandwidth control happens on root_domain basis,
4799 * if admission test is enabled, we only admit -deadline
4800 * tasks allowed to run on all the CPUs in the task's
4801 * root_domain.
4802 */
4803 #ifdef CONFIG_SMP
4804 if (task_has_dl_policy(p) && dl_bandwidth_enabled()) {
4805 rcu_read_lock();
4806 if (!cpumask_subset(task_rq(p)->rd->span, new_mask)) {
4807 retval = -EBUSY;
4808 rcu_read_unlock();
4809 goto out_free_new_mask;
4810 }
4811 rcu_read_unlock();
4812 }
4813 #endif
4814 again:
4815 retval = __set_cpus_allowed_ptr(p, new_mask, true);
4816
4817 if (!retval) {
4818 cpuset_cpus_allowed(p, cpus_allowed);
4819 if (!cpumask_subset(new_mask, cpus_allowed)) {
4820 /*
4821 * We must have raced with a concurrent cpuset
4822 * update. Just reset the cpus_allowed to the
4823 * cpuset's cpus_allowed
4824 */
4825 cpumask_copy(new_mask, cpus_allowed);
4826 goto again;
4827 }
4828 }
4829 out_free_new_mask:
4830 free_cpumask_var(new_mask);
4831 out_free_cpus_allowed:
4832 free_cpumask_var(cpus_allowed);
4833 out_put_task:
4834 put_task_struct(p);
4835 return retval;
4836 }
4837
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 6493 bytes --]
next prev parent reply other threads:[~2018-10-23 19:13 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-23 17:54 [PATCH] sched/core: Don't mix isolcpus and housekeeping CPUs Srikar Dronamraju
2018-10-23 19:12 ` kbuild test robot [this message]
2018-10-24 3:23 ` Srikar Dronamraju
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=201810240330.2DUB7fst%fengguang.wu@intel.com \
--to=lkp@intel.com \
--cc=frederic@kernel.org \
--cc=kbuild-all@01.org \
--cc=linux-kernel@vger.kernel.org \
--cc=liu.yi24@zte.com.cn \
--cc=mgorman@techsingularity.net \
--cc=mingo@kernel.org \
--cc=peterz@infradead.org \
--cc=riel@surriel.com \
--cc=srikar@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=wang.yi59@zte.com.cn \
--cc=zhong.weidong@zte.com.cn \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.