Commit Graph

372 Commits

Author SHA1 Message Date
Wu Tao 4324615803 cgroup-v1: Require capabilities to set release_agent
upstream commit: 24f6008564183aa120d07c03d9289519c2fe02af

The cgroup release_agent is called with call_usermodehelper.  The function
call_usermodehelper starts the release_agent with a full set fo capabilities.
Therefore require capabilities when setting the release_agaent.

Reported-by: Tabitha Sable <tabitha.c.sable@gmail.com>
Tested-by: Tabitha Sable <tabitha.c.sable@gmail.com>
Fixes: 81a6a5cdd2c5 ("Task Control Groups: automatic userspace notification of idle cgroups")
Cc: stable@vger.kernel.org # v2.6.24+
Signed-off-by: "Eric W. Biederman" <ebiederm@xmission.com>
Signed-off-by: Tejun Heo <tj@kernel.org>
2022-03-25 09:54:06 +08:00
Menglong Dong 539cc42c17 cgroup: bpf: make v1 support eBPF
eBPF is not supported by cgroup-v1, because v1 can have multi
hierarchy, and it's not sure which one can be use.

To make v1 support eBPF, all eBPF program is attached to cgrp_dfl_root,
which means that there is only one attach point.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
2022-02-17 12:58:28 +08:00
Menglong Dong 4c22274eac net: bpf: introduce BPF_CGROUP_UDP_UNHASH eBPF hook
Add new cgroup based eBPF hook 'BPF_CGROUP_UDP_UNHASH' which is called
when UDP sock unhashed. This is used to monitor the release of UDP
sock.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
2022-02-17 12:58:28 +08:00
Menglong Dong e22ef12b56 net: bpf: add BPF_CGROUP_TWSK_CLOSE for tcp timewait sock close
For now, 'BPF_SOCK_OPS_STATE_CB' of sock_ops can be used to monitor
the state change of TCP sock. However, once tcp sock change to timewait
sock, 'TCP_CLOSE' event will be passed to the eBPF program, and it's
hard to capture the finish of a TCP connect.

Add 'BPF_CGROUP_TWSK_CLOSE', which will be called when timewait sock
close.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
2022-02-17 12:58:28 +08:00
Menglong Dong 4c07420add net: bpf: introduce BPF_CGROUP_INET_POST_AUTOBIND attach type
Add new cgroup based eBPF type 'BPF_CGROUP_INET4_POST_AUTOBIND', which
is called after the success of port binding in inet_autobind().

The return value is used to determine if this port is usable, therefore
users have the chance to reject the autobind operation.

Signed-off-by: Menglong Dong <imagedong@tencent.com>
2022-02-17 12:58:28 +08:00
Bin Lai 6bbc9108ab kthread: Fix PF_KTHREAD vs to_kthread() race
The kthread_is_per_cpu() construct relies on only being called on
PF_KTHREAD tasks (per the WARN in to_kthread). This gives rise to the
following usage pattern:

        if ((p->flags & PF_KTHREAD) && kthread_is_per_cpu(p))

However, as reported by syzcaller, this is broken. The scenario is:

	CPU0                            CPU1 (running p)

	(p->flags & PF_KTHREAD) // true

					begin_new_exec()
					  me->flags &= ~(PF_KTHREAD|...);
	kthread_is_per_cpu(p)
	  to_kthread(p)
	    WARN(!(p->flags & PF_KTHREAD) <-- *SPLAT*

Introduce __to_kthread() that omits the WARN and is sure to check both
values.

Use this to remove the problematic pattern for kthread_is_per_cpu()
and fix a number of other kthread_*() functions that have similar
issues but are currently not used in ways that would expose the
problem.

Notably kthread_func() is only ever called on 'current', while
kthread_probe_data() is only used for PF_WQ_WORKER, which implies the
task is from kthread_create*().

Fixes: ac687e6e8c26 ("kthread: Extract KTHREAD_IS_PER_CPU")
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Valentin Schneider <Valentin.Schneider@arm.com>
Link: https://lkml.kernel.org/r/YH6WJc825C4P0FCK@hirez.programming.kicks-ass.net
2022-01-05 14:51:53 +08:00
Bin Lai 7f225c74b8 sli/cpu: replace tabs with spaces as seperators
In order to simplify userspace parsing, we only use the spaces
as seperators.

Signed-off-by: Bin Lai <robinlai@tencent.com>
2022-01-05 14:51:53 +08:00
zgpeng 22af1f03a8 Add cfs bandwidth burst statistics
When using cfs_b and meeting with some throttled periods, users shall
use burst buffer to allow bursty workloads. Apart from configuring some
burst buffer and watch whether throttled periods disappears, some
statistics on burst buffer using are also helpful. Thus expose the
following statistics into cpu.stat file:

nr_burst:   number of periods bandwidth burst occurs
burst_time: cumulative wall-time that any cpus has
            used above quota in respective periods

Signed-off-by: Huaixin Chang <changhuaixin@linux.alibaba.com>
Signed-off-by: Shanpei Chen <shanpeic@linux.alibaba.com>
2021-12-30 14:50:28 +08:00
zgpeng fd57c9e500 Make CFS bandwidth controller burstable
Accumulate unused quota from previous periods, thus accumulated
bandwidth runtime can be used in the following periods. During
accumulation, take care of runtime overflow. Previous non-burstable
CFS bandwidth controller only assign quota to runtime, that saves a lot.

A sysctl parameter cpu_qos_cfs_bw_burst_enabled is introduced as a
switch for burst. It is disabled by default.

Signed-off-by: Huaixin Chang <changhuaixin@linux.alibaba.com>
Signed-off-by: Shanpei Chen <shanpeic@linux.alibaba.com>
2021-12-30 14:50:28 +08:00
zgpeng 8917751ac3 Introduce primitives for CFS bandwidth burst
In this patch, we introduce the notion of CFS bandwidth burst. Unused
"quota" from pervious "periods" might be accumulated and used in the
following "periods". The maximum amount of accumulated bandwidth is
bounded by "burst". And the maximun amount of CPU a group can consume in
a given period is "buffer" which is equivalent to "quota" + "burst in
case that this group has done enough accumulation.

Signed-off-by: Huaixin Chang <changhuaixin@linux.alibaba.com>
Signed-off-by: Shanpei Chen <shanpeic@linux.alibaba.com>
2021-12-30 14:50:28 +08:00
Stanislav Fomichev 258e2d6379 bpf: Allow bpf_get_netns_cookie in BPF_PROG_TYPE_CGROUP_SOCKOPT
This is similar to existing BPF_PROG_TYPE_CGROUP_SOCK
and BPF_PROG_TYPE_CGROUP_SOCK_ADDR.

Signed-off-by: Stanislav Fomichev <sdf@google.com>
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Link: https://lore.kernel.org/bpf/20210813230530.333779-2-sdf@google.com
(cherry picked from commit f1248dee954c2ddb0ece47a13591e5d55d422d22)
2021-12-30 14:50:11 +08:00
Daniel Borkmann 3945c7126a bpf, net: Rework cookie generator as per-cpu one
With its use in BPF, the cookie generator can be called very frequently
in particular when used out of cgroup v2 hooks (e.g. connect / sendmsg)
and attached to the root cgroup, for example, when used in v1/v2 mixed
environments. In particular, when there's a high churn on sockets in the
system there can be many parallel requests to the bpf_get_socket_cookie()
and bpf_get_netns_cookie() helpers which then cause contention on the
atomic counter.

As similarly done in f991bd2e1421 ("fs: introduce a per-cpu last_ino
allocator"), add a small helper library that both can use for the 64 bit
counters. Given this can be called from different contexts, we also need
to deal with potential nested calls even though in practice they are
considered extremely rare. One idea as suggested by Eric Dumazet was
to use a reverse counter for this situation since we don't expect 64 bit
overflows anyways; that way, we can avoid bigger gaps in the 64 bit
counter space compared to just batch-wise increase. Even on machines
with small number of cores (e.g. 4) the cookie generation shrinks from
min/max/med/avg (ns) of 22/50/40/38.9 down to 10/35/14/17.3 when run
in parallel from multiple CPUs.

Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Acked-by: Martin KaFai Lau <kafai@fb.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>
Link: https://lore.kernel.org/bpf/8a80b8d27d3c49f9a14e1d5213c19d8be87d1dc8.1601477936.git.daniel@iogearbox.net
2021-12-30 14:50:11 +08:00
Mungerjiang 9e38a2eac2 locking/qspinlock: Introduce llc aware spinlock
Cross-LLC is the same as cross-numa, which will cause longer
	cache synchronization. This patch changes numa aware to LLC
	aware and disables llc spinlock by default.

	Signed-off-by: Mungerjiang <mungerjiang@tencent.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 6554d7dccd locking/qspinlock: Introduce the shuffle reduction optimization into CNA
This performance optimization chooses probabilistically to avoid moving
	threads from the main queue into the secondary one when the secondary queue
	is empty.

	It is helpful when the lock is only lightly contended. In particular, it
	makes CNA less eager to create a secondary queue, but does not introduce
	any extra delays for threads waiting in that queue once it is created.

	Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
	Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
	Reviewed-by: Waiman Long <longman@redhat.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 95914e2564 locking/qspinlock: Avoid moving certain threads between waiting queues in CNA
Prohibit moving certain threads (e.g., in irq and nmi contexts)
	to the secondary queue. Those prioritized threads will always stay
	in the primary queue, and so will have a shorter wait time for the lock.

	Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
	Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
	Reviewed-by: Waiman Long <longman@redhat.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 18b8bf49aa locking/qspinlock: Introduce starvation avoidance into CNA
Keep track of the time the thread at the head of the secondary queue
	has been waiting, and force inter-node handoff once this time passes
	a preset threshold. The default value for the threshold (1ms) can be
	overridden with the new kernel boot command-line option
	"qspinlock.numa_spinlock_threshold_ns".

	Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
	Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
	Reviewed-by: Waiman Long <longman@redhat.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 068ddf89ac locking/qspinlock: Introduce CNA into the slow path of qspinlock
In CNA, spinning threads are organized in two queues, a primary queue for
	threads running on the same node as the current lock holder, and a
	secondary queue for threads running on other nodes. After acquiring the
	MCS lock and before acquiring the spinlock, the MCS lock
	holder checks whether the next waiter in the primary queue (if exists) is
	running on the same NUMA node. If it is not, that waiter is detached from
	the main queue and moved into the tail of the secondary queue. This way,
	we gradually filter the primary queue, leaving only waiters running on
	the same preferred NUMA node. For more details, see
	https://arxiv.org/abs/1810.05600.

	Note that this variant of CNA may introduce starvation by continuously
	passing the lock between waiters in the main queue. This issue will be
	addressed later in the series.

	Enabling CNA is controlled via a new configuration option
	(NUMA_AWARE_SPINLOCKS). By default, the CNA variant is patched in at the
	boot time only if we run on a multi-node machine in native environment and
	the new config is enabled. (For the time being, the patching requires
	CONFIG_PARAVIRT_SPINLOCKS to be enabled as well. However, this should be
	resolved once static_call() is available.) This default behavior can be
	overridden with the new kernel boot command-line option
	"numa_spinlock=on/off" (default is "auto").

	Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
	Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
	Reviewed-by: Waiman Long <longman@redhat.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 473f02a34a locking/qspinlock: Refactor the qspinlock slow path
Move some of the code manipulating the spin lock into separate functions.
	This would allow easier integration of alternative ways to manipulate
	that lock.

	Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
	Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
	Reviewed-by: Waiman Long <longman@redhat.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 05e8e4dd54 locking/qspinlock: Rename mcs lock/unlock macros and make them more generic
The mcs unlock macro (arch_mcs_lock_handoff) should accept the value to be
	stored into the lock argument as another argument. This allows using the
	same macro in cases where the value to be stored when passing the lock is
	different from 1.

	Signed-off-by: Alex Kogan <alex.kogan@oracle.com>
	Reviewed-by: Steve Sistare <steven.sistare@oracle.com>
	Reviewed-by: Waiman Long <longman@redhat.com>
2021-12-20 11:43:06 +08:00
Mungerjiang 2a2c1f5b4c x86/kvm: Add nopvspin parameter to disable PV spinlocks
upstream:05eee619ed61c8cd89633954d38c4e5653086845

    x86/kvm: Add "nopvspin" parameter to disable PV spinlocks

    There are cases where a guest tries to switch spinlocks to bare metal
    behavior (e.g. by setting "xen_nopvspin" on XEN platform and
    "hv_nopvspin" on HYPER_V).

    That feature is missed on KVM, add a new parameter "nopvspin" to disable
    PV spinlocks for KVM guest.

    The new 'nopvspin' parameter will also replace Xen and Hyper-V specific
    parameters in future patches.

    Define variable nopvsin as global because it will be used in future
    patches as above.

    Signed-off-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
    Reviewed-by: Vitaly Kuznetsov <vkuznets@redhat.com>
    Cc: Jonathan Corbet <corbet@lwn.net>
    Cc: Thomas Gleixner <tglx@linutronix.de>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Borislav Petkov <bp@alien8.de>
    Cc: "H. Peter Anvin" <hpa@zytor.com>
    Cc: Paolo Bonzini <pbonzini@redhat.com>
    Cc: Radim Krcmar <rkrcmar@redhat.com>
    Cc: Sean Christopherson <sean.j.christopherson@intel.com>
    Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
    Cc: Wanpeng Li <wanpengli@tencent.com>
    Cc: Jim Mattson <jmattson@google.com>
    Cc: Joerg Roedel <joro@8bytes.org>
    Cc: Peter Zijlstra <peterz@infradead.org>
    Cc: Will Deacon <will@kernel.org>
    Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2021-11-30 15:42:10 +08:00
Menglong Dong 3a4384db67 bpf: fix double free for btf in map_create()
'btf' is freed by btf_put() in map_create() if map_check_btf() fails.
However, it is freed again in free_map, which cause use-after-free
in the later process.

Fix this by remove redundant btf_put().

Fixes: c421e6e7b3 ("copy part code from commid id 85d33df357b634649ddbe0a20fd2d0fc5732c3cb to linux 5.4 to fix sockhash map creation fail problem")

Signed-off-by: Menglong Dong <imagedong@tencent.com>
2021-11-30 10:38:54 +08:00
caelli b80247552b cgroupfs: support for proc and sys
export files such as cpuinfo, meminfo, stat and so on, which can by used
by containers.

Signed-off-by: caelli <caelli@tencent.com>
Reviewed-by: Peng Hao <flyingpeng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2021-11-01 15:00:06 +08:00
caelli 5990ae24e7 cgroupfs: quota aware support
add quota aware support when showing container
cpuinfo and stat information.

Signed-off-by: caelli <caelli@tencent.com>
Reviewed-by: Peng Hao <flyingpeng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2021-11-01 15:00:06 +08:00
caelli 2d555b2cfe cgroupfs: refactor cgroup resource statistics for reuse.
Signed-off-by: caelli <caelli@tencent.com>
Reviewed-by: Peng Hao <flyingpeng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2021-11-01 15:00:06 +08:00
markwhwu 112b81aef0 sched: disable sched_auto_group by default
Autogroup is optimized for desktop interaction and is obviously a negative optimization for UnixBench

Signed-off-by: Mark Whwu <markwhwu@tencent.com>
2021-10-29 08:50:28 +00:00
Bin Lai f91939a5b3 sli/cpu: introduce sli max latency metrics
Sli max latency is lightweight latency monitor metrics, the monitor
tool could get the data with a little overhead. And the accuracy of
the metrics is controlled by the sampling frequency of the monitor
tool. When the performance jitter was occurred in the system, we can
get some help from these lateny metris.

Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: benbjiang<benbjiang@tencent.com>
Reviewed-by: Mengmeng Chen <bauerchen@tencent.com>
Reviewed-by: mungerjiang <mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00
mungerjiang 95a8c85b7f sli/cpu: introduce longsys check
When a process is running in the system space, it cann't be preempted until
it return to userspace, even if the process should be reschedule and other
process was ready to run(because the server system close the kernel preempt
by default). This schedule delay may impact the performance of waiting process,
therefor we introduce the longsys check to collect the schedule delay information
of process. The longsys indication could help us spot the possible performance
jitter in the system.

Signed-off-by: Munger jiang <mungerjiang@tencent.com>
Signed-off-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: benbjiang<benbjiang@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2021-10-29 06:51:52 +00:00
mungerjiang a76d37e2f4 sli: enable sli in cgroup v1
Signed-off-by: Munger jiang <mungerjiang@tencent.com>
Reviewed-by: Bauerchen <bauerchen@tencent.com>
2021-10-29 06:51:52 +00:00
mungerjiang 674dd9febe sli: fix sli_memlat_stat_start bug
Fix the issue that sli_no_enabled is true in sli_memlat_stat_start,
but sli_no_enabled is false in sli_memlat_stat_end,if *start* is
not zero,sli_memlat_stat_end would get a bad stat.

Signed-off-by: Munger jiang <mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00
mungerjiang 3585e8f134 sli/cpu: Add sched latency account
Signed-off-by: Munger jiang <mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00
Bin Lai b879b1b64b sli: Introduce memory and sched latency stat infrastructure
Signed-off-by: Munger jiang <mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00
Bauerchen c44986b358 tqos/cpu: load.r/load.d support cgroup V2
Signed-off-by: Bauerchen <bauerchen@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2021-10-29 06:51:52 +00:00
Bauerchen 8003819c11 tqos/cpu: add cgroup load.r/load.d statistic
Now cgroup loadavg calcuted according processes in R state and D state,
sometimes we need more specific information, so just calcuting loadavg
separately.

Line2 is load.r and line3 is load.d. When most process
do IO operation and we may get the output like this:

[root@VM-130-27-centos test]# cat cpuset.loadavg
20.03 9.85 3.88 1/339 3852
6.56 3.96 1.62
13.46 5.89 2.27

Signed-off-by: Bauerchen <bauerchen@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2021-10-29 06:51:52 +00:00
Bauerchen c07a089a0f tqos/mbuf: export mbuf interface to cpuacct subsys
In cgroup V1, mbuf only exist in cpuacct subsys, so we may need a help
function to store buffer just according process task_struct.

Signed-off-by: Bauerchen <bauerchen@tencent.com>
Reviewed-by: mungerjiang<mungerjiang@tencent.com>
Reviewed-by: benbjiang<benbjiang@tencent.com>
2021-10-29 06:51:52 +00:00
Bauerchen f813e65898 tqos/mbuf: alloc mbuf slot for cpuacct in cgroup V1
Mbuf support cgroup V1, to compatible with cgroup V2, we only export it
to cpuacct subsys.

Signed-off-by: Bauerchen <bauerchen@tencent.com>
Reviewed-by: mungerjiang<mungerjiang@tencent.com>
Reviewed-by: benbjiang<benbjiang@tencent.com>
2021-10-29 06:51:52 +00:00
Bauerchen 7795ccbf82 tqos/mbuf: write a help function to get cgroup struct from task_struct.
In order to support cgroup V1 with mbuf and sli, we need a special
cgroup structure, cpuacct subsys cgroup is nice.

We only prepare mbuf and sli for cpuacct cgroup in V1. so first find cpuacct
cgroup and if return NULl or root, just find df1_cgrp.

Signed-off-by: Bauerchen <bauerchen@tencent.com>
Reviewed-by: mungerjiang<mungerjiang@tencent.com>
Reviewed-by: mungerjiang<mungerjiang@tencent.com>
2021-10-29 06:51:52 +00:00
Bauerchen 7600f2ca44 tqos/rqm: Tencent Quality Monitor Buffer
Providing back up buffer for Quality Monitor, can be used to catch key
context when abnormal jitters occur. And application can also use it
to detect system env exception.

Signed-off-by: Bauerchen <bauerchen@tencent.com>
Reviewed-by: Jiang Biao <benbjiang@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
2021-10-29 06:51:52 +00:00
linuszeng 06d37efeef mm: pagecache limit per cgroup support
Signed-off-by: Chen Xiaoguang <xiaoggchen@tencent.com>
Signed-off-by: Zeng Jingxiang <linuszeng@tencent.com>
Reviewed-by: Bin Lai <robinlai@tencent.com>
Reviewed-by: bauerchen <bauerchen@tencent.com>
2021-10-11 14:11:13 +08:00
Kaixu Xia 38e331e321 locking/percpu-rwsem: Use this_cpu_{inc,dec}() for read_count
The __this_cpu*() accessors are (in general) IRQ-unsafe which, given
that percpu-rwsem is a blocking primitive, should be just fine.

However, file_end_write() is used from IRQ context and will cause
load-store issues on architectures where the per-cpu accessors are not
natively irq-safe.

Fix it by using the IRQ-safe this_cpu_*() for operations on
read_count. This will generate more expensive code on a number of
platforms, which might cause a performance regression for some of the
other percpu-rwsem users.

If any such is reported, we can consider alternative solutions.

Fixes: 70fe2f48152e ("aio: fix freeze protection of aio writes")
Signed-off-by: Hou Tao <houtao1@huawei.com>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Will Deacon <will@kernel.org>
Acked-by: Oleg Nesterov <oleg@redhat.com>
Link: https://lkml.kernel.org/r/20200915140750.137881-1-houtao1@huawei.com
2021-07-15 15:53:01 +08:00
denisecheng 320a3efd01 kabi: reserve space for kabi
Signed-off-by: denisecheng <denisecheng@tencent.com>
Signed-off-by: denisecheng <denisecheng@tencent.com>
2021-06-23 07:24:18 +00:00
Fuhai Wang ee465ed14b kabi: check modver major version and features
if module name contains "hotfix" or "patch", must match entirely,
otherwise, only match major verion(5.4.32-19-0001) and features(
SMP mod_unload modversions aarch64).

vermagic:       5.4.32-19-0001.1 SMP mod_unload modversions aarch64

Signed-off-by: Denise Cheng <denisecheng@tencent.com>
Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
2021-06-23 07:24:18 +00:00
Kaixu Xia d253516e87 Revert "modules: mark ref_module static"
This reverts commit af16ca3bc7.
2021-05-21 10:00:22 +08:00
Kaixu Xia d75c0e3a62 Revert "modules: mark find_symbol static"
This reverts commit d102b9453d.
2021-05-21 10:00:12 +08:00
Kaixu Xia b47921f414 Revert "modules: mark each_symbol_section static"
This reverts commit 76acd9d24f.
2021-05-21 10:00:03 +08:00
Kaixu Xia 51caa74f55 Revert "modules: unexport __module_text_address"
This reverts commit 6642054196.
2021-05-21 09:59:51 +08:00
Kaixu Xia 16de1e7f83 Revert "modules: unexport __module_address"
This reverts commit 38a90952b3.
2021-05-21 09:59:41 +08:00
Kaixu Xia c08c9f8424 Revert "modules: rename the licence field in struct symsearch to license"
This reverts commit ae76e6b5ef.
2021-05-21 09:59:29 +08:00
Kaixu Xia d074d452b3 Revert "modules: return licensing information from find_symbol"
This reverts commit 95f888c25e.
2021-05-21 09:59:19 +08:00
Kaixu Xia bc971dc752 Revert "modules: inherit TAINT_PROPRIETARY_MODULE"
This reverts commit bcd7de3c8b.
2021-05-21 09:59:08 +08:00
Kaixu Xia 3de26e052c smp: Fix smp_call_function_single_async prototype
commit 1139aeb1c521eb4a050920ce6c64c36c4f2a3ab7 upstream.

As of commit 966a967116e6 ("smp: Avoid using two cache lines for struct
call_single_data"), the smp code prefers 32-byte aligned call_single_data
objects for performance reasons, but the block layer includes an instance
of this structure in the main 'struct request' that is more senstive
to size than to performance here, see 4ccafe032005 ("block: unalign
call_single_data in struct request").

The result is a violation of the calling conventions that clang correctly
points out:

block/blk-mq.c:630:39: warning: passing 8-byte aligned argument to 32-byte aligned parameter 2 of 'smp_call_function_single_async' may result in an unaligned pointer access [-Walign-mismatch]
                smp_call_function_single_async(cpu, &rq->csd);

It does seem that the usage of the call_single_data without cache line
alignment should still be allowed by the smp code, so just change the
function prototype so it accepts both, but leave the default alignment
unchanged for the other users. This seems better to me than adding
a local hack to shut up an otherwise correct warning in the caller.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Acked-by: Jens Axboe <axboe@kernel.dk>
Link: https://lkml.kernel.org/r/20210505211300.3174456-1-arnd@kernel.org
[nc: Fix conflicts]
Signed-off-by: Nathan Chancellor <nathan@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-05-20 16:08:01 +08:00