Home » Computer » Software » OS » Archive by category "Linux" (Page 4)

Ubuntu 下雙螢幕進入省電模式後再起不能的問題

Update:後來還是有狀況,這篇的方法沒有完全解決... 等找出解法後再回來更新。

前陣子把家裡的 Ubuntu 桌機多塞了一顆 Dell 的 P2317H,打直拿來看程式碼,大致上是沒什麼問題,不過螢幕進入省電模式後就再起不能... (NVIDIA 的顯卡,一顆接 DisplayPort,另外一顆接 HDMI)

後來找到這一串討論:「DP1.2 connected monitor cannot be turned on again with DPMS」。

這串討論裡官方的人有給不少方式,後來試到第二頁的發法,是在 /etc/modprobe.d/disable-nouveau.conf 裡設定一些參數,重開機後就解決了:

blacklist nouveau
options nouveau modeset=0

看起來是 nouveau 的關係,現在總算是可以比較正常的使用了... (還有不少眉眉角角的地方要再找方法解...)

在 Linux 下引用 Windows 的 DLL 檔

作者為了在 Linux 下進行安全分析而弄出來的計畫:「Porting Windows Dynamic Link Libraries to Linux」。

作者對 Windows 的架構有不少抱怨 XDDD

Distributed, scalable fuzzing on Windows can be challenging and inefficient. This is especially true for endpoint security products, which use complex interconnected components that span across kernel and user space. This often requires spinning up an entire virtualized Windows environment to fuzz them or collect coverage data.

This is less of a problem on Linux, and I've found that porting components of Windows Antivirus products to Linux is often possible. This allows me to run the code I’m testing in minimal containers with very little overhead, and easily scale up testing.

This is just personal opinion, but I also think Linux has better tools. ¯\_(ツ)_/¯

而這個專案跟 WineHQ 完整模擬不一樣,這只是給 Linux 下原生的程式使用 Windows 下 DLL 內的功能:

This project does not replace Wine or Winelib.

Winelib is used to port Windows C++ projects to Linux, and Wine is intended to run full Windows applications. This project is intended to allow native Linux code to load simple Windows DLLs.

The closest analogy would be ndiswrapper but for userspace.

作者拿了 Windows Defender 當範例,示範在 Linux 下呼叫 Windows 的 DLL...

Amazon EC2 上的 Ubuntu 的效能提昇

UbuntuAWS 合作,對 AWS 上 EC2 的 kernel 最佳化:「Ubuntu on AWS gets serious performance boost with AWS-tuned kernel」。

透過各界面拉出來的 Ubuntu 16.04 都將會是對 kernel 最佳化過的版本了:

As of March 29th, Ubuntu Cloud Images for Amazon have been enabled with the AWS-tuned Ubuntu kernel by default. The AWS-tuned Ubuntu kernel will receive the same level of support and security maintenance as all supported Ubuntu kernels for the duration of the Ubuntu 16.04 LTS.

可以看到大量的改善:

  • Up to 30% faster kernel boot speeds, on a 15% smaller kernel package
  • Full support for Elastic Network Adapter (ENA), including the latest driver version 1.1.2, supporting up to 20 Gbps network speeds for ENA instance types (currently I3, P2, R4, X1, and m4.16xlarge)
  • Improved i3 instance class support with NVMe storage disks under high IO load
  • Increased I/O performance for i3 instances
  • Improved instance initialization with NVMe backed storage disks
  • Disabled CONFIG_NO_HZ_FULL to eliminate deadlocks on some instance types
  • Resolved CPU throttling with AWS t2.micro instances

所以先前打包好的 AMI 都要再重打一次了... @_@

在 ext4 上的 CCFS

在「Application crash consistency and performance with CCFS」這篇看到的東西。

CCFS 目標是拉高 ext4 的 data integrity,並且還是有高效能:

CCFS (the Crash-Consistent File System) is an extension to ext4 that restores ordering and weak atomicity guarantees for applications, while at the same time delivering much improved performance.

如果你需要絕對的 data integrity,你需要用 data=journal 確保資料可以在 system crash 後被 replay,預設的 data=ordered 是無法達到的,而 CCFS 也沒打算達到絕對的 data integrity,而是盡量達到。所以在測試上可以發現 CCFS 大幅改善了 data integrity:

而效能還提昇了 (喂喂):

這真是太神奇了...

翻了一下好像沒 open source 出來 (至少現在沒看到),來等看看有沒有人會實做出來...

Ubuntu 12.04 的在 2017 年四月後的後續維護

雖然 Ubuntu 12.04 (Precise Pangolin,一般拿 Precise 當識別代碼) 將會在 2017/04/28 結束五年的維護,而官方也建議大家升級到 14.04 (Trusty Tahr) 或是 16.04 (Xenial Xerus),但總還是會有因為種種因素而升不動的系統...

因為升級有困難而還在使用 12.04 的使用者,Ubuntu 則是提供了商業的維護合約 Ubuntu Advantage:「Introducing Ubuntu 12.04 ESM (Extended Security Maintenance)」。

Desktop 版是 $125/year (最少 50 套),VM 是 $250/year (最少 10 套),Server 是 $750/year (可單買)。

我應該是用不到,不過如果有需求的人可以看一看...

Amazon EC2 上的 gettimeofday 與 clock_gettime 的效能

看到「Two frequently used system calls are ~77% slower on AWS EC2」這篇在講 gettimeofdayclock_gettime 的效能,另外搜資料時發現應該也是作者提問的「gettimeofday() not using vDSO?」這篇。

EC2 比較新的機器上用 tsc 應該是沒問題的 (在 2015 的時候官方就這樣建議了):

it seems tsc support in Xen has improved with version 4.0 and with improved CPU support in Sandy Bridge+ platforms. Modern EC2 machines should be okay with tsc. Check Xen version using dmesg | grep "Xen version". Amazon recommended the tsc clocksource already in re:Invent 2015 (https://www.slideshare.net/AmazonWebServices/cmp402-amazon-ec2-instances-deep-dive). I'm not yet running to production with this, but the situation doesn't seem as bad as implied by packagecloud.

開了一台 t2.micro 看 /sys/devices/system/clocksource/clocksource0/current_clocksource 看起來目前是設成 xen

ubuntu@ip-172-31-22-165:~$ cat /sys/devices/system/clocksource/clocksource0/current_clocksource
xen

在「(CMP402) Amazon EC2 Instances Deep Dive」這邊也可以看到一些資料 (page 24 與 page 25):

Archives