Commit Graph

119 Commits

Author SHA1 Message Date
Xiaoming Gao f540f245de vm: fix isolate max_map_count, inherit the value of the parent namespace instead
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-21 12:05:14 +08:00
gxm-newtonf f9a96d3888
Update README.md 2020-01-06 21:21:35 +08:00
Xiaoming Gao 81b4291d63 update README.md
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-06 10:42:58 +08:00
Xiaoming Gao f02ca9df3d images: upload README.md images
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-06 10:28:49 +08:00
Xiaoming Gao 60e7ef954f add README.md
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 15:34:32 +08:00
Xiaoming Gao 42c43458cb tools: add ttools module to support ptrace protect
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 15:12:03 +08:00
Kaixu Xia 1876e64019 ext4: fix the DIO performance regression
The commit 16c54688592c ("ext4: Allow parallel DIO reads")
causes significant performance regression in mixed random
read/write scenario since the implementation is incomplete,
so revert it.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
2020-01-02 14:56:17 +08:00
? jiang 2212bdbc80 virtio-net: lower min ring num_free for efficiency
This change lowers ring buffer reclaim threshold from 1/2*queue to budget
for better performance. According to our test with qemu + dpdk, packet
dropping happens when the guest is not able to provide free buffer in
avail ring timely with default 1/2*queue. The value in the patch has been
tested and does show better performance.

Test setup: iperf3 to generate packets to guest (total 30mins, pps 400k, UDP)
avg packets drop before: 2842
avg packets drop after: 360(-87.3%)

Further, current code suffers from a starvation problem: the amount of
work done by try_fill_recv is not bounded by the budget parameter, thus
(with large queues) once in a while userspace gets blocked for a long
time while queue is being refilled. Trigger refills earlier to make sure
the amount of work to do is limited.

Signed-off-by: jiangkidd <jiangkidd@hotmail.com>
Acked-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Michael S. Tsirkin <mst@redhat.com>
2020-01-02 14:55:55 +08:00
Jan Kara 45fbf48774 ext4: fix crash during online resizing
backport from upstream commit f96c3ac8dfc2.

When computing maximum size of filesystem possible with given number of
group descriptor blocks, we forget to include s_first_data_block into
the number of blocks. Thus for filesystems with non-zero
s_first_data_block it can happen that computed maximum filesystem size
is actually lower than current filesystem size which confuses the code
and eventually leads to a BUG_ON in ext4_alloc_group_tables() hitting on
flex_gd->count == 0. The problem can be reproduced like:

truncate -s 100g /tmp/image
mkfs.ext4 -b 1024 -E resize=262144 /tmp/image 32768
mount -t ext4 -o loop /tmp/image /mnt
resize2fs /dev/loop0 262145
resize2fs /dev/loop0 300000

Fix the problem by properly including s_first_data_block into the
computed number of filesystem blocks.

Fixes: 1c6bd7173d66 "ext4: convert file system to meta_bg if needed..."
Signed-off-by: Jan Kara <jack@suse.cz>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@vger.kernel.org
2020-01-02 14:55:43 +08:00
Fuhai Wang 6e3844c591 nsfs: fix netns proc warning
There are two issues in commit a0210fd669343660fc7481f2f422439dba19336c(auth_gss fix:
rpcsec_gss_exit_net has no chance to run when use-gss-proxy==1):
1. there is no chance to remove use-gss-proxy entry when use-gss-proxy does not write to 1.
2. netns evict function should be called earlier than exit function.

error log:
remove_proc_entry: removing non-empty directory 'net/rpc', leaking at least 'use-gss-proxy'
------------[ cut here ]------------
WARNING: CPU: 36 PID: 7509 at /data/rpmbuild/BUILD/kernel-4.14.105/kernel-4.14.105/fs/proc/generic.c:572 remove_proc_entry+0x1
Modules linked in: xt_nat ipt_REJECT nf_reject_ipv4 ip_set ip_vs_sh ip_vs_wrr ip_vs_rr ip_vs xt_comment xt_mark ipt_MASQUERADE
CPU: 36 PID: 7509 Comm: kworker/u128:2 Tainted: G        W       4.14.105-19-beta4 #1
Hardware name: Huawei TaiShan 2280 /BC11SPCD, BIOS 1.53 07/04/2018
Workqueue: netns cleanup_net
task: ffff808fd7cd7000 task.stack: ffff0000253f0000
PC is at remove_proc_entry+0x100/0x138
LR is at remove_proc_entry+0x100/0x138
pc : [<ffff00000830b500>] lr : [<ffff00000830b500>] pstate: 00000145
sp : ffff0000253f3c70
x29: ffff0000253f3c70 x28: 0000000000000000
x27: ffff808fcc4b5038 x26: dead000000000200
x25: ffff0000253f3da0 x24: ffff0000253f3db0
x23: ffff0000091dd280 x22: ffff801c2b94b000
x21: ffff000009303000 x20: ffff000000bba380
x19: ffff801cef676a00 x18: 000000000000002a
x17: 0000000000000030 x16: ffff000008156e30
x15: 0000000000000000 x14: 656c20746120676e
x13: 696b61656c202c27 x12: 6370722f74656e27
x11: 2079726f74636572 x10: 6964207974706d65
x9 : ffff0000081cc960 x8 : 0000000000000004
x7 : ffff000009242000 x6 : 0000000000007a06
x5 : 0000000000000000 x4 : 0000000000000000
x3 : 0000000000000000 x2 : ffff808ffbeee3c8
x1 : 0000808ff2e14000 x0 : 000000000000005b
Call trace:
Exception stack(0xffff0000253f3b30 to 0xffff0000253f3c70)
3b20:                                   000000000000005b 0000808ff2e14000
3b40: ffff808ffbeee3c8 0000000000000000 0000000000000000 0000000000000000
3b60: 0000000000007a06 ffff000009242000 0000000000000004 ffff0000081cc960
3b80: 6964207974706d65 2079726f74636572 6370722f74656e27 696b61656c202c27
3ba0: 656c20746120676e 0000000000000000 ffff000008156e30 0000000000000030
3bc0: 000000000000002a ffff801cef676a00 ffff000000bba380 ffff000009303000
3be0: ffff801c2b94b000 ffff0000091dd280 ffff0000253f3db0 ffff0000253f3da0
3c00: dead000000000200 ffff808fcc4b5038 0000000000000000 ffff0000253f3c70
3c20: ffff00000830b500 ffff0000253f3c70 ffff00000830b500 0000000000000145
3c40: ffff801c2b94b08d ffff801cef676a8d ffffffffffffffff 0000000000000000
3c60: ffff0000253f3c70 ffff00000830b500
[<ffff00000830b500>] remove_proc_entry+0x100/0x138
[<ffff000000badba0>] rpc_proc_exit+0x40/0x50 [sunrpc]
[<ffff000000ba3524>] sunrpc_exit_net+0x34/0x40 [sunrpc]
[<ffff000008a03784>] ops_exit_list.isra.3+0x4c/0x80
[<ffff000008a04170>] cleanup_net+0x1b0/0x2c0
[<ffff0000080e8558>] process_one_work+0x1f8/0x420
[<ffff0000080e87cc>] worker_thread+0x4c/0x470
[<ffff0000080eed7c>] kthread+0x134/0x138
[<ffff000008084f7c>] ret_from_fork+0x10/0x1c

Fixes: a0210fd669343660fc7481f2f422439dba19336c ("auth_gss fix: rpcsec_gss_exit_net has no chance to run when use-gss-proxy==1

Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
2020-01-02 14:55:31 +08:00
Kaixu Xia 44a72efebd xfs: Fix deadlock between AGI and AGF when target_ip exists in xfs_rename()
Backport from the mainline kernel:
	commit 93597ae8dac0149b5c00b787cba6bf7ba213e666

Fix deadlock between AGI and AGF when target_ip exists in xfs_rename().

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
[darrick: reword the comment]
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2020-01-02 14:55:23 +08:00
Kaixu Xia f8c4b7aac0 xfs: Fix deadlock between AGI and AGF with RENAME_WHITEOUT
Backport from the mainline kernel:
	commit bc56ad8c74b8588685c2875de0df8ab6974828ef
	commit 3fb21fc8cc04e9a75a426510dfe597f0d0b19134

Fix deadlock between AGI and AGF with RENAME_WHITEOUT.

Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
2020-01-02 14:54:49 +08:00
Fuhai Wang 9d289d8cff epoll: introduce min_wait_time
epoll hrtimer patch may increase loop times if timeout set to 1ms.
This patch add new sysctl control the minimal wait time, and default
to 1 jiffies.

Signed-off-by: Samuel Liao <samuelliao@tencent.com>
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
2020-01-02 14:53:48 +08:00
Fuhai Wang b068df7b27 Revert "epoll: introduce min_wait_time" 2020-01-02 14:53:11 +08:00
Liu Yu 77507cb633 config: Fix version info
Signed-off-by: Liu Yu <allanyuliu@tencent.com>
2020-01-02 14:52:25 +08:00
Fan Bin 314bf3d4ba MMC: Use the device ID implied from device tree
Signed-off-by: Fan Bin <tombinfan@tencent.com>
2020-01-02 14:52:13 +08:00
Fan Bin f030ef831c build: Fix build issue introduced by kpatch
Signed-off-by: Fan Bin <tombinfan@tencent.com>
2020-01-02 14:51:55 +08:00
Fan Bin 305ab65e6d wireless/db: fix error info
Signed-off-by: Fan Bin <tombinfan@tencent.com>
2020-01-02 14:51:30 +08:00
Liu Yu b30d8580b8 arm/myimx6q: init config for myimx6q
Signed-off-by: Liu Yu <allanyuliu@tencent.com>
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 14:50:57 +08:00
Liu Yu f39de73b07 sysctl: fix build issue if CONFIG_CPUSETS disabled
Signed-off-by: Liu Yu <allanyuliu@tencent.com>
2020-01-02 12:24:19 +08:00
Xiaoming Gao 8c11e62b2e arm64/init: Fix crashkernel parse build error
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:24:04 +08:00
Xiaoming Gao 2130287c32 config: open more bpf configs
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:23:56 +08:00
Xiaoming Gao 1159977f4d ceph: quota: report root dir quota usage in statfs
This commit changes statfs default behaviour when reporting usage
statistics.  Instead of using the overall filesystem usage, statfs now
reports the quota for the filesystem root, if ceph.quota.max_bytes has
been set for this inode.  If quota hasn't been set, it falls back to the
old statfs behaviour.

A new mount option is also added ('noquotadf') to disable this behaviour.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:23:38 +08:00
Luis Henriques 2427d4b2e0 ceph: quota: add counter for snaprealms with quota
By keeping a counter with the number of snaprealms that have quota set
allows to optimize the functions that need to walk throught the realms
hierarchy looking for quotas.  Thus, if this counter is zero it's safe to
assume that there are no realms with quota.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:33 +08:00
Luis Henriques ca68edcbf6 ceph: quota: cache inode pointer in ceph_snap_realm
Keep a pointer to the inode in struct ceph_snap_realm.  This allows to
optimize functions that walk the realms hierarchy (e.g. in quotas).

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:30 +08:00
Yan, Zheng 8856144bba ceph: fix root quota realm check
Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:27 +08:00
Yan, Zheng 68803f797c ceph: don't check quota for snap inode
snap inode's i_snap_realm is not pointing to ceph_snap_realm.

Signed-off-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:23 +08:00
Luis Henriques 9cfb319544 ceph: quota: update MDS when max_bytes is approaching
When we're reaching the ceph.quota.max_bytes limit, i.e., when writing
more than 1/16th of the space left in a quota realm, update the MDS with
the new file size.

This mirrors the fuse-client approach with commit 122c50315ed1 ("client:
Inform mds file size when approaching quota limit"), in the ceph git tree.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:20 +08:00
Luis Henriques e90cd3f1b1 ceph: quota: support for ceph.quota.max_bytes
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:18 +08:00
Luis Henriques 915f852a6f ceph: quota: don't allow cross-quota renames
This patch changes ceph_rename so that -EXDEV is returned if an attempt is
made to mv a file between two different dir trees with different quotas
setup.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:14 +08:00
Luis Henriques 4b710dc7c3 ceph: quota: support for ceph.quota.max_files
This patch adds support for the max_files quota.  It hooks into all the
ceph functions that add new filesystem objects that need to be checked
against the quota limits.  When these limits are hit, -EDQUOT is returned.

Note that we're not checking quotas on ceph_link().  ceph_link doesn't
really create a new inode,  and since the MDS doesn't update the directory
statistics when a new (hard) link is created (only with symlinks), they
are not accounted as a new file.

Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:11 +08:00
Luis Henriques 78b249729b ceph: quota: add initial infrastructure to support cephfs quotas
This patch adds the infrastructure required to support cephfs quotas as it
is currently implemented in the ceph fuse client.  Cephfs quotas can be
set on any directory, and can restrict the number of bytes or the number
of files stored beneath that point in the directory hierarchy.

Quotas are set using the extended attributes 'ceph.quota.max_files' and
'ceph.quota.max_bytes', and can be removed by setting these attributes to
'0'.

Link: http://tracker.ceph.com/issues/22372
Signed-off-by: Luis Henriques <lhenriques@suse.com>
Reviewed-by: "Yan, Zheng" <zyan@redhat.com>
Signed-off-by: Ilya Dryomov <idryomov@gmail.com>
2020-01-02 12:23:05 +08:00
Liu Yu 055200e6c8 ceph: Add new mount option req_resend
Which control whether to resend requests if timeout. Further more,
the patch adds a debugfs file which can change this option during mount.

Signed-off-by: Liu Yu <allanyuliu@tencent.com>
2020-01-02 12:22:54 +08:00
Zhang Zhi 805cdc8b06 ceph: re-send osd requests if timeout
When osd requests timeout, the defaut action is discarding all timeout
requests and reseting the connection. It then returns IO errors to
userspace.

The patch re-send all timeout requests instead of discarding,
so that make the timeout transparent to userspace.

Signed-off-by: Liu Yu <allanyuliu@tencent.com>
2020-01-02 12:22:48 +08:00
Zhiguang Peng 0e74e9c6dd sched:fair: fix crash in list_add_leaf_cfs_rq due to bad tmp_alone_branch
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
2020-01-02 12:22:40 +08:00
Xiaoming Gao 46f4a8e68e irq: allow user manage irq affinity
add irq_force_manage to change disable it.

Signed-off-by: Lei Chen <lennychen@tencent.com>
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:22:25 +08:00
Xiaoming Gao 32b932205d kvm: add kvm_no_pv_ipi kernel parameter
add kvm_no_pv_ipi, default is false.

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:22:04 +08:00
Zhiguang Peng d904783fd2 cpuset: add sysctl cpuset_cpuinfo_show_realinfo to switch whether show real cpuinfo or not
IEG need cpuinfo's processor field to start from 0 in docker, so add sysctl
cpuset_cpuinfo_show_realinfo to switch whether cpuinfo's processor
field start from 0 or not.

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
2020-01-02 12:21:58 +08:00
Chen Xiaoguang 77a5c3262b cgroup/cpuset: fix idle compute bug in cpuset.stat
idle calculation error will lead to wrong cpu usage in top

Signed-off-by: Chen Xiaoguang <xiaoggchen@tencent.com>
2020-01-02 12:21:18 +08:00
loobinliu 22bbd5bd41 KVM: X86: Implement PV IPIs in linux guest
Based on upstream commit:
d63bae0 KVM: X86: Add kvm hypervisor init time platform setup callback
aaffcfd KVM: X86: Implement PV IPIs in linux guest

Implement paravirtual apic hooks to enable PV IPIs for KVM if the "send IPI"
hypercall is available.  The hypercall lets a guest send IPIs, with
at most 128 destinations per hypercall in 64-bit mode and 64 vCPUs per
hypercall in 32-bit mode.

Signed-off-by: loobinliu <loobinliu@tencent.com>
2020-01-02 12:21:01 +08:00
brookxu f22307c4c8 cpuset: fixed cpuset.stat process field value exception
The value of the cpuset.stat process field will be abnormal in
some scenarios. The reason for this problem is that the sum of
process_counts may be negative for several cpus.

Signed-off-by: brookxu <brookxu@tencent.com>
2020-01-02 12:20:45 +08:00
Xiaoming Gao 767fc9d7f0 perf: disable --children by default
Signef-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:20:39 +08:00
Xiaoming Gao c715d50029 tcp: make TCP_RTO_MIN/MAX be tunable
tcp_rto_min,tcp_rto_max control the parameters of them.
remember that the min value of tcp_rto_min is 4ms which
be used to be div by RTO_MAX.

Signed-off-by: Shan Wei <davidshan@tencent.com>
Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:20:29 +08:00
Chunguang Xu 88885ab004 dm: add support for blkcg diskstats
add support for blkcg diskstats

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-01-02 12:20:20 +08:00
Chunguang Xu 6a0b7a7959 md: add support for blkcg diskstats
add support for blkcg diskstats

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-01-02 12:20:04 +08:00
Chunguang Xu e7636c1b8b blkcg: add per blkcg diskstats
In order to facilitate each container to obtain its own IO statistics,
we implement per blkcg diskstats and expose some data from the host
into the container such as io_ticks.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-01-02 12:19:49 +08:00
Chunguang Xu fae2070952 cpuacct: get the uptime of container
add cpuacct.uptime interface to get uptime of container

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-01-02 12:19:36 +08:00
Xiaoming Gao 3610625cdd perf/amd: Fixed ROME Perf BUG
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:19:21 +08:00
Xiaoming Gao 2423530faa x86/mce: Handle varying MCA bank counts
merge from AMD

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:19:15 +08:00
Xiaoming Gao 1414675c46 iommu/amd: Add support for IOMMU XT mode
merge from AMD

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:19:07 +08:00