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
    • 最新
    • 标签
主页 / unix / 问题

问题[atop](unix)

Martin Hope
sourcejedi
Asked: 2019-06-30 07:36:13 +0800 CST

什么是“shrss”/“shswp”?

  • 1

MEM - 内存占用。

此行包含物理内存总量 ( tot),[...] 共享内存的常驻大小,包括 tmpfs ( shmem),共享内存的常驻大小 ( shrss) 当前交换的共享内存量 ( shswp) [.. .]

shrss/的描述shswp对我来说太模糊了。它实际上涵盖了什么?

MEM | tot 7.7G | free 3.6G | cache 2.1G | dirty 0.3M | buff 258.1M | slab 306.4M | slrec 182.7M | shmem 257.5M | shrss 12.7M | shswp 0.0M | vmbal 0.0M | | hptot 0.0M | hpuse 0.0M |


$ rpm -q atop
atop-2.4.0-1.fc30.x86_64
memory atop
  • 1 个回答
  • 222 Views
Martin Hope
sourcejedi
Asked: 2019-06-21 07:17:14 +0800 CST

atop 死亡,退出状态为 53

  • 0

我在跑步atop。它正在工作,但后来它以退出状态 53 死亡。

$ atop
$ echo $?
53

这是一个错误atop吗?还是我的系统出现故障?

先发制人的额外细节:-)

我检查了内核日志 ( dmesg)。我发现没有什么特别令人担忧的,但有一些错误。见下文。

这台笔记本电脑已经可靠使用了几个月了。内核没有被“污染”,因此没有内核 WARN 或 OOPS 消息。

$ cat /proc/sys/kernel/tainted
0
$ rpm -q atop
atop-2.3.0-10.fc28.x86_64

$ uname -r  # My kernel version
5.1.6-200.fc29.x86_64

dmesg提醒我,我最近将计算机从睡眠中唤醒,并atop在它进入睡眠之前启动。

dmesg也发生显示 USB 和 FAT 错误,因为在此期间我与连接不良的 USB 记忆棒失去了连接。

从挂起恢复期间有一些硬件消息。但在过去的几个月里,我没有遇到任何用户可见的睡眠/唤醒问题。

还有一些早期的dmesg错误。


[40654.082396] PM: suspend exit
[40654.205336] Bluetooth: hci0: Intel Bluetooth firmware file: intel/ibt-hw-37.8.10-fw-1.10.3.11.e.bseq
[40654.517627] Bluetooth: hci0: unexpected event for opcode 0xfc2f
[40654.534651] Bluetooth: hci0: Intel firmware patch completed and activated
[40655.519592] e1000e 0000:00:19.0 eno1: Detected Hardware Unit Hang:
                 TDH                  <0>
                 TDT                  <10>
                 next_to_use          <10>
                 next_to_clean        <0>
               buffer_info[next_to_clean]:
                 time_stamp           <10267d16b>
                 next_to_watch        <1>
                 jiffies              <10267d740>
                 next_to_watch.status <0>
               MAC Status             <80000>
               PHY Status             <7949>
               PHY 1000BASE-T Status  <0>
               PHY Extended Status    <3000>
               PCI Status             <10>
[40656.239991] Process accounting resumed
[40656.318355] e1000e: eno1 NIC Link is Down
...
[41013.654127] usb 2-2: USB disconnect, device number 43
[41013.901953] usb 2-2: new full-speed USB device number 46 using xhci_hcd
[41020.270316] FAT-fs (sdb4): Directory bread(block 22704) failed
[41020.270322] FAT-fs (sdb4): Directory bread(block 22705) failed
[41020.270325] FAT-fs (sdb4): Directory bread(block 22706) failed
[41020.270328] FAT-fs (sdb4): Directory bread(block 22707) failed
[41020.270331] FAT-fs (sdb4): Directory bread(block 22708) failed
[41020.270333] FAT-fs (sdb4): Directory bread(block 22709) failed
[41020.270336] FAT-fs (sdb4): Directory bread(block 22710) failed
[41020.270339] FAT-fs (sdb4): Directory bread(block 22711) failed
[41020.270354] FAT-fs (sdb4): Directory bread(block 22704) failed
[41020.270357] FAT-fs (sdb4): Directory bread(block 22705) failed
[41029.558085] usb 2-2: device descriptor read/64, error -110
[41029.780057] usb 2-2: device descriptor read/64, error -71
[41029.996102] usb 2-2: new full-speed USB device number 47 using xhci_hcd
[41030.110057] usb 2-2: device descriptor read/64, error -71
[41030.332052] usb 2-2: device descriptor read/64, error -71
[41030.434046] usb usb2-port2: attempt power cycle
[41031.061973] usb 2-2: new full-speed USB device number 48 using xhci_hcd
[41031.062086] usb 2-2: Device not responding to setup address.
[41031.266212] usb 2-2: Device not responding to setup address.
[41031.474101] usb 2-2: device not accepting address 48, error -71
[41031.588100] usb 2-2: new full-speed USB device number 49 using xhci_hcd
[41031.588294] usb 2-2: Device not responding to setup address.
[41031.794271] usb 2-2: Device not responding to setup address.
[41032.002095] usb 2-2: device not accepting address 49, error -71
[41032.002202] usb usb2-port2: unable to enumerate USB device
[41070.004040] usb 2-1: new high-speed USB device number 50 using xhci_hcd
[41075.638042] usb 2-1: device descriptor read/64, error -110
[41075.877302] usb 2-1: New USB device found, idVendor=0718, idProduct=063d, bcdDevice= 1.00
[41075.877309] usb 2-1: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[41075.877313] usb 2-1: Product: Nano Pro
[41075.877316] usb 2-1: Manufacturer: Imation
[41075.877319] usb 2-1: SerialNumber: 0703335B0AF92D86
[41075.881530] usb-storage 2-1:1.0: USB Mass Storage device detected
[41075.882899] scsi host3: usb-storage 2-1:1.0
[41077.004052] scsi 3:0:0:0: Direct-Access     Imation  Nano Pro         PMAP PQ: 0 ANSI: 4
[41077.005015] sd 3:0:0:0: Attached scsi generic sg1 type 0
[41078.366583] sd 3:0:0:0: [sdc] 15116736 512-byte logical blocks: (7.74 GB/7.21 GiB)
[41078.366732] sd 3:0:0:0: [sdc] Write Protect is off
[41078.366735] sd 3:0:0:0: [sdc] Mode Sense: 23 00 00 00
[41078.366935] sd 3:0:0:0: [sdc] No Caching mode page found
[41078.366939] sd 3:0:0:0: [sdc] Assuming drive cache: write through
[41078.389637]  sdc: sdc1 sdc2 sdc3 sdc4
[41078.392305] sd 3:0:0:0: [sdc] Attached SCSI removable disk

之前的错误:

$ journalctl -o short-monotonic -k -p err
[   14.953318] alan-laptop kernel: i801_smbus 0000:00:1f.3: Failed to enable SMBus PCI device (-16)
[   15.919042] alan-laptop kernel: uvcvideo: Failed to query (GET_INFO) UVC control 3 on unit 1: -32 (exp. 1).
[   15.974276] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
[   19.812805] alan-laptop kernel: db_root: cannot open: /etc/target
[   35.219443] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
...
[19625.693967] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
[20606.292276] alan-laptop kernel: ACPI Error: Thread 3649118016 cannot release Mutex [PATM] acquired by thread 2284756800 (20190215/exmutex-382)
[20606.292282] alan-laptop kernel: ACPI Error: Aborting method \_SB.PCI0.LPCB.ECDV._Q66 due to previous error (AE_AML_NOT_OWNER) (20190215/psparse-53>
[20609.491788] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
[22006.616549] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
[28469.301081] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
[28472.604260] alan-laptop kernel: Bluetooth: hci0: command 0x0c56 tx timeout
[30297.940165] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
[30355.700904] alan-laptop kernel: mmc0: error -110 doing runtime resume
[30355.939525] alan-laptop kernel: Bluetooth: hci0: unexpected event for opcode 0xfc2f
exit-status atop
  • 1 个回答
  • 303 Views
Martin Hope
sourcejedi
Asked: 2019-05-05 11:10:22 +0800 CST

`dd` 正在全速运行,但我只看到 20% 的磁盘利用率。为什么?

  • 8
  1. sudo dd if=/dev/sda of=/dev/null bs=1M iflag=direct
  2. atopsar -d 5 # in a second terminal
  3. top # in a third terminal

结果来自atopsar:

19:18:32  disk           busy read/s KB/read  writ/s KB/writ avque avserv _dsk_
...
19:16:50  sda             18%  156.5  1024.0     0.0     0.0   5.0   1.15 ms
19:16:55  sda             18%  156.3  1024.0     0.0     0.0   4.9   1.15 ms
...

为什么报告的磁盘利用率(“忙碌”)远低于 100%?

根据top,该dd进程仅使用 3% 或更少的 CPU。 还提供了系统 CPU 的硬件和软件中断 (和) 使用情况top的总体报告,显示低于 1%。我有四个 CPU(2 个内核,每个内核有 2 个线程)。hisi

/dev/sda是SATA硬盘。它不是 SSD,甚至不是混合 SSHD 驱动器。它的读取速度不能超过每秒 150 兆字节 :-)。所以这部分结果是有意义的:156 read/s * 1024 KB/read = 156 MB/s

内核版本是5.0.9-200.fc29.x86_64(Fedora Workstation 29)。IO 调度程序是mq-deadline. 从内核版本 5.0 开始,Fedora 使用多队列块层。因为单个队列块层已被删除:-)。

我相信磁盘利用率数据是根据内核 iostat 字段之一计算得出atopsar -d的。链接的文档提到“字段 10 - 花费在 I/O 上的毫秒数”。还有一个更详细的定义,虽然我不确定它提到的功能是否仍然存在于多队列块层中。据我所知,两者都使用通用代码来读取这个字段 10. (我相信这个字段也被//使用)atopatopsar -datopsar -diostat -xmxiostat.py

附加测试

变体 2:更改为bs=512k,但保留iflag=direct。

dd if=/dev/sda of=/dev/null bs=512k iflag=direct

19:18:32  disk           busy read/s KB/read  writ/s KB/writ avque avserv _dsk_
...
19:18:00  sda             35%  314.0   512.0     0.0     0.0   2.1   1.12 ms
19:18:05  sda             35%  313.6   512.0     0.2     4.0   2.1   1.11 ms

变体 3:使用bs=1M,但删除iflag=direct. dd使用大约 10% 的 CPU 和 35% 的磁盘。

dd if=/dev/sda of=/dev/null bs=1M

19:18:32  disk           busy read/s KB/read  writ/s KB/writ avque avserv _dsk_
...
19:21:47  sda             35%  242.3   660.2     0.0     0.0   5.4   1.44 ms
19:21:52  sda             31%  232.3   667.8     0.0     0.0   9.5   1.33 ms

如何重现这些结果 - 基本细节

当心最后的测试,即在dd 没有的情况下运行 iflag=direct

这有点像猪。我看到它冻结系统(鼠标光标)十秒钟或更长时间。即使我禁用了交换。(测试用buff/cache填充你的 RAM 。它正在填充非活动 LRU 列表。我认为周转相对较快地驱逐非活动缓存页面。同时,磁盘忙于顺序读取,因此在需要时需要更长的时间将某些内容分页。这可能会变得多么糟糕,这可能取决于内核最终是否也翻转了活动 LRU 列表,或者将其缩小太多。即当前的“多种不同算法的混搭效果如何,并进行了一些修改捕捉极端情况和各种优化”适用于您的情况)。

第一次测试的确切结果很难重现。

有时,KB/read显示为512而不是1024. 在这种情况下,其他结果看起来更像bs=512k. 包括它显示大约 35% 的磁盘利用率,而不是大约 20%。无论哪种情况,我的问题都成立。

如果您想了解这种行为,请参阅此处:为什么我的 IO 请求的大小被限制为大约 512K?

linux atop
  • 1 个回答
  • 1904 Views
Martin Hope
sourcejedi
Asked: 2018-02-19 03:04:02 +0800 CST

在 `atop` 中,MEM(百分比数字)是反映 PSIZE 还是仅反映 RSIZE?

  • 0

当 PSIZE 可用时,是atop使用它来使 MEM 数字更有用,还是 MEM 数字atop总是反映 RSIZE (RSS)?

联机帮助页似乎没有帮助。

记忆体

此进程的占用百分比与系统级别此资源的可用容量相关。

memory atop
  • 1 个回答
  • 1277 Views

Sidebar

Stats

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

    模块 i915 可能缺少固件 /lib/firmware/i915/*

    • 3 个回答
  • Marko Smith

    无法获取 jessie backports 存储库

    • 4 个回答
  • Marko Smith

    如何将 GPG 私钥和公钥导出到文件

    • 4 个回答
  • Marko Smith

    我们如何运行存储在变量中的命令?

    • 5 个回答
  • Marko Smith

    如何配置 systemd-resolved 和 systemd-networkd 以使用本地 DNS 服务器来解析本地域和远程 DNS 服务器来解析远程域?

    • 3 个回答
  • Marko Smith

    dist-upgrade 后 Kali Linux 中的 apt-get update 错误 [重复]

    • 2 个回答
  • Marko Smith

    如何从 systemctl 服务日志中查看最新的 x 行

    • 5 个回答
  • Marko Smith

    Nano - 跳转到文件末尾

    • 8 个回答
  • Marko Smith

    grub 错误:你需要先加载内核

    • 4 个回答
  • Marko Smith

    如何下载软件包而不是使用 apt-get 命令安装它?

    • 7 个回答
  • Martin Hope
    user12345 无法获取 jessie backports 存储库 2019-03-27 04:39:28 +0800 CST
  • Martin Hope
    Carl 为什么大多数 systemd 示例都包含 WantedBy=multi-user.target? 2019-03-15 11:49:25 +0800 CST
  • Martin Hope
    rocky 如何将 GPG 私钥和公钥导出到文件 2018-11-16 05:36:15 +0800 CST
  • Martin Hope
    Evan Carroll systemctl 状态显示:“状态:降级” 2018-06-03 18:48:17 +0800 CST
  • Martin Hope
    Tim 我们如何运行存储在变量中的命令? 2018-05-21 04:46:29 +0800 CST
  • Martin Hope
    Ankur S 为什么 /dev/null 是一个文件?为什么它的功能不作为一个简单的程序来实现? 2018-04-17 07:28:04 +0800 CST
  • Martin Hope
    user3191334 如何从 systemctl 服务日志中查看最新的 x 行 2018-02-07 00:14:16 +0800 CST
  • Martin Hope
    Marko Pacak Nano - 跳转到文件末尾 2018-02-01 01:53:03 +0800 CST
  • Martin Hope
    Kidburla 为什么真假这么大? 2018-01-26 12:14:47 +0800 CST
  • Martin Hope
    Christos Baziotis 在一个巨大的(70GB)、一行、文本文件中替换字符串 2017-12-30 06:58:33 +0800 CST

热门标签

linux bash debian shell-script text-processing ubuntu centos shell awk ssh

Explore

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

Footer

AskOverflow.Dev

关于我们

  • 关于我们
  • 联系我们

Legal Stuff

  • Privacy Policy

Language

  • Pt
  • Server
  • Unix

© 2023 AskOverflow.DEV All Rights Reserve