Commit Graph

29 Commits

Author SHA1 Message Date
zgpeng f2ba303dbd vm: add max_map_count isolate switch
Add the max_map_count isolation switch kernel.isolate_max_map_count;
The isolation of max_map_count is turned on by default. If you want
to turn it off, set kernel.isolate_max_map_count to 0;

Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
2020-05-29 10:38:28 +08:00
Samuel Liao 660998b7a9 x86: add hygon family 18h 2020-03-13 19:37:23 +08:00
Lei Chen e8be225280 cgroup: blkio: adjust block io bps limit by weight
Kernel now supports cgroup bps and iops hard limit by io-throttling.
But that's not a scalable way, because block devices' bandwith is
always changing over time.

This patch dynamically adjusts bps limit of each blkio cgroup according
to its pre-set weight. Additionally, if a process has not issued any io
request during a time window, its weight will be shared by other processes
until its next io request.

Signed-off-by: Lei Chen <lennychen@tencent.com>
2020-03-11 11:11:46 +08:00
He Chen f1ac9bd18b sched/bt: add latency factor for bt load
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Hua Liu <shookliu@tencent.com>
Signed-off-by: Xiaogguang Chen <xiaoggchen@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: Bin Fan <tombinfan@tencent.com>
Signed-off-by: He Chen <heddchen@tencent.com>
2020-03-02 22:03:10 +08:00
He Chen 0b667819c3 sched/bt: BT schduler cgroup support
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Hua Liu <shookliu@tencent.com>
Signed-off-by: Xiaogguang Chen <xiaoggchen@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: Bin Fan <tombinfan@tencent.com>
Signed-off-by: He Chen <heddchen@tencent.com>
2020-03-02 22:03:10 +08:00
He Chen 0dd9de2d2b sched/bt: BT scheduler load balance support
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Hua Liu <shookliu@tencent.com>
Signed-off-by: Xiaogguang Chen <xiaoggchen@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: Bin Fan <tombinfan@tencent.com>
Signed-off-by: He Chen <heddchen@tencent.com>
2020-03-02 22:03:09 +08:00
He Chen e6c42e61db sched/bt: BT scheduler bandwidth limit support
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Hua Liu <shookliu@tencent.com>
Signed-off-by: Xiaogguang Chen <xiaoggchen@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: Bin Fan <tombinfan@tencent.com>
Signed-off-by: He Chen <heddchen@tencent.com>
2020-03-02 22:03:09 +08:00
He Chen b48a63ef2c sched: add offline scheduler class
The offline scheduler named BT sched is based on the CFS scheduler. We
also use the rb-tree as the run queue to save the runnable tasks. And the
vruntime concept is also used in the offline scheduler. And the priority
of offline scheduler is from 140 to 179. So now the schedulers in the
kernel are as follows: stop, RT, CFS, BT and idle.

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Hua Liu <shookliu@tencent.com>
Signed-off-by: Xiaogguang Chen <xiaoggchen@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: Bin Fan <tombinfan@tencent.com>
Signed-off-by: He Chen <heddchen@tencent.com>
2020-03-02 22:03:09 +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
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
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
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
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
Xiaoming Gao 3893c04cf1 x86/irq: remapping Move irq remapping mode enum
merge from AMD

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 12:19:01 +08:00
Xiaoming Gao fd8d092e2e Revert "iommu/amd: Support AMD platform with more than 255 CPU"
This reverts commit 7d65c03648b08c4a48fe8ce22fc1aadddcdf8f6f.
2020-01-02 12:18:52 +08:00
Zhiping du aee5a5fcc0 tcp: limit payload size of sacked skbs
[upstream commit 3b4929f65b0d8249f19a50245cd88ed1a2f78cff]

Jonathan Looney reported that TCP can trigger the following crash
in tcp_shifted_skb() :

	BUG_ON(tcp_skb_pcount(skb) < pcount);

This can happen if the remote peer has advertized the smallest
MSS that linux TCP accepts : 48

An skb can hold 17 fragments, and each fragment can hold 32KB
on x86, or 64KB on PowerPC.

This means that the 16bit witdh of TCP_SKB_CB(skb)->tcp_gso_segs
can overflow.

Note that tcp_sendmsg() builds skbs with less than 64KB
of payload, so this problem needs SACK to be enabled.
SACK blocks allow TCP to coalesce multiple skbs in the retransmit
queue, thus filling the 17 fragments to maximal capacity.

CVE-2019-11477 -- u16 overflow of TCP_SKB_CB(skb)->tcp_gso_segs

[upstream commit cd4ffa93f16efea290bb70537f98f518e1927e63]

tcp: fix fack_count accounting on
tcp_shift_skb_data()

v4.15 or since commit 737ff314563 ("tcp: use sequence distance to
detect reordering") had switched from the packet-based FACK tracking
to sequence-based.

v4.14 and older still have the old logic and hence on
tcp_skb_shift_data() needs to retain its original logic and have
@fack_count in sync. In other words, we keep the increment of pcount
with
tcp_skb_pcount(skb) to later used that to update fack_count. To make it
more explicit we track the new skb that gets incremented to pcount in
@next_pcount, and we get to avoid the constant invocation of
tcp_skb_pcount(skb) all together.

Fixes: a5f1faa40101 ("tcp: limit payload size of sacked skbs")

Fixes: 832d11c5cd07 ("tcp: Try to restore large SKBs while SACK processing")

Signed-off-by: Zhiping Du <zhipingdu@tencent.com>
2020-01-02 12:16:23 +08:00
Kaixu Xia de046697ad arm64: implement ftrace with regs by using patchable-function-entry
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
2020-01-02 12:14:57 +08:00
Wenbin Zeng 4caf63c8ab auth_gss fix: rpcsec_gss_exit_net has no chance to run when use-gss-proxy==1
When use-gss-proxy is set to 1, write_gssp will lead to 2 get_net calls
in gssp_rpc_create, the paired put_net calls are supposed to be made
in rpcsec_gss_net_ops->exit i.e. rpcsec_gss_exit_net, but this will
never happen because rpcsec_gss_exit_net (via ops_exit_list) is called
by cleanup_net and cleanup_net will never run unless net->count becomes
0, since the paired put_net calls of gssp_rpc_create are not made yet,
net->count cannot drop to 0. This is dead lock situation.

This fix introduced a new method i.e. evict in struct proc_ns_operations,
which is called in nsfs_evict, moving rpcsec_gss_exit_net into the code
path of nsfs_evict gives it a chance to run.

Signed-off-by: Wenbin Zeng <wenbinzeng@tencent.com>
2020-01-02 12:13:47 +08:00
Shengmiao Liao 74913e31a6 iommu/amd: Support AMD platform with more than 255 CPU
x86: irq_remapping: Move irq remapping mode enum
iommu/amd: Add support for higher 64-bit IOMMU Control Register
iommu/amd: Add support for IOMMU XT mode

Signed-off-by: Shengmiao Liao <samuelliao@tencent.com>
2020-01-02 12:12:33 +08:00
Chunguang Xu e133d113ca pagecachelimit: page cache reclaim asynchronous
add /proc/sys/vm/vm_pagecache_limit_async interface which
allow page caches reclaimed in kpclimitd, it will not consume
work threads runtime, but oom may be occured. it's closed default.

Signed-off-by: Zhiping Du <zhipingdu@tencent.com>
Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-01-02 12:02:39 +08:00
Chunguang Xu 6711b34671 pagecachelimit: limit the pagecache ratio of totalram
limit the pagecache ratio of totalram

Signed-off-by: Zhiping Du <zhipingdu@tencent.com>
Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-01-02 12:01:22 +08:00
Kaixu Xia 954836b8d1 mounts: add shield mountpoint in container support
Add shield mountpoint in container support
$ echo "set /dev/name /mnt/point" >/proc/tkernel/shield_mounts
to shield the mountpoint
$ echo "clear /dev/name /mnt/point" >/proc/tkernel/shield_mounts
to delete the mountpoint shielded

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Weiwei Li <nuonuoli@tencent.com>
Signed-off-by: Kaixu Xia <kaixuxia@tencent.com>
2020-01-02 11:55:00 +08:00
Liu Hua ec970f2dff vm:isolate max_map_count by pid namespace
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: Liu Hua <shookliu@tencent.com>
2020-01-02 11:51:53 +08:00
Liu Hua 8e8d690592 cpuset: add cpuinfo and stat show
We add cpuinfo and stat for each container which
used for docker to get cpu stat just for current
container.

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
Signed-off-by: Weiwei Li <nuonuoli@tencent.com>
Signed-off-by: Liu Hua <shookliu@tencent.com>
2020-01-02 11:46:17 +08:00
Xiaoming Gao 34bbe3bcb8 signal: add print_fatal_signals_src_dst sysctl to switch dump fatal signals from sender side
the print_fatal_signals sysctl can only dump fatal signals from receiver's side,
cannot find who and why send these fatal signals, so add a new sysctl
print_fatal_signals_src_dst to switch dump fatal signals from sender side.

Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 11:44:57 +08:00
Lorin Liu 3dd54ca17c proc: add pid mapping between host and container
create a pid mapping data to parent processes in file  /proc/$PID/status
create a proc file (/proc/$PID/hostinfo), mapping pid data to host pid

Signed-off-by: Lorin Liu <lorinliu@tencent.com>
2020-01-02 11:44:36 +08:00
Xiaoming Gao 78a8c3c2c2 Init Repo base on 4.14.105 long term, and add base tlinux kernel interfaces
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-01-02 10:51:04 +08:00