From 8b6312f4dcc1efe7975731b6c47dd134282bd9ac Mon Sep 17 00:00:00 2001 From: "Eric W. Biederman" Date: Sat, 10 Feb 2007 01:44:34 -0800 Subject: [PATCH] vt: refactor console SAK processing This does several things. - It moves looking up of the current foreground console into process context where we can safely take the semaphore that protects this operation. - It uses the new flavor of work queue processing. - This generates a factor of do_SAK, __do_SAK that runs immediately. - This calls __do_SAK with the console semaphore held ensuring nothing else happens to the console while we process the SAK operation. - With the console SAK processing moved into process context this patch removes the xchg operations that I used to attempt to attomically update struct pid, because of the strange locking used in the SAK processing. With SAK using the normal console semaphore nothing special is needed. Cc: Oleg Nesterov Signed-off-by: Eric W. Biederman Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- include/linux/console_struct.h | 3 +++ 1 file changed, 3 insertions(+) (limited to 'include/linux/console_struct.h') diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index ed6c0fe..a86162b 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -11,6 +11,7 @@ #include #include +#include struct vt_struct; @@ -103,6 +104,7 @@ struct vc_data { struct vc { struct vc_data *d; + struct work_struct SAK_work; /* might add scrmem, vt_struct, kbd at some time, to have everything in one place - the disadvantage @@ -110,6 +112,7 @@ struct vc { }; extern struct vc vc_cons [MAX_NR_CONSOLES]; +extern void vc_SAK(struct work_struct *work); #define CUR_DEF 0 #define CUR_NONE 1 -- cgit v1.1