AskOverflow.Dev

AskOverflow.Dev Logo AskOverflow.Dev Logo

AskOverflow.Dev Navigation

  • 主页
  • 系统&网络
  • Ubuntu
  • Unix
  • DBA
  • Computer
  • Coding
  • LangChain

Mobile menu

Close
  • 主页
  • 系统&网络
    • 最新
    • 热门
    • 标签
  • Ubuntu
    • 最新
    • 热门
    • 标签
  • Unix
    • 最新
    • 标签
  • DBA
    • 最新
    • 标签
  • Computer
    • 最新
    • 标签
  • Coding
    • 最新
    • 标签
主页 / server / 问题

问题[linux-kernel](server)

Martin Hope
ninjab3s
Asked: 2024-05-19 05:53:06 +0800 CST

无法在 5.15.0-1032-realtime 上处理虚拟地址 0000000000000000 处的内核 NULL 指针取消引用错误

  • 5

我正在尝试隔离 ARM64 Ampere (Supermicro) 上的内核以实现实时工作负载。当使用 RT prio 运行工作负载时,我看到以下错误。我不确定此刻出了什么问题。我也不确定该错误是否与我配置的 CPU 隔离有关,或者是否与其他原因有关。该配置在 x86 上运行良好,我已经在 Intel 和 AMD CPU 上进行了测试。有人可以给我提示吗?任何帮助表示赞赏!

May 18 20:38:16 k8s-hp-ampere kernel: Unable to handle kernel NULL pointer dereference at virtual address 0000000000000000
May 18 20:38:16 k8s-hp-ampere kernel: Mem abort info:
May 18 20:38:16 k8s-hp-ampere kernel:   ESR = 0x96000004
May 18 20:38:16 k8s-hp-ampere kernel:   EC = 0x25: DABT (current EL), IL = 32 bits
May 18 20:38:16 k8s-hp-ampere kernel:   SET = 0, FnV = 0
May 18 20:38:16 k8s-hp-ampere kernel:   EA = 0, S1PTW = 0
May 18 20:38:16 k8s-hp-ampere kernel:   FSC = 0x04: level 0 translation fault
May 18 20:38:16 k8s-hp-ampere kernel: Data abort info:
May 18 20:38:16 k8s-hp-ampere kernel:   ISV = 0, ISS = 0x00000004
May 18 20:38:16 k8s-hp-ampere kernel:   CM = 0, WnR = 0
May 18 20:38:16 k8s-hp-ampere kernel: user pgtable: 4k pages, 48-bit VAs, pgdp=000008041899c000
May 18 20:38:16 k8s-hp-ampere kernel: [0000000000000000] pgd=0000000000000000, p4d=0000000000000000
May 18 20:38:16 k8s-hp-ampere kernel: Internal error: Oops: 96000004 [#1] PREEMPT_RT SMP
May 18 20:38:16 k8s-hp-ampere kernel: Modules linked in: vxlan xt_multiport ipt_rpfilter ip_set_hash_net xfrm_user veth wireguard libchacha20poly1305 chacha_neon poly1305_neon libcurve25519_generic libchacha ip6_udp_tunnel udp_tunnel ip6t_REJECT nf_reject_ipv6 nf_conntrack_netlink ipt_REJECT nf_reject_ipv4 xt_addrtype xt_set ip_set_hash_ipportip ip_set_hash_ip ip_set_hash_ipportnet ip_set_bitmap_port ip_set_hash_ipport dummy ip_set xt_MASQUERADE nft_chain_nat nf_nat xt_mark xt_conntrack xt_comment nft_compat nft_counter nf_tables nfnetlink overlay arm_spe_pmu nls_iso8859_1 irdma i40e acpi_ipmi ipmi_ssif arm_dmc620_pmu ipmi_devintf arm_cmn ipmi_msghandler xgene_hwmon arm_dsu_pmu acpi_tad binfmt_misc sch_fq_codel vfio_pci vfio_pci_core irqbypass vfio_virqfd vfio_iommu_type1 vfio br_netfilter bridge stp llc ip_vs_sh ip_vs_wrr ip_vs_rr ip_vs nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 efi_pstore ip_tables x_tables autofs4 btrfs blake2b_generic zstd_compress raid10 raid456 async_raid6_recov async_memcpy async_pq
May 18 20:38:16 k8s-hp-ampere kernel:  async_xor async_tx xor xor_neon raid6_pq libcrc32c raid1 raid0 multipath linear mlx5_ib ib_uverbs ib_core r8153_ecm cdc_ether usbnet r8152 ast drm_vram_helper drm_ttm_helper ttm i2c_algo_bit drm_kms_helper syscopyarea sysfillrect sysimgblt fb_sys_fops cec crct10dif_ce rc_core ghash_ce sha2_ce sha256_arm64 mlx5_core sha1_ce nvme mlxfw mpt3sas psample ixgbe drm raid_class xhci_pci ice xfrm_algo tls nvme_core xhci_pci_renesas scsi_transport_sas mdio aes_neon_bs aes_neon_blk aes_ce_blk crypto_simd cryptd aes_ce_cipher
May 18 20:38:16 k8s-hp-ampere kernel: CPU: 32 PID: 12294 Comm: clang Not tainted 5.15.0-1032-realtime #35-Ubuntu
May 18 20:38:16 k8s-hp-ampere kernel: Hardware name: Supermicro Corporation R12SPD ........../R12SPD, BIOS 1.1a 02/10/2023
May 18 20:38:16 k8s-hp-ampere kernel: pstate: 80400009 (Nzcv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
May 18 20:38:16 k8s-hp-ampere kernel: pc : pipe_write+0x540/0x754
May 18 20:38:16 k8s-hp-ampere kernel: lr : pipe_write+0x50/0x754
May 18 20:38:16 k8s-hp-ampere kernel: sp : ffff800178bb3be0
May 18 20:38:16 k8s-hp-ampere kernel: x29: ffff800178bb3be0 x28: ffff07ffadd0a700 x27: ffff0802fe6c5800
May 18 20:38:16 k8s-hp-ampere kernel: x26: 0000000000000004 x25: 0000000000000000 x24: ffff0802fe6c5850
May 18 20:38:16 k8s-hp-ampere kernel: x23: 0000000000000050 x22: ffff0802f63e8a00 x21: ffff800178bb3cc0
May 18 20:38:16 k8s-hp-ampere kernel: x20: ffffffffffffffee x19: 0000000000000001 x18: 0000000000000000
May 18 20:38:16 k8s-hp-ampere kernel: x17: 0000000000000000 x16: 0000000000000000 x15: 0000000000000000
May 18 20:38:16 k8s-hp-ampere kernel: x14: 0000000000000000 x13: 0000000000000000 x12: 0000000000000000
May 18 20:38:16 k8s-hp-ampere kernel: x11: 0000000000000000 x10: 0000000000000000 x9 : ffffb87036dbe188
May 18 20:38:16 k8s-hp-ampere kernel: x8 : 0000000000000000 x7 : 0000000000000000 x6 : 0000102b143c5eb0
May 18 20:38:16 k8s-hp-ampere kernel: x5 : 0000000000000000 x4 : 0000000000000000 x3 : 0000000000000032
May 18 20:38:16 k8s-hp-ampere kernel: x2 : 0000000000000010 x1 : 0000000000000005 x0 : 0000000000000000
May 18 20:38:16 k8s-hp-ampere kernel: Call trace:
May 18 20:38:16 k8s-hp-ampere kernel:  pipe_write+0x540/0x754
May 18 20:38:16 k8s-hp-ampere kernel:  new_sync_write+0x17c/0x18c
May 18 20:38:16 k8s-hp-ampere kernel:  vfs_write+0x278/0x2e4
May 18 20:38:16 k8s-hp-ampere kernel:  ksys_write+0xe4/0x100
May 18 20:38:16 k8s-hp-ampere kernel:  __arm64_sys_write+0x24/0x30
May 18 20:38:16 k8s-hp-ampere kernel:  invoke_syscall+0x78/0x100
May 18 20:38:16 k8s-hp-ampere kernel:  el0_svc_common.constprop.0+0x54/0x184
May 18 20:38:16 k8s-hp-ampere kernel:  do_el0_svc+0x30/0x9c
May 18 20:38:16 k8s-hp-ampere kernel:  el0_svc+0x30/0x150
May 18 20:38:16 k8s-hp-ampere kernel:  el0t_64_sync_handler+0xa4/0x130
May 18 20:38:16 k8s-hp-ampere kernel:  el0t_64_sync+0x1a4/0x1a8
May 18 20:38:16 k8s-hp-ampere kernel: Code: 8b130341 f140043f 54ffdea8 f9400b00 (f9400002)

5.15.0-1032-realtime我在 Ubuntu 2204 上使用内核。

/proc/cmd_line:

BOOT_IMAGE=/vmlinuz-5.15.0-1032-realtime root=/dev/mapper/ubuntu--vg-ubuntu--lv ro quiet splash processor.max_cstate=0 idle=poll coredump_filter=0x3b nosoftlockup selinux=0 audit=0 skew_tick=1 enforcing=0 crashkernel=auto softlockup_panic=0 sc=nowatchdog hugepagesz=1G hugepages=8 hugepagesz=2M hugepages=0 default_hugepagesz=1G iommu=on nohz=on nohz_full=4-79 kthread_cpus=0-3 irqaffinity=0-3 modprobe.blacklist=mlx5_ib modprobe.blacklist=mlx5_core rcu_nocb_poll rcu_nocbs=4-79

启动脚本的一部分:

  # Set SMP affinity
  for irq in 'ls /proc/irq/'
    do echo 0-3 > /proc/irq/$irq/smp_affinity_list
  done

  # Move RUCOs to housekeeping CPUs
  tuna -t rcu* -c 0-3 -m

  # Disable watchdog timer
  echo 0 > /proc/sys/kernel/watchdog
  echo 65536 > /proc/sys/kernel/watchdog_thresh

  # Offline and online CPUs to move timers to housekeeping: https://www.kernel.org/doc/Documentation/kernel-per-CPU-kthreads.txt
  for cpu in $(seq 4 79)
    do echo 0 > /sys/devices/system/cpu/cpu${cpu}/online
  done
  for cpu in $(seq 4 79)
    do echo 1 > /sys/devices/system/cpu/cpu${cpu}/online
  done

  # Shut down services, whether loaded or unloaded
  systemctl stop cpupower
  systemctl stop irqbalance
  systemctl stop firewalld
  systemctl stop cpuspeed
  systemctl stop cpufreqd
  systemctl stop powerd

  # Disable MCE
  for cpu in $(seq 4 79)
    do echo 0 > /sys/devices/system/machinecheck/machinecheck${cpu}/check_interval
  done

  echo N | tee /sys/module/drm_kms_helper/parameters/poll >/dev/null
  echo performance | tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor >/dev/null

  # Limit CPUs of systemd to housekeeping group
  systemctl set-property init.scope AllowedCPUs=0-3
  # systemctl set-property sytem.slice AllowedCPUs=0-3
  # systemctl set-property user.slice AllowedCPUs=0-3
linux-kernel
  • 1 个回答
  • 71 Views
Martin Hope
João M. S. Silva
Asked: 2022-12-16 03:19:47 +0800 CST

Linux进程按用户调度?

  • 5

Linux 似乎独立于进程的用户来安排进程执行。因此,如果一个用户运行 100 个进程而另一个用户运行 1 个进程,平均而言,第一个用户获得的 CPU 时间是第二个用户的 100 倍。

是否有可能按用户平衡 CPU 时间,也就是说,在此示例中,两个用户都获得 50% 的 CPU 时间?

linux-kernel
  • 2 个回答
  • 30 Views
Martin Hope
Rino Bino
Asked: 2022-04-05 20:01:09 +0800 CST

pxe 引导时使用压缩的 initrd

  • 1

我正在使用带有 grub 的 netboot/pxeboot。

menuentry "Install Ubuntu 20.04" {
  set gfxpayload=keep
  echo 'Loading vmlinuz ...'
  linux  /tftp/vmlinuz ip=dhcp netboot=nfs nfsroot=10.0.0.20:/data/netboot/nfs/ubuntu2004/ boot=casper toram noquiet splash=off console=tty0 console=ttyS1,57600n8 ---
  echo 'Loading initrd, this takes a long time ...'
  initrd /tftp/initrd
}

它工作正常,但是,通过 tftp 加载 initrd 需要很长时间(30 多分钟)。我想压缩(gz/bz2)这个文件以节省一些文件传输时间。

我看到了一些例子,指的是initrd.gz(一个例子:https ://unix.stackexchange.com/questions/217002/which-iso-file-vmlinuz-and-initrd-gz-to-use-for-installing- centos-from-multiboo)但是当我试图用 gzip 压缩文件并使用它时,我收到一个错误,例如:

[   12.543547] VFS: Cannot open root device "(null)" or unknown-block(0,0): error -6
[   12.558487] Please append a correct "root=" boot option; here are the available partitions:
[   12.575161] Kernel panic - not syncing: VFS: Unable to mount root fs on unknown-block(0,0)

有没有办法压缩这个文件,以便它可以传输更小的文件大小,并在尝试挂载根 fs 之前将其解压缩?

或者,有没有办法通过不同的协议(HTTP/FTP/SFTP/SCP/etc)传输它?

boot pxe-boot linux-kernel tftp
  • 2 个回答
  • 490 Views
Martin Hope
valc
Asked: 2021-11-03 21:24:01 +0800 CST

DELL R320、Xeon E5-2450 v1、Oracle Linux 8 将时钟源“tsc”标记为不稳定、负载下随机崩溃

  • 1

我最近获得使用Dell R320,Xeon E5-2450 v1所有固件都使用 . 更新到最新版本Lifecycle controller。在启动 dmesg 报告时:

microcode: microcode updated early to revision 0x71a, date = 2020-03-24 [   12.384040] clocksource: timekeeping watchdog on CPU9: Marking clocksource 'tsc' as unstable because the skew is too large: [  
12.395572] clocksource:                       'hpet' wd_now: 3b1bb82 wd_last: 2e247ff mask: ffffffff [   12.413476] clocksource:            'tsc' cs_now: 1c62267fd4b cs_last: 1c30b8dcf7f mask: ffffffffffffffff [   12.425567] tsc: Marking TSC unstable due to clocksource watchdog [
12.431666] TSC found unstable after boot, most likely due to broken BIOS. Use 'tsc=unstable'.

然后,如果我phoronix-test-suite stress-run stress-ng在 aprox 之后运行系统。一分钟变得没有反应。

在测试期间,我看到来自网络适配器的看门狗事件:

[  705.412997] NETDEV WATCHDOG: eno1 (tg3): transmit queue 0 timed out
[  705.412997] WARNING: CPU: 9 PID: 6812 at net/sched/sch_generic.c:473 dev_watchdog+0x27d/0x281
[  705.412997] Modules linked in: xt_CHECKSUM ipt_REJECT nf_nat_tftp nft_objref nf_conntrack_tftp nft_fib_inet nft_fib_ipv4 nft_fib_ipv6 nft_fib nft_reject_inet nf_reject_ipv4 nf_reject_ipv6 nft_reject nft_ct nf_tables_set tun rfkill scsi_transport_iscsi ip_set xt_conntrack xt_multiport xt_nat xt_addrtype xt_mark xt_MASQUERADE nft_counter xt_comment nft_compat nft_chain_nat nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 veth sunrpc iTCO_wdt intel_rapl_msr iTCO_vendor_support dcdbas intel_rapl_common sb_edac x86_pkg_temp_thermal intel_powerclamp coretemp kvm_intel vfat fat kvm irqbypass crct10dif_pclmul crc32_pclmul mgag200 ghash_clmulni_intel drm_vram_helper aesni_intel ttm crypto_simd cryptd glue_helper drm_kms_helper pcspkr drm syscopyarea sysfillrect sysimgblt fb_sys_fops lpc_ich i2c_algo_bit zfs(POE) joydev zunicode(POE) zzstd(OE) zlua(OE) mei_me zavl(POE) mei icp(POE) zcommon(POE) znvpair(POE) ipmi_ssif spl(OE) ioatdma dca ipmi_si ipmi_devintf ipmi_msghandler acpi_power_meter
[  705.412997]  sch_fq_codel ip_tables xfs libcrc32c sd_mod sg ahci libahci libata mpt3sas tg3 raid_class scsi_transport_sas wmi fuse
[  705.412997] CPU: 9 PID: 6812 Comm: stress-ng Kdump: loaded Tainted: P           OE     5.4.17-2136.300.7.el8uek.x86_64 #2
[  705.412997] Hardware name: Dell Inc. PowerEdge R320/0KM5PX, BIOS 2.4.2 01/29/2015
[  705.412997] RIP: 0010:dev_watchdog+0x27d/0x281
[  705.412997] Code: 48 85 c0 75 e6 eb a0 4c 89 e7 c6 05 9b 59 17 01 01 e8 c7 a9 fa ff 89 d9 4c 89 e6 48 c7 c7 68 3b 53 ac 48 89 c2 e8 be f1 82 ff <0f> 0b eb 82 0f 1f 44 00 00 66 2e 0f 1f 84 00 00 00 00 00 66 66 66
[  705.412997] RSP: 0000:ffffac6d003d0e50 EFLAGS: 00010282
[  705.412997] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000006
[  705.412997] RDX: 0000000000000007 RSI: 0000000000000092 RDI: ffff9e853f457d00
[  705.412997] RBP: ffffac6d003d0e80 R08: 0000000000000514 R09: 00000000ffffffff
[  705.412997] R10: 0000000000000000 R11: ffff9e851d84f3d0 R12: ffff9e850d8e4000
[  705.412997] R13: 0000000000000005 R14: ffff9e850d8e4480 R15: ffff9e8537d377c0
[  705.412997] FS:  00007fa4baba5740(0000) GS:ffff9e853f440000(0000) knlGS:0000000000000000
[  705.412997] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[  705.412997] CR2: 00007f54983fad0c CR3: 0000000b99992006 CR4: 00000000000606e0
[  705.412997] Call Trace:
[  705.412997]  <IRQ>
[  705.412997]  ? pfifo_fast_enqueue+0x160/0x151
[  705.412997]  call_timer_fn+0x32/0x12c
[  705.412997]  run_timer_softirq+0x1a5/0x42e
[  705.412997]  __do_softirq+0xe1/0x2e7
[  705.412997]  ? hrtimer_interrupt+0x12a/0x222
[  705.412997]  irq_exit+0xf3/0xf8
[  705.412997]  smp_apic_timer_interrupt+0x79/0x130
[  705.412997]  apic_timer_interrupt+0xf/0x14
[  705.412997]  </IRQ>

如果我mitigations = off在启动时添加到内核命令行参数,phoronix持续 4 到 7 分钟,系统再次变得无响应。同样的事情发生在 KVM 客人身上,尝试安装Debian 115 次,在初始包安装或内核解包期间安装冻结。

冻结消息屏幕: https ://ibb.co/k2Jk4QG

有没有人有类似的问题?谢谢 !

PS:当前内核5.4.17-2136.300.7.el8uek.x86_64,也尝试过4.18.0-305.19.1.el8_4.x86_64没有任何区别

dell linux-kernel xeon centos8 stress-testing
  • 1 个回答
  • 152 Views
Martin Hope
catleeball
Asked: 2021-09-27 17:32:18 +0800 CST

RHEL8 上的 BTRFS - 编译内核模块或使用户空间工具工作

  • 1

语境

我最近安装了 RHEL 8 却没有意识到它不再支持 BTRFS。

不幸的是,我在 BTRFS RAID10 中有 4 个磁盘。我的其他磁盘上没有足够的空间来保存 BTRFS 磁盘上的数据,因此在从 USB 驱动器启动时将其全部复制到其他地方是不可能的。

我有我最初的问题,然后是一些关于我采取的方法失败的后续问题。随意只关注这个问题的“如何让 BTRFS 工作”部分,尽管如果你有任何部分的答案,我很想了解其他问题。

问题 1

  1. 是否有一种(相对)简单的方法可以让 BTRFS 在 RHEL8 上工作?

用户空间 btrfs-progs

我的第一次尝试是btrfs-progs使用以下内容进行编译和安装:

# Install deps
sudo dnf install libuuid-devel libblkid-devel lzo-devel zlib-devel libzstd-devel e2fsprogs-devel e2fsprogs-libs e2fsprogs libgcrypt-devel libsodium-devel libattr-devel
# Install deps for doc gen
sudo dnf install asciidoc xmlto source-highlight

# Shallow-clone latest release
git clone --depth 1 --branch v5.14.1 https://github.com/kdave/btrfs-progs.git
cd btrfs-progs
git switch -c v5.14.1

# Build
#   --disable-zoned since that feature needs kernel >=5.10
export CFLAGS="-O3 -pipe -frecord-gcc-switches -mtune=native -march=native"
export CPPFLAGS=$CFLAGS
export SODIUM_CFLAGS=$CFLAGS
export ZSTD_CFLAGS=$CFLAGS
export ZLIB_CFLAGS=$CFLAGS
export UUID_CFLAGS=$CFLAGS
export PYTHON_CFLAGS=$CFLAGS

./autogen.sh
./configure --with-crypto=libsodium --disable-zoned
make -j12
sudo make install

它似乎安装正确并且我的用户可以访问:

$ which btrfs
/usr/local/bin/btrfs

$ ls -1 /usr/local/bin/ | grep btrfs
btrfs
btrfsck
btrfs-convert
btrfs-find-root
btrfs-image
btrfs-map-logical
btrfs-select-super
btrfstune
fsck.btrfs
mkfs.btrfs

$ btrfs version
btrfs-progs v5.14.1 

但是,默认情况下,root 显然没有/usr/local/bin在其路径中。我添加了export PATH+=":/usr/local/bin" to /etc/profile and/root/.bash_profile , but neither of them seem to get sourced automatically when using sudo or when dropping into a root shell withsudo su`。

当指定二进制文件的完整路径时,它会抱怨它 can't open /dev/btrfs-control。查询我的本地搜索引擎,有人建议需要 udev,但已经安装(可能配置错误?)

$ sudo btrfs version
sudo: btrfs: command not found

$ sudo /usr/local/bin/btrfs device scan
Scanning for Btrfs filesystems
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
WARNING: failed to open /dev/btrfs-control, skipping device registration: No such file or directory
ERROR: there were 4 errors while registering devices

其他 BTRFS 命令似乎有效:

$ sudo /usr/local/bin/btrfs filesystem show /dev/sda
Label: 'wdred'  uuid: aaaa-bbbb-cccc-dddd-eeee
    Total devices 4 FS bytes used 2.13TiB
    devid    1 size 5.46TiB used 1.07TiB path /dev/sda
    devid    2 size 5.46TiB used 1.07TiB path /dev/sdc
    devid    3 size 5.46TiB used 1.07TiB path /dev/sdb
    devid    4 size 5.46TiB used 1.07TiB path /dev/sdd

但是,鉴于上述错误,我一直害怕挂载分区或对它们执行任何操作,因为担心它缺少的组件会导致它破坏我的数据。

问题 2、3、4

  1. 鉴于上述错误,尝试使用 btrfs 挂载磁盘是否安全?
  2. 上的/dev/btrfs-control错误是btrfs device scan怎么回事?
  3. 默认情况下,我怎样才能获得sudo并sudo su拥有/usr/local/bin它的路径?

BTRFS 内核模块

我想知道编译内核模块是否会更好,但是几乎没有内核黑客经验,结果很糟糕。

看来我需要CONFIG_BTRFS_FS=m在我的内核配置中设置才能启动。它目前不存在,我似乎记得能够在menuconfig.

$ grep "BTRFS" /boot/config-4.18.0-305.19.1.el8_4.x86_64 
# CONFIG_BTRFS_FS is not set

RHEL 文档提到了如何加载内核模块等,但没有提到如何构建它们。我咨询了 archwiki,并尝试从 Red Hat 站点下载 RHEL8 内核。RHEL8 的下载页面有一个带有 20G .iso 文件的“Sources”选项卡。我下载了它,安装了它,发现里面塞满了 .rpm 文件,看起来一点也不像 linux 内核源代码库。我有点失落。

然后我去了/usr/src/kernels/,初始化了一个 git repo,因为害怕我会破坏一些重要的东西,然后继续试图弄清楚如何构建内核模块或更改 menuconfig 中的内容。

$ cd /usr/src/kernels/4.18.0-305.19.1.el8_4.x86_64
$ sudo su
# git init
# git add -A
# git commit -m "Unmodified kernel"

# make mrproper
  HOSTCC  scripts/basic/bin2c
scripts/kconfig/conf  --syncconfig Kconfig
arch/x86/Makefile:184: *** Compiler lacks asm-goto support..  Stop.
make: *** [Makefile:1361: _clean_arch/x86] Error 2

由于缺乏 asm-goto 支持,互联网建议我可能需要elfutils-libelf-devel,但我似乎已经有了。

对于 funzies,我尝试使用clang和 with构建它gcc-toolset-10,但两者都有相同的错误。

问题 5

  • 任何想法为什么Compiler lacks asm-goto support?
  • 关于如何构建内核模块/修补内核/修改系统内核的好资源是什么?

系统信息

$ uname -a
Linux rhel 4.18.0-305.19.1.el8_4.x86_64 #1 SMP Tue Sep 7 07:07:31 EDT 2021 x86_64 x86_64 x86_64 GNU/Linux

$ gcc --version
gcc (GCC) 8.4.1 20200928 (Red Hat 8.4.1-1)


$ scl run gcc-toolset-10 'gcc --version'
gcc (GCC) 10.2.1 20201112 (Red Hat 10.2.1-8)

$ clang --version
clang version 11.0.0 (Red Hat 11.0.0-1.module+el8.4.0+8598+a071fcd5)

感谢您阅读到这里!任何帮助表示赞赏。

redhat linux-kernel kernel-modules rhel8 btrfs
  • 1 个回答
  • 896 Views
Martin Hope
Am3Y
Asked: 2021-08-02 14:38:50 +0800 CST

CentOS 8 编译内核 5.13.7 BTF 错误

  • 0

我正在为 Centos 8.4.2105 编译内核 5.13.7

我有以下错误

  MODPOST vmlinux.symvers
  MODINFO modules.builtin.modinfo
  GEN     modules.builtin
BTF: .tmp_vmlinux.btf: pahole (pahole) is not available
Failed to generate BTF for vmlinux
Try to disable CONFIG_DEBUG_INFO_BTF
make: *** [Makefile:1205: vmlinux] Error 1

我尝试在 Google 上搜索并得到了这个解决方案 https://stackoverflow.com/questions/61657707/btf-tmp-vmlinux-btf-pahole-pahole-is-not-available

但这仅适用于 debian/fedora/OpenSuse

有人可以帮我解决 Centos 8 的问题吗

linux linux-kernel centos8 rhel8
  • 1 个回答
  • 1344 Views
Martin Hope
q-codes
Asked: 2021-07-19 19:43:45 +0800 CST

将 CPU 频率设置为硬件最低限制 - 会损害硬件吗?

  • 3

我在英特尔赛扬 N4120 上运行。我可以轻松地将所有 4 个内核的 CPU 调控器设置为powersave使用:

for n in {0..3}
do
  sudo cpufreq-set -g powersave -c $n
done

现在,使用cpufreq-info我知道我的 CPU 的硬件限制是 800 MHz - 2.60 GHz。并且,cpufreq-set允许我设置最高和最低时钟速度。

我的问题是:如果我总是将所有内核的 CPU 的最高和最低时钟速度设置为 800 MHz,同时将控制器设置为powersave所有时间,那么它会影响我的硬件吗?


信息:我在我的一台较旧的(Intel Pentium Core 2 Duo)计算机上执行此操作,并且发生了内核崩溃(不确定它们是否相关)。我就这样用了很长时间的电脑——然后我就不能再调整我的 CPU 了。没有cpufreq-set命令起作用了。同样,不确定它们是否可以相关。

central-processing-unit linux ubuntu kernel linux-kernel
  • 1 个回答
  • 775 Views
Martin Hope
jakew009
Asked: 2021-07-16 10:21:11 +0800 CST

了解没有交换的只读文件系统上的 buff/cache 和 tmpfs 关系

  • 0

我们有一个非常奇怪的错误,在 Raspberry Pi 上运行的 Yocto 操作系统会因为磁盘 IO 等待而“锁定”。

设想:

  • 操作系统以只读方式运行,没有交换
  • 有一个 tmpfs 文件系统,用于存储操作系统需要写入的内容(/var、/log 等)
  • tmpfs 默认为可用 2GB RAM 的一半
  • 有一个 USB 硬盘驱动器连接用于存储大型 MP4 文件

在运行与 Google Coral USB 加速器交互的 Python 程序一段时间后,输出top为:

top 命令的输出

因此 CPU 负载很大,但 CPU 使用率很低。我们认为这是因为它正在等待 IO 到 USB 硬盘。

其他时候我们会看到更高的缓存使用率:

Mem: 1622744K used, 289184K free, 93712K shrd, 32848K buff, 1158916K cached
CPU:   0% usr   0% sys   0% nic  24% idle  74% io   0% irq   0% sirq
Load average: 5.00 4.98 4.27 1/251 2645

文件系统看起来相当正常:

root@ifu-14:~# df -h
Filesystem                Size      Used Available Use% Mounted on
/dev/root                 3.1G    528.1M      2.4G  18% /
devtmpfs                804.6M      4.0K    804.6M   0% /dev
tmpfs                   933.6M     80.0K    933.5M   0% /dev/shm
tmpfs                   933.6M     48.6M    884.9M   5% /run
tmpfs                   933.6M         0    933.6M   0% /sys/fs/cgroup
tmpfs                   933.6M     48.6M    884.9M   5% /etc/machine-id
tmpfs                   933.6M      1.5M    932.0M   0% /tmp
tmpfs                   933.6M     41.3M    892.3M   4% /var/volatile
tmpfs                   933.6M     41.3M    892.3M   4% /var/spool
tmpfs                   933.6M     41.3M    892.3M   4% /var/lib
tmpfs                   933.6M     41.3M    892.3M   4% /var/cache
/dev/mmcblk0p1           39.9M     28.0M     11.9M  70% /uboot
/dev/mmcblk0p4          968.3M      3.3M    899.0M   0% /data
/dev/mmcblk0p4          968.3M      3.3M    899.0M   0% /etc/hostname
/dev/mmcblk0p4          968.3M      3.3M    899.0M   0% /etc/NetworkManager
/dev/sda1               915.9G     30.9G    838.4G   4% /mnt/sda1

当它全部“锁定”时,我们注意到 USB 硬盘驱动器因为完全没有响应(ls什么都不做,只是冻结)。

在 dmesg 日志中,我们注意到以下几行(粘贴为图像以保留颜色):

dmesg 输出

这是我们开始收到这些错误后 dmesg 的完整输出: https ://pastebin.com/W7k4cp35

我们推测,当系统上运行的软件尝试对一个大文件 (50MB +) 执行某些操作时(在 USB 硬盘上移动它),不知何故,系统内存不足。

我们真的不确定我们到底是如何进行的。我们发现了这个博客:https ://www.blackmoreops.com/2014/09/22/linux-kernel-panic-issue-fix-hung_task_timeout_secs-blocked-120-seconds-problem/哪一种看起来像同样的问题和建议修改vm.dirty_ratio和vm.dirty_background_ratio以更频繁地将缓存刷新到磁盘。

这是正确的方法吗?

当前设置是vm.dirty_ratio = 20和vm.dirty_background_ratio = 10

相对较慢的 USB 硬盘驱动器是否需要更改?有人可以解释发生了什么吗?

filesystems linux-kernel embedded-linux
  • 2 个回答
  • 241 Views
Martin Hope
Landon Miller
Asked: 2021-07-04 13:15:15 +0800 CST

为什么我的 Linux 内核缺少对 ip_tables 运行至关重要的目录/文件?

  • 2

如标题中所述 - 我的 Linux 内核似乎缺少对 iptables 正常运行至关重要的文件/目录。我可以通过重新安装内核来临时解决这个问题,但这不是永久解决,因为重新启动后我又回到了我开始的地方。

当我运行时,iptables -L我收到一条错误消息,“也许 iptables 或您的内核需要升级。” 我发现我可以通过运行来解决此错误sudo apt-get install --reinstall linux-modules-5.8.0-59-generic。我注意到重新安装后,我的目录中有其他文件和目录/lib/modules/5.8.0-59-generic,这使我相信我的内核默认情况下缺少这些文件和目录,并导致 iptables 无法正常运行。重新启动后,它又会丢失这些文件/目录,并且 iptables 无法正常工作。

是否可以永久重新安装内核模块,所以我不必在每次重新启动后重新安装以使 iptables 工作?

我正在运行 Ubuntu 20.04.2,如上所述,我的内核是 5.8.0-59-generic。我很感激我能得到的任何帮助!

编辑:

我得到的输出ls /boot/vmlinuz*是:[vmlinuz 输出]:https ://i.stack.imgur.com/dDroe.png或者作为文本:

/boot/vmlinuz /boot/vmlinuz-5.4.0-77-generic /boot/vmlinuz-5.8.0-48-generic /boot/vmlinuz-5.8.0-55-generic /boot/vmlinuz-5.8.0-59-generic /boot/vmlinuz.old

我得到的输出apt-cache policy linux-image-generic是: [apt-cache output]: https://isstatic.askoverflow.dev/OY9Cj.png或者作为文本:

linux-image-generic: Installed: 5.4.0.77.80 Candidate: 5.4.0.77.80 Version table: *** 5.4.0.77.80 500 500 http://archive.ubuntu.com/ubuntu focal-updates/main amd64 Packages 500 http://archive.ubuntu.com/ubuntu focal-security/main amd64 Packages 100 /var/lib/dpkg/status 5.4.0.26.32 500 500 http://archive.ubuntu.com/ubuntu focal/main amd64 Packages

正在运行的计算机是戴尔 Optiplex 3020,其规格如下:

  • CPU:四核 Intel(R) Core(TM) i5-4570 CPU @ 3.20 GHz
  • 内存:8Gb 内存

编辑:我不确定这些命令的输出将如何帮助我,我非常感谢进一步的指导,因为我仍然没有接近解决这个问题!

iptables linux-kernel
  • 2 个回答
  • 232 Views
Martin Hope
Hubro
Asked: 2021-02-05 15:13:58 +0800 CST

如何覆盖 NVME 设备的 IRQ 关联

  • 4

我正在尝试将所有中断移至核心 0-3,以保持其余核心空闲,以实现高速、低延迟的虚拟化。

我写了一个快速脚本来将 IRQ 亲和性设置为 0-3:

#!/bin/bash

while IFS= read -r LINE; do
    echo "0-3 -> \"$LINE\""
    sudo bash -c "echo 0-3 > \"$LINE\""
done <<< "$(find /proc/irq/ -name smp_affinity_list)"

这似乎适用于 USB 设备和网络设备,但不适用于 NVME 设备。他们都产生这个错误:

bash: line 1: echo: write error: Input/output error

他们顽固地继续在我几乎所有的核心上均匀地产生中断。

如果我检查这些设备的当前亲和力:

$ cat /proc/irq/81/smp_affinity_list 
0-1,16-17
$ cat /proc/irq/82/smp_affinity_list
2-3,18-19
$ cat /proc/irq/83/smp_affinity_list
4-5,20-21
$ cat /proc/irq/84/smp_affinity_list
6-7,22-23
...

似乎“某事”正在完全控制跨核心传播 IRQ,而不是让我改变它。

将这些移到其他内核是完全关键的,因为我在这些内核上的虚拟机中执行大量 IO,并且 NVME 驱动器正在产生大量的中断负载。这不是 Windows,我应该能够决定我的机器做什么。

什么是控制这些设备的 IRQ 亲和性以及如何覆盖它?


我在 Gigabyte Auros X570 Master 主板上使用 Ryzen 3950X CPU,3 个 NVME 驱动器连接到主板上的 M.2 端口。

(更新:我现在使用的是 5950X,仍然有完全相同的问题)

内核:5.12.2-arch1-1

lspci -v与 NVME 相关的输出:

01:00.0 Non-Volatile memory controller: Phison Electronics Corporation E12 NVMe Controller (rev 01) (prog-if 02 [NVM Express])
    Subsystem: Phison Electronics Corporation E12 NVMe Controller
    Flags: bus master, fast devsel, latency 0, IRQ 45, NUMA node 0, IOMMU group 14
    Memory at fc100000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [80] Express Endpoint, MSI 00
    Capabilities: [d0] MSI-X: Enable+ Count=9 Masked-
    Capabilities: [e0] MSI: Enable- Count=1/8 Maskable- 64bit+
    Capabilities: [f8] Power Management version 3
    Capabilities: [100] Latency Tolerance Reporting
    Capabilities: [110] L1 PM Substates
    Capabilities: [128] Alternative Routing-ID Interpretation (ARI)
    Capabilities: [200] Advanced Error Reporting
    Capabilities: [300] Secondary PCI Express
    Kernel driver in use: nvme

04:00.0 Non-Volatile memory controller: Phison Electronics Corporation E12 NVMe Controller (rev 01) (prog-if 02 [NVM Express])
    Subsystem: Phison Electronics Corporation E12 NVMe Controller
    Flags: bus master, fast devsel, latency 0, IRQ 24, NUMA node 0, IOMMU group 25
    Memory at fbd00000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [80] Express Endpoint, MSI 00
    Capabilities: [d0] MSI-X: Enable+ Count=9 Masked-
    Capabilities: [e0] MSI: Enable- Count=1/8 Maskable- 64bit+
    Capabilities: [f8] Power Management version 3
    Capabilities: [100] Latency Tolerance Reporting
    Capabilities: [110] L1 PM Substates
    Capabilities: [128] Alternative Routing-ID Interpretation (ARI)
    Capabilities: [200] Advanced Error Reporting
    Capabilities: [300] Secondary PCI Express
    Kernel driver in use: nvme

05:00.0 Non-Volatile memory controller: Phison Electronics Corporation E12 NVMe Controller (rev 01) (prog-if 02 [NVM Express])
    Subsystem: Phison Electronics Corporation E12 NVMe Controller
    Flags: bus master, fast devsel, latency 0, IRQ 40, NUMA node 0, IOMMU group 26
    Memory at fbc00000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [80] Express Endpoint, MSI 00
    Capabilities: [d0] MSI-X: Enable+ Count=9 Masked-
    Capabilities: [e0] MSI: Enable- Count=1/8 Maskable- 64bit+
    Capabilities: [f8] Power Management version 3
    Capabilities: [100] Latency Tolerance Reporting
    Capabilities: [110] L1 PM Substates
    Capabilities: [128] Alternative Routing-ID Interpretation (ARI)
    Capabilities: [200] Advanced Error Reporting
    Capabilities: [300] Secondary PCI Express
    Kernel driver in use: nvme
$ dmesg | grep -i nvme
[    2.042888] nvme nvme0: pci function 0000:01:00.0
[    2.042912] nvme nvme1: pci function 0000:04:00.0
[    2.042941] nvme nvme2: pci function 0000:05:00.0
[    2.048103] nvme nvme0: missing or invalid SUBNQN field.
[    2.048109] nvme nvme2: missing or invalid SUBNQN field.
[    2.048109] nvme nvme1: missing or invalid SUBNQN field.
[    2.048112] nvme nvme0: Shutdown timeout set to 10 seconds
[    2.048120] nvme nvme1: Shutdown timeout set to 10 seconds
[    2.048127] nvme nvme2: Shutdown timeout set to 10 seconds
[    2.049578] nvme nvme0: 8/0/0 default/read/poll queues
[    2.049668] nvme nvme1: 8/0/0 default/read/poll queues
[    2.049716] nvme nvme2: 8/0/0 default/read/poll queues
[    2.051211]  nvme1n1: p1
[    2.051260]  nvme2n1: p1
[    2.051577]  nvme0n1: p1 p2
linux linux-kernel smp nvme irq
  • 3 个回答
  • 2512 Views

Sidebar

Stats

  • 问题 205573
  • 回答 270741
  • 最佳答案 135370
  • 用户 68524
  • 热门
  • 回答
  • Marko Smith

    新安装后 postgres 的默认超级用户用户名/密码是什么?

    • 5 个回答
  • Marko Smith

    SFTP 使用什么端口?

    • 6 个回答
  • Marko Smith

    命令行列出 Windows Active Directory 组中的用户?

    • 9 个回答
  • Marko Smith

    什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同?

    • 3 个回答
  • Marko Smith

    如何确定bash变量是否为空?

    • 15 个回答
  • Martin Hope
    Tom Feiner 如何按大小对 du -h 输出进行排序 2009-02-26 05:42:42 +0800 CST
  • Martin Hope
    Noah Goodrich 什么是 Pem 文件,它与其他 OpenSSL 生成的密钥文件格式有何不同? 2009-05-19 18:24:42 +0800 CST
  • Martin Hope
    Brent 如何确定bash变量是否为空? 2009-05-13 09:54:48 +0800 CST
  • Martin Hope
    cletus 您如何找到在 Windows 中打开文件的进程? 2009-05-01 16:47:16 +0800 CST

热门标签

linux nginx windows networking ubuntu domain-name-system amazon-web-services active-directory apache-2.4 ssh

Explore

  • 主页
  • 问题
    • 最新
    • 热门
  • 标签
  • 帮助

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve