-1

I am not an OS/system programmer (still it has been attracting me a lot :) ), so I am not sure if this is a good question, and it might not be clear enough(its more than 1 question actually).

Is it possible/feasible/practical to have a Linux kernel (and other system programs) to be tuned (via configuration or any rewrite) for optimal performance, so that they can utilize the hardware to the maximum (if not 100%)?

My question is not specific to OS but I think OS optimization can be of a huge help.

I can think of controlling number of threads and distributing loads equally to them can help achieving this. With a large number of multicore (1/2/4/6/8) processors in use, I think a software should (somehow(?)) realize the number of cores (either while getting installed or at the invocation) AND distribute load evenly among them. Without having the softwares to fully utilize hardware, these hardwares' power is wasted in my opinion.

There are other ways too which I can think of like for eg say I have a quad core machine, with 5400rpm sata HDD being the bottleneck so if the software can realize that and minimize disk reads/writes by increasing caches and using async/delayed read/writes it will help improving the performance.

I also want to know that with the OpenCL and CUDA libraries, can intelligently using processing units in GPUs help substantially?

I haven't written (or even read) any serious program (except my work, which is web related, client-server type) but I surely will this a try. Does what I think/assume and what I ask make any sense? Or am I going mad?

4

2 に答える 2

1

プロセスによって費やされる時間のほとんどは、によってブロックされI/Oます。例は次のとおりです。

  1. セカンダリ ストレージから RAM へのデータのチャンクの読み取り/書き込み (実行時freadまたはfwriteたとえば)
  2. パケットがネットワーク経由で到着するのを待ちます。

ご覧のとおり、これらの操作が完了するまでプロセスはブロックされます。これを待っている間に何か有用な処理を行うロジックがアプリケーション プロセスにある場合、カーネルは喜んでそれらのスレッドにサービスを提供します。そうでない場合、カーネルは、sleep他のプロセスに属するスレッドをサービスしている間にプロセスを配置しますready

計算集約型のアプリケーションは異なります。何かを計算するために、データセット (行列など) に対して膨大な回数の反復を実行する傾向があります。vectorizationコンパイラは、最新のプロセッサで一部の CPU サイクルを削減するなど、独自の最適化を試みます。openMP などのライブラリを使用すると、コードの並列セクションを示し、そのコードを実行するときに生成するスレッドの数を指定するのに役立つ場合があります。これらはすべて、ユーザー空間で行われた同じアプリケーションの最適化です。

カーネルは主にタスクのスケジューリングを担当します。さまざまなスケジューラ アルゴリズムがあり、ディストリビューション カーネルを見てみると、いくつかのバリエーションが提供されます。この-desktopバリアントは、ほとんどのデスクトップ アプリケーションの使用に合わせてスケジューラが最適化されているため、一般的に使用されているものです。-realtime、`-xen など、特定のアプリケーションに使用することを意図した他のバリアントがあります。これらすべてのケースで、スケジューラの動作がどのように異なるかを確認できます。

于 2013-03-01T17:29:16.733 に答える