Commit Graph

292 Commits

Author SHA1 Message Date
frankjpliu 6bd26b3101
Merge pull request #235 from peaceforeverCN/master
kernel: config pci reset quirk by cmdline
2022-08-08 15:07:26 +08:00
leolingli a88d1328fa kernel: config pci reset quirk by cmdline
[desc]:
can use cmdline in grub to:
  1). custom set sleep time after device reset.
      e.g. pcireset_quirk=timeout,vid1:did1=t1,vid2:did2=t2
      this will set t1 second sleep after vid1:did1 device reset and so do vid2:did2
      use to solve zixiao gpu reset problem.
  2). return 0 directly when device reset.
      e.g. pcireset_quirk=noreset,vid1:did1,vid2:did2
      this will return 0 when vid1:did1 device reset and so do vid2:did2
      use to solve 2080Ti & 3070 GPU reset cause ff problem.

Signed-off-by: leolingli <leolingli@tencent.com>
Signed-off-by: snailzhao <snailzhao@tencent.com>
2022-07-04 11:53:29 +08:00
yongduan 33347536c7 backport wake affine upstream optimization
[upstream]
7332dec0 sched/fair: Only immediately migrate tasks due to interrupts
         if prev and target CPUs share cache
806486c3 sched/fair: Do not migrate if the prev_cpu is idle
082f764a sched/fair: Do not migrate on wake_affine_weight() if weights
         are equal
d8fcb81f sched/fair: Check for idle core in wake_affine

Signed-off-by: yongduan <yongduan@tencent.com>
2021-03-17 08:58:32 +00:00
kaixuxiakx f45a183605
Merge pull request #52 from duanery/enable_squashfs_zlib
squashfs: enable CONFIG_SQUASHFS_ZLIB
2021-01-25 04:38:47 +00:00
yongduan 40b567175e squashfs: enable CONFIG_SQUASHFS_ZLIB
Refer to the config of centos 8

Signed-off-by: yongduan <yongduan@tencent.com>
2021-01-19 20:32:08 +08:00
kaixuxiakx d0c5d33465
Merge pull request #45 from silenceshell/patch-1
fix a typo
2021-01-11 04:50:50 +00:00
kaixuxiakx 7a3176fd51
Merge pull request #49 from Tencent/lennychen-virtblk
virtblk: fix io hang in hotplug scenario
2021-01-11 03:33:38 +00:00
kaixuxiakx 5d30195b1f
Merge pull request #47 from duanery/enable_cachefiles
enable CONFIG_CACHEFILES
2021-01-11 03:13:06 +00:00
Lei Chen b5d85c9684 PCI: Probe bridge window attributes once at enumeration-time
upstream: 51c48b310183ab6ba5419edfc6a8de889cc04521

pci_bridge_check_ranges() determines whether a bridge supports the optional
I/O and prefetchable memory windows and sets the flag bits in the bridge
resources.  This *could* be done once during enumeration except that the
resource allocation code completely clears the flag bits, e.g., in the
pci_assign_unassigned_bridge_resources() path.

The problem with pci_bridge_check_ranges() in the resource allocation path
is that we may allocate resources after devices have been claimed by
drivers, and pci_bridge_check_ranges() *changes* the window registers to
determine whether they're writable.  This may break concurrent accesses to
devices behind the bridge.

Add a new pci_read_bridge_windows() to determine whether a bridge supports
the optional windows, call it once during enumeration, remember the
results, and change pci_bridge_check_ranges() so it doesn't touch the
bridge windows but sets the flag bits based on those remembered results.

Signed-off-by: Lei Chen <lennychen@tencent.com>
2020-12-25 15:38:45 +08:00
Lei Chen 8cc9daaef1 virtblk: print useful info for timeout scenario
Signed-off-by: Lei Chen <lennychen@tencent.com>
2020-12-25 15:38:30 +08:00
herberthbli fcc70b0ae7
Merge pull request #46 from Tencent/herberthbli
acpi: disable AMD ghes timer
2020-12-15 09:27:33 +08:00
yongduan 15b0aa0d7f enable CONFIG_CACHEFILES
Signed-off-by: yongduan <yongduan@tencent.com>
2020-12-14 20:27:03 +08:00
Hongbo Li 585426ae3f acpi: disable AMD ghes timer
This timer will cause big schedule latency and network delay
on AMD machine.

Signed-off-by: Hongbo Li <herberthbli@tencent.com>
2020-12-14 09:56:58 +08:00
silenceshell 399d595926
fix a typo 2020-12-08 00:17:28 +08:00
gxm-newtonf b0ddb0c1b1
Merge pull request #43 from duanery/rps_using_pvipi
Rps using pvipi
2020-12-02 11:02:46 +08:00
herberthbli 0a971cab83
Merge pull request #41 from Tencent/herberthbli
netfilter: add ip6tables nat support
2020-12-01 17:43:24 +08:00
cquyx 40778f99ce
Merge pull request #44 from Tencent/fix-sysctl_conn_reuse_old_conntrack
bugfix: since a01a9445c0, ipvs sysctl have been missing sysctl swi…
2020-12-01 11:33:51 +08:00
YangYuxi 5415d2c6c6 bugfix: since a01a9445c0, ipvs sysctl have been missing sysctl switch 'conn_reuse_old_conntrack', that lead a switch dislocation
Signed-off-by: YangYuxi <yx.atom1@gmail.com>
2020-12-01 10:40:04 +08:00
yongduan 772d6366c7 net: rps using pvipi
In the virtualization scenario, you can use pvipi to optimize the sending of
IPI interrupts and reduce the number of vmexit.

rps_using_pvipi test
Test guest: 32 core, 64G memory, virtio-net 8 queues, rss interrupt is bound
to 24-31 core. Observe the number of vmexit of 31 cores.

1. 1000000pps
100 iperf instances, 10000pps per instance.
disable rps_using_pvipi  68077 vmexit/s
enable  rps_using_pvipi  21138 vmexit/s

2. 2000000pps
1000 iperf instances, 2000pps per instance.
disable rps_using_pvipi  40879 vmexit/s
enable  rps_using_pvipi  9195  vmexit/s

3. 2000000pps
2000 iperf instances, 1000pps per instance.
disable rps_using_pvipi  24746 vmexit/s
enable  rps_using_pvipi  7292  vmexit/s

Enabling rps_using_pvipi can greatly reduce the number of vmexit.

Signed-off-by: yongduan <yongduan@tencent.com>
2020-12-01 10:36:20 +08:00
yongduan 3853775fa6 smp: smp_call_function_many_async
Run an asynchronous function on a many cpus.
smp_call_function_many_async_begin
for_each_csd
        smp_call_function_many_async
smp_call_function_many_async_end

Signed-off-by: yongduan <yongduan@tencent.com>
2020-12-01 10:34:56 +08:00
Hongbo Li 16d1c13cad netfilter: add ip6tables nat support
Open CONFIG_IP6_NF_NAT

Signed-off-by: Hongbo Li <herberthbli@tencent.com>
2020-11-30 11:24:43 +08:00
heddchen 9c2652e3d8
Merge pull request #37 from Tencent/zgpeng
proc: fix the display error of the processes field in /proc/stat
2020-11-12 15:49:13 +08:00
zgpeng 8cbbd36a38 proc: fix the display error of the processes field in /proc/stat
Signed-off-by: zhiguang peng <zgpeng@tencent.com>
2020-11-12 14:39:06 +08:00
He Chen 94dd9ddb7e sched: fix offline task inheritance issue
Signed-off-by: heddchen <heddchen@tencent.com>
2020-11-10 17:47:17 +08:00
gxm-newtonf 49d407b7ec
Merge pull request #36 from kenieevan/master
fix regression bug cause by ipvs_mode=2 patch
2020-10-28 11:41:50 +08:00
gxm-newtonf a26f554ca5
Merge pull request #35 from charliecgxu/softirq
softirq: enhance network latency
2020-10-28 11:16:06 +08:00
jianmingfan dd5565b819 fix regression bug cause by ipvs_mode=2 patch
reason: in ipvs_mode ==1 , skb_rtable is ip_vs_nat_xmit is null.
Test case: test bpf mode nodeport ok!

Signed-off-by: jianmingfan <jianmingfan@tencent.com>
2020-10-26 18:53:40 +08:00
gxm-newtonf 55bfc23121
Merge pull request #34 from charliecgxu/memcg
memcg: add scheduling point while showing memcg usage
2020-10-20 14:06:00 +08:00
charliecgxu f7860a5c86 softirq: enhance network latency
Enhance network tail latency by directly handling softirq
when detecting long scheduling latency of ksoftirqd.

Signed-off-by: yongduan <yongduan@tencent.com>
Signed-off-by: charliecgxu <charliecgxu@tencent.com>
2020-10-16 11:55:22 +08:00
charliecgxu 61219f7c16 memcg: add scheduling point while showing memcg usage
Without preemption, if syscall excutes too long it will significantly
affect performance of other important processes. So add a shceduling
point when showing root memcg usage.

Signed-off-by: yongduan <yongduan@tencent.com>
Signed-off-by: charliecgxu <charliecgxu@tencent.com>
2020-10-13 10:13:59 +08:00
Xiaoming Gao 58236eda44 config: fix silent config
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-09-23 19:20:03 +08:00
gxm-newtonf 524899fd2b
Merge pull request #25 from donhui/patch-1
doc: images use relative paths
2020-09-23 19:14:45 +08:00
gxm-newtonf e753cb606a
Merge pull request #31 from oilbeater/config-geneve
config: enable geneve
2020-09-23 19:10:50 +08:00
Or Cohen 1a66a0ddc2 net/packet: fix overflow in tpacket_rcv
upstream: acf69c9

Using tp_reserve to calculate netoff can overflow as
tp_reserve is unsigned int and netoff is unsigned short.

This may lead to macoff receiving a smaller value then
sizeof(struct virtio_net_hdr), and if po->has_vnet_hdr
is set, an out-of-bounds write will occur when
calling virtio_net_hdr_from_skb.

The bug is fixed by converting netoff to unsigned int
and checking if it exceeds USHRT_MAX.

This addresses CVE-2020-14386

Fixes: 8913336a7e8d ("packet: add PACKET_RESERVE sockopt")
Signed-off-by: Or Cohen <orcohen@paloaltonetworks.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
2020-09-23 19:07:29 +08:00
Fuhai Wang 1508b30ad8 inet: unconstify ipv6_mapped and tcp_request_sock_ipv4/6_ops
Signed-off-by: Fuhai Wang <fuhaiwang@tencent.com>
2020-09-23 19:07:10 +08:00
fuhaiwang d4619cc0fc
Merge pull request #24 from kenieevan/master
introduce ipvs_mode to share ipvs service and connection between network namespace
2020-09-23 19:02:00 +08:00
Chen Xiaoguang 71b4de4965 sched: get rq->lock before changing cpu limit of offline task
Signed-off-by: Xiaoguang Chen <xiaoggchen@tencent.com>
Signed-off-by: He Chen <xiaoggchen@tencent.com>
2020-09-22 11:13:54 +08:00
Oilbeater e784685688
config: enable geneve 2020-09-16 10:30:14 +08:00
Xiaoming Gao 7b0b2d84b9 config: disable bt sched
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-09-14 16:59:33 +08:00
Xiaoming Gao b6b1feb590 sched: fix build error when CONFIG_BT_GROUP_SCHED disabled
Signed-off-by: Xiaoming Gao <newtongao@tencent.com>
2020-09-14 16:58:39 +08:00
He Chen a6fc45b598 sched: remove bt_rq->nr_running check during pick_next_task_bt
Signed-off-by: He Chen <heddchen@tencent.com>
2020-09-14 16:05:49 +08:00
He Chen 46dedbcaa0 sched: sync child based on tg->offline after fork
Signed-off-by: Xiaoguang Chen <xiaoggchen@tencent.com>
Signed-off-by: Zhiguang Peng <zgpeng@tencent.com>
Signed-off-by: He Chen <heddchen@tencent.com>
2020-09-14 16:05:46 +08:00
Chunguang Xu fe12e6a602 ovl: ignore failure to copy up unknown xattrs
commit <7062884546a14d785c9ff6152964058211436999>

This issue came up with NFSv4 as the lower layer, which generates
"system.nfs4_acl" xattrs (even for plain old unix permissions).  Prior to
this patch this prevented copy-up from succeeding.

The overlayfs permission model mandates that permissions are checked
locally for the task and remotely for the mounter(*).  NFS4 ACLs are not
supported by the Linux kernel currently, hence they cannot be enforced
locally.  Which means it is indifferent whether this attribute is copied or
not.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Chunguang Xu 43c1da6894 blk-wbt: improve waking of tasks
commit <ffa358dcaae1f2f00926484e712e06daa8953cb4>
commit <b78820937b4762b7d30b807d7156bec1d89e4dd3>
commit <c45e6a037a536530bd25781ac7c989e52deb2a63>
commit <38cfb5a45ee013bfab5d1ae4c4738815e744b440>

We have two potential issues:

1) After commit 2887e41b910b, we only wake one process at the time when
   we finish an IO. We really want to wake up as many tasks as can
   queue IO. Before this commit, we woke up everyone, which could cause
   a thundering herd issue.

2) A task can potentially consume two wakeups, causing us to (in
   practice) miss a wakeup.

Fix both by providing our own wakeup function, which stops
__wake_up_common() from waking up more tasks if we fail to get a
queueing token. With the strict ordering we have on the wait list, this
wakes the right tasks and the right amount of tasks.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Chunguang Xu f0c2827b13 blk-wbt: avoid lock contention and thundering herd issue in wbt_wait
commit <2887e41b910bb14fd847cf01ab7a5993db989d88>

At present, wbt's wake-up mechanism for wait_queue can induce
thundering herd issue and intense lock competition. In the
context of ipi, this may induce hard lockup.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Jeffle Xu fed21924a9 ext4: fix error pointer dereference
Don't pass error pointers to brelse().

commit 7159a986b420 ("ext4: fix some error pointer dereferences") has fixed
some cases, fix the remaining one case.

Once ext4_xattr_block_find()->ext4_sb_bread() failed, error pointer is
stored in @bs->bh, which will be passed to brelse() in the cleanup
routine of ext4_xattr_set_handle(). This will then cause a NULL panic
crash in __brelse().

BUG: unable to handle kernel NULL pointer dereference at 000000000000005b
RIP: 0010:__brelse+0x1b/0x50
Call Trace:
 ext4_xattr_set_handle+0x163/0x5d0
 ext4_xattr_set+0x95/0x110
 __vfs_setxattr+0x6b/0x80
 __vfs_setxattr_noperm+0x68/0x1b0
 vfs_setxattr+0xa0/0xb0
 setxattr+0x12c/0x1a0
 path_setxattr+0x8d/0xc0
 __x64_sys_setxattr+0x27/0x30
 do_syscall_64+0x60/0x250
 entry_SYSCALL_64_after_hwframe+0x49/0xbe

In this case, @bs->bh stores '-EIO' actually.

Fixes: fb265c9cb49e ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases")
Signed-off-by: Jeffle Xu <jefflexu@linux.alibaba.com>
Reviewed-by: Joseph Qi <joseph.qi@linux.alibaba.com>
Cc: stable@kernel.org # 2.6.19
Reviewed-by: Ritesh Harjani <riteshh@linux.ibm.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Link: https://lore.kernel.org/r/1587628004-95123-1-git-send-email-jefflexu@linux.alibaba.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Dan Carpenter e529017e7f ext4: fix some error pointer dereferences
We can't pass error pointers to brelse().

Fixes: fb265c9cb49e ("ext4: add ext4_sb_bread() to disambiguate ENOMEM cases")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Chunguang Xu 0916c3f20e ext4: optimize the calculation of inode prealloc-list length
We have limited the length of the inode prealloc list, and here are
some optimizations for the calculation of the length of the list.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Chunguang Xu 13d46976f1 ext4: limit the length of per-inode prealloc list
In the scenario of writing sparse files, the Per-inode prealloc list may
be very long, resulting in high overhead for ext4_mb_use_preallocated().
To circumvent this problem, we limit the maximum length of per-inode
prealloc list to 512 and allow users to modify it.

Signed-off-by: Chunguang Xu <brookxu@tencent.com>
2020-09-11 14:22:55 +08:00
Wang Donghui 412da06771
doc: images use relative paths
images use relative paths to avoid breaking images in gitee
2020-09-09 10:18:01 +08:00