Home » Mailing lists » Devel » [RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach)
[RFC][PATCH 4/7] VPIDs: vpid macros in non-VPID case [message #1157 is a reply to message #1153] |
Thu, 02 February 2006 16:26   |
Kirill Korotaev
Messages: 137 Registered: January 2006
|
Senior Member |
|
|
This patch specifies an "interface" to virtual pids. That is
some macros/inlines to obtain pids from tasks, convert pids
to vpids and vice versa and set pids.
Kirill
--- ./include/linux/pid.h.vpid_macro 2006-01-03 06:21:10.000000000 +0300
+++ ./include/linux/pid.h 2006-02-02 14:32:41.162807472 +0300
@@ -19,6 +19,19 @@ struct pid
struct list_head pid_list;
};
+#ifndef CONFIG_VIRTUAL_PIDS
+#define __is_virtual_pid(pid) 0
+#define is_virtual_pid(pid) 0
+#define vpid_to_pid(pid) (pid)
+#define __vpid_to_pid(pid) (pid)
+#define pid_type_to_vpid(type, pid) (pid)
+#define __pid_type_to_vpid(type, pid) (pid)
+#define comb_vpid_to_pid(pid) (pid)
+#define comb_pid_to_vpid(pid) (pid)
+#define alloc_vpid(pid, vpid) (pid)
+#define free_vpid(vpid) do { } while (0)
+#endif
+
#define pid_task(elem, type) \
list_entry(elem, struct task_struct, pids[type].pid_list)
--- ./include/linux/sched.h.vpid_macro 2006-02-02 14:15:55.455698192 +0300
+++ ./include/linux/sched.h 2006-02-02 14:32:41.164807168 +0300
@@ -1257,6 +1257,78 @@ static inline unsigned long *end_of_stac
#endif
+#ifndef CONFIG_VIRTUAL_PIDS
+static inline pid_t virt_pid(struct task_struct *tsk)
+{
+ return tsk->pid;
+}
+
+static inline pid_t virt_tgid(struct task_struct *tsk)
+{
+ return tsk->tgid;
+}
+
+static inline pid_t virt_pgid(struct task_struct *tsk)
+{
+ return tsk->signal->pgrp;
+}
+
+static inline pid_t virt_sid(struct task_struct *tsk)
+{
+ return tsk->signal->session;
+}
+
+static inline pid_t get_task_pid_ve(struct task_struct *tsk,
+ struct task_struct *ve_tsk)
+{
+ return tsk->pid;
+}
+
+static inline pid_t get_task_pid(struct task_struct *tsk)
+{
+ return tsk->pid;
+}
+
+static inline pid_t get_task_tgid(struct task_struct *tsk)
+{
+ return tsk->tgid;
+}
+
+static inline pid_t get_task_pgid(struct task_struct *tsk)
+{
+ return tsk->signal->pgrp;
+}
+
+static inline pid_t get_task_sid(struct task_struct *tsk)
+{
+ return tsk->signal->session;
+}
+
+static inline int set_virt_pid(struct task_struct *tsk, pid_t pid)
+{
+ return 0;
+}
+
+static inline void set_virt_tgid(struct task_struct *tsk, pid_t pid)
+{
+}
+
+static inline void set_virt_pgid(struct task_struct *tsk, pid_t pid)
+{
+}
+
+static inline void set_virt_sid(struct task_struct *tsk, pid_t pid)
+{
+}
+
+static inline pid_t get_task_ppid(struct task_struct *p)
+{
+ if (!pid_alive(p))
+ return 0;
+ return (p->pid > 1 ? p->group_leader->real_parent->tgid : 0);
+}
+#endif
+
/* set thread flags in other task's structures
* - see asm/thread_info.h for TIF_xxxx flags available
*/
|
|
|
 |
|
[RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach)
|
 |
|
[RFC][PATCH 1/7] VPIDs: add VPID config option
By: dev on Thu, 02 February 2006 16:16
|
 |
|
[RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: dev on Thu, 02 February 2006 16:21
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: ebiederm on Wed, 08 February 2006 20:29
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: ebiederm on Thu, 09 February 2006 00:37
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: ebiederm on Thu, 09 February 2006 01:36
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: serue on Thu, 09 February 2006 02:51
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: ebiederm on Thu, 09 February 2006 19:22
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: dev on Mon, 20 February 2006 14:55
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
By: dev on Tue, 21 February 2006 16:17
|
 |
|
Re: [RFC][PATCH 2/7] VPIDs: pid/vpid conversions
|
 |
|
[RFC][PATCH 3/7] VPIDs: fork modifications
By: dev on Thu, 02 February 2006 16:24
|
 |
|
Re: [RFC][PATCH 3/7] VPIDs: fork modifications
|
 |
|
[RFC][PATCH 4/7] VPIDs: vpid macros in non-VPID case
|
 |
|
[RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
By: serue on Thu, 02 February 2006 19:29
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
By: serue on Mon, 06 February 2006 14:51
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
By: serue on Mon, 06 February 2006 16:24
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
By: dev on Tue, 07 February 2006 11:42
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
By: dev on Fri, 03 February 2006 14:03
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
Re: [RFC][PATCH 5/7] VPIDs: vpid/pid conversion in VPID enabled case
|
 |
|
[RFC][PATCH 6/7] VPIDs: small proc VPID export
|
 |
|
[RFC][PATCH 7/7] VPIDs: required VPS interface for VPIDs
|
 |
|
Re: [RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach)
|
 |
|
Re: [RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach)
|
 |
|
Re: [RFC][PATCH] VPIDs: Virtualization of PIDs (OpenVZ approach)
|
Goto Forum:
Current Time: Sat Aug 30 08:28:19 GMT 2025
Total time taken to generate the page: 0.07916 seconds
|