[Galaxy 3 Android Development] cdesai:
Difference in kernel folder

diff -crB linux/kernel g3/kernel > kernel.patch

diff -crB linux/kernel/cgroup.c g3/kernel/cgroup.c
*** linux/kernel/cgroup.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/cgroup.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 51,56 ****
--- 51,57 ----
#include <linux/pid_namespace.h>
#include <linux/idr.h>
#include <linux/vmalloc.h> /* TODO: replace with more sophisticated array */
+ #include <linux/capability.h>

#include <asm/atomic.h>

***************
*** 1555,1560 ****
--- 1556,1570 ----
retval = ss->can_attach(ss, cgrp, tsk, false);
if (retval)
return retval;
+	} else if (!capable(CAP_SYS_ADMIN)) {
+	const struct cred *cred = current_cred(), *tcred;
+
+	/* No can_attach() - check perms generically */
+	tcred = __task_cred(tsk);
+	if (cred->euid != tcred->uid &&
+	cred->euid != tcred->suid) {
+	return -EACCES;
+	}
}
}

***************
*** 1611,1617 ****
static int attach_task_by_pid(struct cgroup *cgrp, u64 pid)
{
struct task_struct *tsk;
-	const struct cred *cred = current_cred(), *tcred;
int ret;

if (pid) {
--- 1621,1626 ----
***************
*** 1621,1634 ****
rcu_read_unlock();
return -ESRCH;
}
-
-	tcred = __task_cred(tsk);
-	if (cred->euid &&
-	cred->euid != tcred->uid &&
-	cred->euid != tcred->suid) {
-	rcu_read_unlock();
-	return -EACCES;
-	}
get_task_struct(tsk);
rcu_read_unlock();
} else {
--- 1630,1635 ----
diff -crB linux/kernel/cgroup_freezer.c g3/kernel/cgroup_freezer.c
*** linux/kernel/cgroup_freezer.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/cgroup_freezer.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 163,168 ****
--- 163,176 ----
{
struct freezer *freezer;

+	if ((current != task) && (!capable(CAP_SYS_ADMIN))) {
+	const struct cred *cred = current_cred(), *tcred;
+
+	tcred = __task_cred(task);
+	if (cred->euid != tcred->uid && cred->euid != tcred->suid)
+	return -EPERM;
+	}
+
/*
* Anything frozen can't move or be moved to/from.
*
diff -crB linux/kernel/cpuset.c g3/kernel/cpuset.c
*** linux/kernel/cpuset.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/cpuset.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 1330,1335 ****
--- 1330,1342 ----
int ret;
struct cpuset *cs = cgroup_cs(cont);

+	if ((current != task) && (!capable(CAP_SYS_ADMIN))) {
+	const struct cred *cred = current_cred(), *tcred;
+
+	if (cred->euid != tcred->uid && cred->euid != tcred->suid)
+	return -EPERM;
+	}
+
if (cpumask_empty(cs->cpus_allowed) || nodes_empty(cs->mems_allowed))
return -ENOSPC;

diff -crB linux/kernel/fork.c g3/kernel/fork.c
*** linux/kernel/fork.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/fork.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 138,143 ****
--- 138,146 ----
/* SLAB cache for mm_struct structures (tsk->mm) */
static struct kmem_cache *mm_cachep;

+ /* Notifier list called when a task struct is freed */
+ static ATOMIC_NOTIFIER_HEAD(task_free_notifier);
+
static void account_kernel_stack(struct thread_info *ti, int account)
{
struct zone *zone = page_zone(virt_to_page(ti));
***************
*** 156,161 ****
--- 159,176 ----
}
EXPORT_SYMBOL(free_task);

+ int task_free_register(struct notifier_block *n)
+ {
+	return atomic_notifier_chain_register(&task_free_notifier, n);
+ }
+ EXPORT_SYMBOL(task_free_register);
+
+ int task_free_unregister(struct notifier_block *n)
+ {
+	return atomic_notifier_chain_unregister(&task_free_notifier, n);
+ }
+ EXPORT_SYMBOL(task_free_unregister);
+
void __put_task_struct(struct task_struct *tsk)
{
WARN_ON(!tsk->exit_state);
***************
*** 165,170 ****
--- 180,186 ----
exit_creds(tsk);
delayacct_tsk_free(tsk);

+	atomic_notifier_call_chain(&task_free_notifier, 0, tsk);
if (!profile_handoff_task(tsk))
free_task(tsk);
}
diff -crB linux/kernel/futex.c g3/kernel/futex.c
*** linux/kernel/futex.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/futex.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 220,225 ****
--- 220,226 ----
struct mm_struct *mm = current->mm;
struct page *page;
int err;
+	struct vm_area_struct *vma;

/*
* The futex address must be "naturally" aligned.
***************
*** 242,247 ****
--- 243,279 ----
key->private.mm = mm;
key->private.address = address;
get_futex_key_refs(key);
+	return 0;
+	}
+
+	/*
+	* The futex is hashed differently depending on whether
+	* it's in a shared or private mapping. So check vma first.
+	*/
+	vma = find_extend_vma(mm, address);
+	if (unlikely(!vma))
+	return -EFAULT;
+
+	/*
+	* Permissions.
+	*/
+	if (unlikely((vma->vm_flags & (VM_IO|VM_READ)) != VM_READ))
+	return (vma->vm_flags & VM_IO) ? -EPERM : -EACCES;
+
+	/*
+	* Private mappings are handled in a simple way.
+	*
+	* NOTE: When userspace waits on a MAP_SHARED mapping, even if
+	* it's a read-only handle, it's expected that futexes attach to
+	* the object not the particular process. Therefore we use
+	* VM_MAYSHARE here, not VM_SHARED which is restricted to shared
+	* mappings of _writable_ handles.
+	*/
+	if (likely(!(vma->vm_flags & VM_MAYSHARE))) {
+	key->both.offset |= FUT_OFF_MMSHARED; /* reference taken on mm */
+	key->private.mm = mm;
+	key->private.address = address;
+	get_futex_key_refs(key);
return 0;
}

Only in g3/kernel: kernel_sec_debug.c
diff -crB linux/kernel/Makefile g3/kernel/Makefile
*** linux/kernel/Makefile	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/Makefile	2011-02-26 04:41:59.000000000 -0800
***************
*** 96,101 ****
--- 96,102 ----
obj-$(CONFIG_SLOW_WORK) += slow-work.o
obj-$(CONFIG_SLOW_WORK_DEBUG) += slow-work-debugfs.o
obj-$(CONFIG_PERF_EVENTS) += perf_event.o
+ obj-$(CONFIG_KERNEL_DEBUG_SEC) += kernel_sec_debug.o

ifneq ($(CONFIG_SCHED_OMIT_FRAME_POINTER),y)
# According to Alan Modra <alan@linuxcare.com.au>, the -fno-omit-frame-pointer is
diff -crB linux/kernel/panic.c g3/kernel/panic.c
*** linux/kernel/panic.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/panic.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 29,35 ****
static int pause_on_oops_flag;
static DEFINE_SPINLOCK(pause_on_oops_lock);

! int panic_timeout;

ATOMIC_NOTIFIER_HEAD(panic_notifier_list);

--- 29,38 ----
static int pause_on_oops_flag;
static DEFINE_SPINLOCK(pause_on_oops_lock);

! #ifndef CONFIG_PANIC_TIMEOUT
! #define CONFIG_PANIC_TIMEOUT 0
! #endif
! int panic_timeout = CONFIG_PANIC_TIMEOUT;

ATOMIC_NOTIFIER_HEAD(panic_notifier_list);

Only in g3/kernel/power: consoleearlysuspend.c
Only in g3/kernel/power: earlysuspend.c
Only in g3/kernel/power: fbearlysuspend.c
diff -crB linux/kernel/power/Kconfig g3/kernel/power/Kconfig
*** linux/kernel/power/Kconfig	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/power/Kconfig	2011-02-26 04:41:59.000000000 -0800
***************
*** 119,124 ****
--- 119,191 ----
config HIBERNATION_NVS
bool

+ config HAS_WAKELOCK
+	bool
+
+ config HAS_EARLYSUSPEND
+	bool
+
+ config WAKELOCK
+	bool "Wake lock"
+	depends on PM && RTC_CLASS
+	default n
+	select HAS_WAKELOCK
+	---help---
+	Enable wakelocks. When user space request a sleep state the
+	sleep request will be delayed until no wake locks are held.
+
+ config WAKELOCK_STAT
+	bool "Wake lock stats"
+	depends on WAKELOCK
+	default y
+	---help---
+	Report wake lock stats in /proc/wakelocks
+
+ config USER_WAKELOCK
+	bool "Userspace wake locks"
+	depends on WAKELOCK
+	default y
+	---help---
+	User-space wake lock api. Write "lockname" or "lockname timeout"
+	to /sys/power/wake_lock lock and if needed create a wake lock.
+	Write "lockname" to /sys/power/wake_unlock to unlock a user wake
+	lock.
+
+ config EARLYSUSPEND
+	bool "Early suspend"
+	depends on WAKELOCK
+	default y
+	select HAS_EARLYSUSPEND
+	---help---
+	Call early suspend handlers when the user requested sleep state
+	changes.
+
+ choice
+	prompt "User-space screen access"
+	default FB_EARLYSUSPEND if !FRAMEBUFFER_CONSOLE
+	default CONSOLE_EARLYSUSPEND
+	depends on HAS_EARLYSUSPEND
+
+	config NO_USER_SPACE_SCREEN_ACCESS_CONTROL
+	bool "None"
+
+	config CONSOLE_EARLYSUSPEND
+	bool "Console switch on early-suspend"
+	depends on HAS_EARLYSUSPEND && VT
+	---help---
+	Register early suspend handler to perform a console switch to
+	when user-space should stop drawing to the screen and a switch
+	back when it should resume.
+
+	config FB_EARLYSUSPEND
+	bool "Sysfs interface"
+	depends on HAS_EARLYSUSPEND
+	---help---
+	Register early suspend handler that notifies and waits for
+	user-space through sysfs when user-space should stop drawing
+	to the screen and notifies user-space when it should resume.
+ endchoice
+
config HIBERNATION
bool "Hibernation (aka 'suspend to disk')"
depends on PM && SWAP && ARCH_HIBERNATION_POSSIBLE
diff -crB linux/kernel/power/main.c g3/kernel/power/main.c
*** linux/kernel/power/main.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/power/main.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 147,153 ****
--- 147,157 ----
const char *buf, size_t n)
{
#ifdef CONFIG_SUSPEND
+ #ifdef CONFIG_EARLYSUSPEND
+	suspend_state_t state = PM_SUSPEND_ON;
+ #else
suspend_state_t state = PM_SUSPEND_STANDBY;
+ #endif
const char * const *s;
#endif
char *p;
***************
*** 169,176 ****
--- 173,187 ----
break;
}
if (state < PM_SUSPEND_MAX && *s)
+ #ifdef CONFIG_EARLYSUSPEND
+	if (state == PM_SUSPEND_ON || valid_state(state)) {
+	error = 0;
+	request_suspend_state(state);
+	}
+ #else
error = enter_state(state);
#endif
+ #endif

Exit:
return error ? error : n;
***************
*** 203,208 ****
--- 214,224 ----
power_attr(pm_trace);
#endif /* CONFIG_PM_TRACE */

+ #ifdef CONFIG_USER_WAKELOCK
+ power_attr(wake_lock);
+ power_attr(wake_unlock);
+ #endif
+
static struct attribute * g[] = {
&state_attr.attr,
#ifdef CONFIG_PM_TRACE
***************
*** 211,216 ****
--- 227,236 ----
#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_PM_DEBUG)
&pm_test_attr.attr,
#endif
+ #ifdef CONFIG_USER_WAKELOCK
+	&wake_lock_attr.attr,
+	&wake_unlock_attr.attr,
+ #endif
NULL,
};

diff -crB linux/kernel/power/Makefile g3/kernel/power/Makefile
*** linux/kernel/power/Makefile	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/power/Makefile	2011-02-26 04:41:59.000000000 -0800
***************
*** 10,14 ****
--- 10,19 ----
obj-$(CONFIG_PM_TEST_SUSPEND)	+= suspend_test.o
obj-$(CONFIG_HIBERNATION)	+= swsusp.o hibernate.o snapshot.o swap.o user.o
obj-$(CONFIG_HIBERNATION_NVS)	+= hibernate_nvs.o
+ obj-$(CONFIG_WAKELOCK)	+= wakelock.o
+ obj-$(CONFIG_USER_WAKELOCK)	+= userwakelock.o
+ obj-$(CONFIG_EARLYSUSPEND)	+= earlysuspend.o
+ obj-$(CONFIG_CONSOLE_EARLYSUSPEND)	+= consoleearlysuspend.o
+ obj-$(CONFIG_FB_EARLYSUSPEND)	+= fbearlysuspend.o

obj-$(CONFIG_MAGIC_SYSRQ)	+= poweroff.o
diff -crB linux/kernel/power/power.h g3/kernel/power/power.h
*** linux/kernel/power/power.h	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/power/power.h	2011-02-26 04:41:59.000000000 -0800
***************
*** 236,238 ****
--- 236,262 ----
{
}
#endif
+
+ #ifdef CONFIG_WAKELOCK
+ /* kernel/power/wakelock.c */
+ extern struct workqueue_struct *suspend_work_queue;
+ extern struct wake_lock main_wake_lock;
+ extern suspend_state_t requested_suspend_state;
+ #endif
+
+ #ifdef CONFIG_USER_WAKELOCK
+ ssize_t wake_lock_show(struct kobject *kobj, struct kobj_attribute *attr,
+	char *buf);
+ ssize_t wake_lock_store(struct kobject *kobj, struct kobj_attribute *attr,
+	const char *buf, size_t n);
+ ssize_t wake_unlock_show(struct kobject *kobj, struct kobj_attribute *attr,
+	char *buf);
+ ssize_t wake_unlock_store(struct kobject *kobj, struct kobj_attribute *attr,
+	const char *buf, size_t n);
+ #endif
+
+ #ifdef CONFIG_EARLYSUSPEND
+ /* kernel/power/earlysuspend.c */
+ void request_suspend_state(suspend_state_t state);
+ suspend_state_t get_suspend_state(void);
+ #endif
diff -crB linux/kernel/power/process.c g3/kernel/power/process.c
*** linux/kernel/power/process.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/power/process.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 14,19 ****
--- 14,20 ----
#include <linux/module.h>
#include <linux/syscalls.h>
#include <linux/freezer.h>
+ #include <linux/wakelock.h>

/*
* Timeout for stopping processes
***************
*** 37,42 ****
--- 38,44 ----
struct timeval start, end;
u64 elapsed_csecs64;
unsigned int elapsed_csecs;
+	unsigned int wakeup = 0;

do_gettimeofday(&start);

***************
*** 63,68 ****
--- 65,74 ----
} while_each_thread(g, p);
read_unlock(&tasklist_lock);
yield();	/* Yield is okay here */
+	if (todo && has_wake_lock(WAKE_LOCK_SUSPEND)) {
+	wakeup = 1;
+	break;
+	}
if (time_after(jiffies, end_time))
break;
} while (todo);
***************
*** 79,92 ****
* but it cleans up leftover PF_FREEZE requests.
*/
printk("\n");
!	printk(KERN_ERR "Freezing of tasks failed after %d.%02d seconds "
"(%d tasks refusing to freeze):\n",
elapsed_csecs / 100, elapsed_csecs % 100, todo);
!	show_state();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
task_lock(p);
!	if (freezing(p) && !freezer_should_skip(p))
printk(KERN_ERR " %s\n", p->comm);
cancel_freezing(p);
task_unlock(p);
--- 85,101 ----
* but it cleans up leftover PF_FREEZE requests.
*/
printk("\n");
!	printk(KERN_ERR "Freezing of tasks %s after %d.%02d seconds "
"(%d tasks refusing to freeze):\n",
+	wakeup ? "aborted" : "failed",
elapsed_csecs / 100, elapsed_csecs % 100, todo);
!	if(!wakeup)
!	show_state();
read_lock(&tasklist_lock);
do_each_thread(g, p) {
task_lock(p);
!	if (freezing(p) && !freezer_should_skip(p) &&
!	elapsed_csecs > 100)
printk(KERN_ERR " %s\n", p->comm);
cancel_freezing(p);
task_unlock(p);
diff -crB linux/kernel/power/suspend.c g3/kernel/power/suspend.c
*** linux/kernel/power/suspend.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/power/suspend.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 15,24 ****
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/syscalls.h>
!
#include "power.h"

const char *const pm_states[PM_SUSPEND_MAX] = {
[PM_SUSPEND_STANDBY]	= "standby",
[PM_SUSPEND_MEM]	= "mem",
};
--- 15,28 ----
#include <linux/console.h>
#include <linux/cpu.h>
#include <linux/syscalls.h>
! #include <linux/cpufreq.h>
! #include <plat/s5p6442-dvfs.h>
#include "power.h"

const char *const pm_states[PM_SUSPEND_MAX] = {
+ #ifdef CONFIG_EARLYSUSPEND
+	[PM_SUSPEND_ON]	= "on",
+ #endif
[PM_SUSPEND_STANDBY]	= "standby",
[PM_SUSPEND_MEM]	= "mem",
};
***************
*** 122,131 ****
--- 126,142 ----
*
*	This function should be called after devices have been suspended.
*/
+ #ifdef CONFIG_CPU_FREQ
+ static char governor_name[CPUFREQ_NAME_LEN];
+ static char userspace_governor[CPUFREQ_NAME_LEN] = "userspace";
+ #endif /* CONFIG_CPU_FREQ */
static int suspend_enter(suspend_state_t state)
{
int error;

+ #ifdef CONFIG_CPU_FREQ
+	dvfs_set_max_freq_lock();
+ #endif /* CONFIG_CPU_FREQ */
if (suspend_ops->prepare) {
error = suspend_ops->prepare();
if (error)
***************
*** 163,168 ****
--- 174,182 ----

arch_suspend_enable_irqs();
BUG_ON(irqs_disabled());
+ #ifdef CONFIG_CPU_FREQ
+	dvfs_set_max_freq_unlock();
+ #endif /* CONFIG_CPU_FREQ */

Enable_cpus:
enable_nonboot_cpus();
Only in g3/kernel/power: userwakelock.c
Only in g3/kernel/power: wakelock.c
diff -crB linux/kernel/printk.c g3/kernel/printk.c
*** linux/kernel/printk.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/printk.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 51,56 ****
--- 51,60 ----

#define __LOG_BUF_LEN	(1 << CONFIG_LOG_BUF_SHIFT)

+ #ifdef CONFIG_DEBUG_LL
+ extern void printascii(char *);
+ #endif
+
/* printk's without a loglevel use this.. */
#define DEFAULT_MESSAGE_LOGLEVEL 4 /* KERN_WARNING */

***************
*** 162,167 ****
--- 166,191 ----
}
#endif

+ /*
+ * Mark for GetLog (tkhwang)
+ */
+
+ struct struct_kernel_log_mark {
+	u32 special_mark_1;
+	u32 special_mark_2;
+	u32 special_mark_3;
+	u32 special_mark_4;
+	void *p__log_buf;
+ };
+
+ static struct struct_kernel_log_mark kernel_log_mark = {
+ .special_mark_1 = (('*' << 24) | ('^' << 16) | ('^' << 8) | ('*' << 0)),
+ .special_mark_2 = (('I' << 24) | ('n' << 16) | ('f' << 8) | ('o' << 0)),
+ .special_mark_3 = (('H' << 24) | ('e' << 16) | ('r' << 8) | ('e' << 0)),
+ .special_mark_4 = (('k' << 24) | ('l' << 16) | ('o' << 8) | ('g' << 0)),
+ .p__log_buf = __log_buf,
+ };
+
static int __init log_buf_len_setup(char *str)
{
unsigned size = memparse(str, &str);
***************
*** 198,203 ****
--- 222,232 ----
printk(KERN_NOTICE "log_buf_len: %d\n", log_buf_len);
}
out:
+
+	/*
+	* Mark for GetLog (tkhwang)
+	*/
+	kernel_log_mark.p__log_buf = __log_buf;
return 1;
}

***************
*** 257,262 ****
--- 286,338 ----
#endif

/*
+ * Return the number of unread characters in the log buffer.
+ */
+ static int log_buf_get_len(void)
+ {
+	return logged_chars;
+ }
+
+ /*
+ * Clears the ring-buffer
+ */
+ void log_buf_clear(void)
+ {
+	logged_chars = 0;
+ }
+
+ /*
+ * Copy a range of characters from the log buffer.
+ */
+ int log_buf_copy(char *dest, int idx, int len)
+ {
+	int ret, max;
+	bool took_lock = false;
+
+	if (!oops_in_progress) {
+	spin_lock_irq(&logbuf_lock);
+	took_lock = true;
+	}
+
+	max = log_buf_get_len();
+	if (idx < 0 || idx >= max) {
+	ret = -1;
+	} else {
+	if (len > max - idx)
+	len = max - idx;
+	ret = len;
+	idx += (log_end - max);
+	while (len-- > 0)
+	dest[len] = LOG_BUF(idx + len);
+	}
+
+	if (took_lock)
+	spin_unlock_irq(&logbuf_lock);
+
+	return ret;
+ }
+
+ /*
* Commands to do_syslog:
*
*	0 -- Close the log. Currently a NOP.
***************
*** 714,719 ****
--- 790,798 ----
printed_len += vscnprintf(printk_buf + printed_len,
sizeof(printk_buf) - printed_len, fmt, args);

+ #ifdef	CONFIG_DEBUG_LL
+	printascii(printk_buf);
+ #endif

p = printk_buf;

diff -crB linux/kernel/sched.c g3/kernel/sched.c
*** linux/kernel/sched.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/sched.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 6899,6905 ****
unsigned state;

state = p->state ? __ffs(p->state) + 1 : 0;
!	printk(KERN_INFO "%-13.13s %c", p->comm,
state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
#if BITS_PER_LONG == 32
if (state == TASK_RUNNING)
--- 6899,6905 ----
unsigned state;

state = p->state ? __ffs(p->state) + 1 : 0;
!	printk(KERN_INFO "%-15.15s %c", p->comm,
state < sizeof(stat_nam) - 1 ? stat_nam[state] : '?');
#if BITS_PER_LONG == 32
if (state == TASK_RUNNING)
***************
*** 9373,9378 ****
--- 9373,9396 ----
{
int i, j;
unsigned long alloc_size = 0, ptr;
+
+ /*
+ * Add GAForensic init for preventing symbol removal for optimization. (tkhwang)
+ */
+ //{
+	GAFINFO.rq_struct_curr = offsetof(struct rq, curr);
+
+	unsigned short *checksum	=	&(GAFINFO.GAFINFOCheckSum);
+	unsigned char *memory	=	&GAFINFO;
+	unsigned char	address;
+	for (*checksum=0,address = 0; address < (sizeof(GAFINFO)-sizeof(GAFINFO.GAFINFOCheckSum)); address++)
+	{
+	if ((*checksum) & 0x8000)
+	(*checksum) = (((*checksum) << 1) | 1 ) ^ memory[address];
+	else
+	(*checksum) = ((*checksum) << 1) ^ memory[address];
+	}
+ //}

#ifdef CONFIG_FAIR_GROUP_SCHED
alloc_size += 2 * nr_cpu_ids * sizeof(void **);
***************
*** 9613,9625 ****
return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
}

void __might_sleep(char *file, int line, int preempt_offset)
{
#ifdef in_atomic
static unsigned long prev_jiffy;	/* ratelimiting */

if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) ||
!	system_state != SYSTEM_RUNNING || oops_in_progress)
return;
if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
return;
--- 9631,9654 ----
return (nested == PREEMPT_INATOMIC_BASE + preempt_offset);
}

+ static int __might_sleep_init_called;
+ int __init __might_sleep_init(void)
+ {
+	__might_sleep_init_called = 1;
+	return 0;
+ }
+ early_initcall(__might_sleep_init);
+
void __might_sleep(char *file, int line, int preempt_offset)
{
#ifdef in_atomic
static unsigned long prev_jiffy;	/* ratelimiting */

if ((preempt_count_equals(preempt_offset) && !irqs_disabled()) ||
!	oops_in_progress)
!	return;
!	if (system_state != SYSTEM_RUNNING &&
!	(!__might_sleep_init_called || system_state != SYSTEM_BOOTING))
return;
if (time_before(jiffies, prev_jiffy + HZ) && prev_jiffy)
return;
***************
*** 10439,10444 ****
--- 10468,10482 ----
static int
cpu_cgroup_can_attach_task(struct cgroup *cgrp, struct task_struct *tsk)
{
+	if ((current != tsk) && (!capable(CAP_SYS_NICE))) {
+	const struct cred *cred = current_cred(), *tcred;
+
+	tcred = __task_cred(tsk);
+
+	if (cred->euid != tcred->uid && cred->euid != tcred->suid)
+	return -EPERM;
+	}
+
#ifdef CONFIG_RT_GROUP_SCHED
if (!sched_rt_can_attach(cgroup_tg(cgrp), tsk))
return -EINVAL;
diff -crB linux/kernel/sysctl.c g3/kernel/sysctl.c
*** linux/kernel/sysctl.c	2010-02-23 07:38:51.000000000 -0800
--- g3/kernel/sysctl.c	2011-02-26 04:41:59.000000000 -0800
***************
*** 79,84 ****
--- 79,85 ----
extern unsigned int core_pipe_limit;
extern int pid_max;
extern int min_free_kbytes;
+ extern int min_free_order_shift;
extern int pid_max_min, pid_max_max;
extern int sysctl_drop_caches;
extern int percpu_pagelist_fraction;
***************
*** 1229,1234 ****
--- 1230,1243 ----
.extra1	= &zero,
},
{
+	.ctl_name	= CTL_UNNUMBERED,
+	.procname	= "min_free_order_shift",
+	.data	= &min_free_order_shift,
+	.maxlen	= sizeof(min_free_order_shift),
+	.mode	= 0644,
+	.proc_handler	= &proc_dointvec
+	},
+	{
.ctl_name	= VM_PERCPU_PAGELIST_FRACTION,
.procname	= "percpu_pagelist_fraction",
.data	= &percpu_pagelist_fraction,