History

Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net

Merge conflict of mlx5 resolved using instructions in merge commit 9566e650bf7fdf58384bb06df634f7531ca3a97e.

David S. Miller committed 7 years ago

Commit 446bf642 parents 20e79a0 0682150549 files · +4711 −2903Browse files

Showing the changes to kernel (8 of 549 files). Show all

Unified · Split

8 files
  1. kernel/configs.c +1 −15
  2. kernel/dma/direct.c +5 −5
  3. kernel/dma/mapping.c +18 −1
  4. kernel/dma/remap.c +1 −1
  5. kernel/irq/affinity.c +2 −4
  6. kernel/sched/cpufreq_schedutil.c +10 −4
  7. kernel/sched/deadline.c +0 −8
  8. kernel/sched/psi.c +2 −2
kernel/configs.c+1−15
@@ -1,3 +1,4 @@
1+// SPDX-License-Identifier: GPL-2.0-or-later
12 /*
23 * kernel/configs.c
34 * Echo the kernel .config file used to build the kernel
@@ -6,21 +7,6 @@ · 2 unmodified lines
67 * Copyright (C) 2002 Randy Dunlap <rdunlap@xenotime.net>
78 * Copyright (C) 2002 Al Stone <ahs3@fc.hp.com>
89 * Copyright (C) 2002 Hewlett-Packard Company
9− *
10− * This program is free software; you can redistribute it and/or modify
11− * it under the terms of the GNU General Public License as published by
12− * the Free Software Foundation; either version 2 of the License, or (at
13− * your option) any later version.
14− *
15− * This program is distributed in the hope that it will be useful, but
16− * WITHOUT ANY WARRANTY; without even the implied warranty of
17− * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
18− * NON INFRINGEMENT. See the GNU General Public License for more
19− * details.
20− *
21− * You should have received a copy of the GNU General Public License
22− * along with this program; if not, write to the Free Software
23− * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
2410 */
2511
2612 #include <linux/kernel.h>
kernel/dma/direct.c+5−5
@@ -47,9 +47,6 @@ u64 dma_direct_get_required_mask(struct device *dev) · 46 unmodified lines
4747 {
4848 u64 max_dma = phys_to_dma_direct(dev, (max_pfn - 1) << PAGE_SHIFT);
4949
50− if (dev->bus_dma_mask && dev->bus_dma_mask < max_dma)
51− max_dma = dev->bus_dma_mask;
52−
5350 return (1ULL << (fls64(max_dma) - 1)) * 2 - 1;
5451 }
5552
@@ -130,10 +127,12 @@ void *dma_direct_alloc_pages(struct device *dev, size_t size, · 74 unmodified lines
130127 if (!page)
131128 return NULL;
132129
133− if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) {
130+ if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) &&
131+ !force_dma_unencrypted(dev)) {
134132 /* remove any dirty cache lines on the kernel alias */
135133 if (!PageHighMem(page))
136134 arch_dma_prep_coherent(page, size);
135+ *dma_handle = phys_to_dma(dev, page_to_phys(page));
137136 /* return the page pointer as the opaque cookie */
138137 return page;
139138 }
@@ -178,7 +177,8 @@ void dma_direct_free_pages(struct device *dev, size_t size, void *cpu_addr, · 38 unmodified lines
178177 {
179178 unsigned int page_order = get_order(size);
180179
181− if (attrs & DMA_ATTR_NO_KERNEL_MAPPING) {
180+ if ((attrs & DMA_ATTR_NO_KERNEL_MAPPING) &&
181+ !force_dma_unencrypted(dev)) {
182182 /* cpu_addr is a struct page cookie, not a kernel address */
183183 __dma_direct_free_pages(dev, size, cpu_addr);
184184 return;
kernel/dma/mapping.c+18−1
@@ -150,6 +150,23 @@ int dma_get_sgtable_attrs(struct device *dev, struct sg_table *sgt, · 149 unmodified lines
150150 }
151151 EXPORT_SYMBOL(dma_get_sgtable_attrs);
152152
153+#ifdef CONFIG_MMU
154+/*
155+ * Return the page attributes used for mapping dma_alloc_* memory, either in
156+ * kernel space if remapping is needed, or to userspace through dma_mmap_*.
157+ */
158+pgprot_t dma_pgprot(struct device *dev, pgprot_t prot, unsigned long attrs)
159+{
160+ if (dev_is_dma_coherent(dev) ||
161+ (IS_ENABLED(CONFIG_DMA_NONCOHERENT_CACHE_SYNC) &&
162+ (attrs & DMA_ATTR_NON_CONSISTENT)))
163+ return prot;
164+ if (IS_ENABLED(CONFIG_ARCH_HAS_DMA_MMAP_PGPROT))
165+ return arch_dma_mmap_pgprot(dev, prot, attrs);
166+ return pgprot_noncached(prot);
167+}
168+#endif /* CONFIG_MMU */
169+
153170 /*
154171 * Create userspace mapping for the DMA-coherent memory.
155172 */
@@ -164,7 +181,7 @@ int dma_common_mmap(struct device *dev, struct vm_area_struct *vma, · 8 unmodified lines
164181 unsigned long pfn;
165182 int ret = -ENXIO;
166183
167− vma->vm_page_prot = arch_dma_mmap_pgprot(dev, vma->vm_page_prot, attrs);
184+ vma->vm_page_prot = dma_pgprot(dev, vma->vm_page_prot, attrs);
168185
169186 if (dma_mmap_from_dev_coherent(dev, vma, cpu_addr, size, &ret))
170187 return ret;
kernel/dma/remap.c+1−1
@@ -218,7 +218,7 @@ void *arch_dma_alloc(struct device *dev, size_t size, dma_addr_t *dma_handle, · 217 unmodified lines
218218
219219 /* create a coherent mapping */
220220 ret = dma_common_contiguous_remap(page, size, VM_USERMAP,
221− arch_dma_mmap_pgprot(dev, PAGE_KERNEL, attrs),
221+ dma_pgprot(dev, PAGE_KERNEL, attrs),
222222 __builtin_return_address(0));
223223 if (!ret) {
224224 __dma_direct_free_pages(dev, size, page);
kernel/irq/affinity.c+2−4
@@ -251,11 +251,9 @@ irq_create_affinity_masks(unsigned int nvecs, struct irq_affinity *affd) · 250 unmodified lines
251251 * Determine the number of vectors which need interrupt affinities
252252 * assigned. If the pre/post request exhausts the available vectors
253253 * then nothing to do here except for invoking the calc_sets()
254− * callback so the device driver can adjust to the situation. If there
255− * is only a single vector, then managing the queue is pointless as
256− * well.
254+ * callback so the device driver can adjust to the situation.
257255 */
258− if (nvecs > 1 && nvecs > affd->pre_vectors + affd->post_vectors)
256+ if (nvecs > affd->pre_vectors + affd->post_vectors)
259257 affvecs = nvecs - affd->pre_vectors - affd->post_vectors;
260258 else
261259 affvecs = 0;
kernel/sched/cpufreq_schedutil.c+10−4
@@ -40,6 +40,7 @@ struct sugov_policy { · 39 unmodified lines
4040 struct task_struct *thread;
4141 bool work_in_progress;
4242
43+ bool limits_changed;
4344 bool need_freq_update;
4445 };
4546
@@ -89,8 +90,11 @@ static bool sugov_should_update_freq(struct sugov_policy *sg_policy, u64 time) · 43 unmodified lines
8990 !cpufreq_this_cpu_can_update(sg_policy->policy))
9091 return false;
9192
92− if (unlikely(sg_policy->need_freq_update))
93+ if (unlikely(sg_policy->limits_changed)) {
94+ sg_policy->limits_changed = false;
95+ sg_policy->need_freq_update = true;
9396 return true;
97+ }
9498
9599 delta_ns = time - sg_policy->last_freq_update_time;
96100
@@ -437,7 +441,7 @@ static inline bool sugov_cpu_is_busy(struct sugov_cpu *sg_cpu) { return false; } · 340 unmodified lines
437441 static inline void ignore_dl_rate_limit(struct sugov_cpu *sg_cpu, struct sugov_policy *sg_policy)
438442 {
439443 if (cpu_bw_dl(cpu_rq(sg_cpu->cpu)) > sg_cpu->bw_dl)
440− sg_policy->need_freq_update = true;
444+ sg_policy->limits_changed = true;
441445 }
442446
443447 static void sugov_update_single(struct update_util_data *hook, u64 time,
@@ -457,7 +461,8 @@ static void sugov_update_single(struct update_util_data *hook, u64 time, · 13 unmodified lines
457461 if (!sugov_should_update_freq(sg_policy, time))
458462 return;
459463
460− busy = sugov_cpu_is_busy(sg_cpu);
464+ /* Limits may have changed, don't skip frequency update */
465+ busy = !sg_policy->need_freq_update && sugov_cpu_is_busy(sg_cpu);
461466
462467 util = sugov_get_util(sg_cpu);
463468 max = sg_cpu->max;
@@ -831,6 +836,7 @@ static int sugov_start(struct cpufreq_policy *policy) · 367 unmodified lines
831836 sg_policy->last_freq_update_time = 0;
832837 sg_policy->next_freq = 0;
833838 sg_policy->work_in_progress = false;
839+ sg_policy->limits_changed = false;
834840 sg_policy->need_freq_update = false;
835841 sg_policy->cached_raw_freq = 0;
836842
@@ -879,7 +885,7 @@ static void sugov_limits(struct cpufreq_policy *policy) · 42 unmodified lines
879885 mutex_unlock(&sg_policy->work_lock);
880886 }
881887
882− sg_policy->need_freq_update = true;
888+ sg_policy->limits_changed = true;
883889 }
884890
885891 struct cpufreq_governor schedutil_gov = {
kernel/sched/deadline.c+0−8
@@ -2088,17 +2088,13 @@ retry: · 2087 unmodified lines
20882088 }
20892089
20902090 deactivate_task(rq, next_task, 0);
2091− sub_running_bw(&next_task->dl, &rq->dl);
2092− sub_rq_bw(&next_task->dl, &rq->dl);
20932091 set_task_cpu(next_task, later_rq->cpu);
2094− add_rq_bw(&next_task->dl, &later_rq->dl);
20952092
20962093 /*
20972094 * Update the later_rq clock here, because the clock is used
20982095 * by the cpufreq_update_util() inside __add_running_bw().
20992096 */
21002097 update_rq_clock(later_rq);
2101− add_running_bw(&next_task->dl, &later_rq->dl);
21022098 activate_task(later_rq, next_task, ENQUEUE_NOCLOCK);
21032099 ret = 1;
21042100
@@ -2186,11 +2182,7 @@ static void pull_dl_task(struct rq *this_rq) · 81 unmodified lines
21862182 resched = true;
21872183
21882184 deactivate_task(src_rq, p, 0);
2189− sub_running_bw(&p->dl, &src_rq->dl);
2190− sub_rq_bw(&p->dl, &src_rq->dl);
21912185 set_task_cpu(p, this_cpu);
2192− add_rq_bw(&p->dl, &this_rq->dl);
2193− add_running_bw(&p->dl, &this_rq->dl);
21942186 activate_task(this_rq, p, 0);
21952187 dmin = p->dl.deadline;
21962188
kernel/sched/psi.c+2−2
@@ -1051,7 +1051,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group, · 1050 unmodified lines
10511051
10521052 if (!rcu_access_pointer(group->poll_kworker)) {
10531053 struct sched_param param = {
1054− .sched_priority = MAX_RT_PRIO - 1,
1054+ .sched_priority = 1,
10551055 };
10561056 struct kthread_worker *kworker;
10571057
@@ -1061,7 +1061,7 @@ struct psi_trigger *psi_trigger_create(struct psi_group *group, · 3 unmodified lines
10611061 mutex_unlock(&group->trigger_lock);
10621062 return ERR_CAST(kworker);
10631063 }
1064− sched_setscheduler(kworker->task, SCHED_FIFO, &param);
1064+ sched_setscheduler_nocheck(kworker->task, SCHED_FIFO, &param);
10651065 kthread_init_delayed_work(&group->poll_work,
10661066 psi_poll_work);
10671067 rcu_assign_pointer(group->poll_kworker, kworker);