文章归档

Red Hat Enterprise Linux 6 Resource Management Guide

Redhat在关于cgroup方面的一份非常详细的文档

  1. Red Hat Enterprise Linux 6 Resource Management Guide

what is the real necessary change

看内核patchs的时候,经常会看到一些清理代码的patch,理由是unnecessary,比如这个:

[PATCH] vfs: no need to check about IS_IMMUTABLE in do_fallocate

From: Ashish Sangwan <a.sangwan <at> samsung.com> In do_fallocate, first there is check for FMODE_WRITE and after that there is second check for IS_IMMUTABLE. A file cannot be opened in write mode if the corresponding inode is immutable, hence the second check is not required. Signed-off-by: Ashish Sangwan <a.sangwan <at> samsung.com> Signed-off-by: Namjae Jeon <namjae.jeon <at> samsung.com> --- fs/open.c | 3 --- 1 files changed, 0 insertions(+), 3 deletions(-) diff --git a/fs/open.c b/fs/open.c index 8c74100..939e402 100644 --- a/fs/open.c +++ b/fs/open.c <at> <at> -245,9 +245,6 <at> <at> int do_fallocate(struct

»» 继续阅读全文

Linux: The Journaling Block Device

Kedar Sovani on kerneltrap

Atomicity is a property of an operation either to succeed or fail completely. Disks assure atomicity at the sector level. This means that a write to a sector either goes through completely or not at all. But when an operation spans over multiple sectors of the disk, a higher-level mechanism is needed. This mechanism should ensure that modifications to the entire set of sectors are handled atomically. Failure to do so leads to inconsistencies. This document talks about the implementation of the Journaling Block Device in Linux.

Let's look at how these inconsistencies could

»» 继续阅读全文

1、spinlock

关于MCS Spinlock的锁释放问题补充一点,关键的问题是,A在判断自己是否是最后一个申请者和如果是的话就释放mcs_lock,这两个操作无法保证原子性(而且必须是原子才行,因为这中间如果出现新的申请者,情况就会变化),所以 才要依赖cmp_and_swap操作。

ticket spinlock和mcs_spinlock其实思路是一样的。

还有很重要的一个就是:申请了锁却忘了释放绝对是致命的

2、RCU

第 5 页,共 5 页12345