5. MLでの議論
Sat, 7 Aug 2004 22:57:08 -0400 (EDT) James Morris <jmorris@redhat.com> wrote:
> > The biggest problem is the global lock:
> > > > avc_has_perm_noaudit:
> > spin_lock_irqsave(&avc_lock, flags);
> > > > Any chance we can get rid of it? Maybe with RCU?
> > Yes, known problem. I plan on trying RCU soon, Rik was looking at a
> seqlock approach.
I'm interested in the scalability of SELinux, and tried with rwlock and RCU approaches.
I simply replaced spinlock_irq_save() by (read|write)_lock_irqsave() first, but performance
improvement was observed in the hackbench
:
:
: On Mon, 16 Aug 2004, Kaigai Kohei wrote:
> Is removing direct reference to AVC-Entry approach acceptable?
> > I'll try to consider this issue further.
Sure, if you can make it work without problems.
- James -- James Morris <jmorris@redhat.com>
6. MLでの議論 (1/2)
The attached patches against to 2.6.8.1 kernel improve the performance and the
scalability of SELinux by RCU-approach. The evaluation results are as follows:
<Environment>
CPU: Itanium2(1GHz) x 4/8/16/32
Memory: enough (no swap)
OS: 2.6.8.1 (SELinux disabled by 'selinux=0' boot option)
2.6.8.1 (SELinux enabled)
2.6.8.1 + rwlock patch by KaiGai
2.6.8.1 + RCU patch by KaiGai
The test program iterates write() to files on tmpfs 500,000 times in parallel.
It is attached as 'rcutest.c'. We observed performance improvement and perfect scalability.
--- 4CPU --- --- 8CPU --- --- 16CPU --- --- 32CPU ---
2.6.8.1(disable) 8.0158[s] 8.0183[s] 8.0146[s] 8.0037[s]
(2.08/ 6.07) (1.86/6.31) (0.78/ 7.33) (2.03/5.94)
2.6.8.1(enable) 78.0957[s] 319.0451[s] 1322.0313[s] too long
(2.47/76.48)(2.47/316.96) (2.43/1319.8) (---/---)
2.6.8.1.rwlock 20.0100[s] 49.0390[s] 90.0200[s] 177.0533[s]
(2.57/17.52) (2.45/46.93) (2.37/87.78) (2.41/175.1)
2.6.8.1.rcu 11.0464[s] 11.0205[s] 11.0372[s] 11.0496[s]
(2.64/8.82) (2.21/8.98) (2.67/ 8.68) (2.51/8.95)
7. MLでの議論 (2/2)
James Morrisから
1or2CPU環境での性能が気になる
計測してみた → Single-Thread テストも悪くない
あと atomic_inc_return() って i386 で実装されてなくね?
これは、後に各アーキテクチャに移植する事に
Paul E.McKenny登場
RCUアルゴリズムの開発者
当時、RCUはLinux kernelで限定的な使われ方がされていた
そのためか、進んでレビューを引き受けてくれる。
Stephen Smalley
実行時に kmalloc() して大丈夫なん?
Lockを獲得するパスがあるけど、それでいいの?