• <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>

            小默

            【LKD】進程管理

            linux-2.6.10

            --------------------

            x86上,thread_info結構定義,在asm/thread_info.h中
            struct thread_info {
                
            struct task_struct    *task;        /* main task structure */
                
            struct exec_domain    *exec_domain;    /* execution domain */
                unsigned 
            long        flags;        /* low level flags */
                unsigned 
            long        status;        /* thread-synchronous flags */
                __u32            cpu;        
            /* current CPU */
                __s32            preempt_count; 
            /* 0 => preemptable, <0 => BUG */


                mm_segment_t        addr_limit;    
            /* thread address space:
                                        0-0xBFFFFFFF for user-thead
                                       0-0xFFFFFFFF for kernel-thread
                                    
            */
                
            struct restart_block    restart_block;

                unsigned 
            long           previous_esp;   /* ESP of the previous stack in case
                                       of nested (IRQ) stacks
                                    
            */
                __u8            supervisor_stack[
            0];
            };
            thread_info結構在進程棧尾端分配

            ---------------------------------------
            //???
            /* how to get the thread information struct from C */
            static inline struct thread_info *current_thread_info(void)
            {
                
            struct thread_info *ti;
                __asm__(
            "andl %%esp,%0; ":"=r" (ti) : "0" (~(THREAD_SIZE - 1)));
                
            return ti;
            }

            ---------------------------------------
            進程描述符
            struct task_struct {
                
            volatile long state;    /* -1 unrunnable, 0 runnable, >0 stopped */
                
            struct thread_info *thread_info;
                atomic_t usage;
                unsigned 
            long flags;    /* per process flags, defined below */
                unsigned 
            long ptrace;

                
            int lock_depth;        /* Lock depth */

                
            int prio, static_prio;
                
            struct list_head run_list;
                prio_array_t 
            *array;

                unsigned 
            long sleep_avg;
                
            long interactive_credit;
                unsigned 
            long long timestamp, last_ran;
                
            int activated;

                unsigned 
            long policy;
                cpumask_t cpus_allowed;
                unsigned 
            int time_slice, first_time_slice;

            #ifdef CONFIG_SCHEDSTATS
                
            struct sched_info sched_info;
            #endif

                
            struct list_head tasks;
                
            /*
                 * ptrace_list/ptrace_children forms the list of my children
                 * that were stolen by a ptracer.
                 
            */
                
            struct list_head ptrace_children;
                
            struct list_head ptrace_list;

                
            struct mm_struct *mm, *active_mm;

            /* task state */
                
            struct linux_binfmt *binfmt;
                
            long exit_state;
                
            int exit_code, exit_signal;
                
            int pdeath_signal;  /*  The signal sent when the parent dies  */
                
            /* ??? */
                unsigned 
            long personality;
                unsigned did_exec:
            1;
                pid_t pid;
                pid_t tgid;
                
            /* 
                 * pointers to (original) parent process, youngest child, younger sibling,
                 * older sibling, respectively.  (p->father can be replaced with 
                 * p->parent->pid)
                 
            */
                
            struct task_struct *real_parent; /* real parent process (when being debugged) */
                
            struct task_struct *parent;    /* parent process */
                
            /*
                 * children/sibling forms the list of my children plus the
                 * tasks I'm ptracing.
                 
            */
                
            struct list_head children;    /* list of my children */
                
            struct list_head sibling;    /* linkage in my parent's children list */
                
            struct task_struct *group_leader;    /* threadgroup leader */

                
            /* PID/PID hash table linkage. */
                
            struct pid pids[PIDTYPE_MAX];

                wait_queue_head_t wait_chldexit;    
            /* for wait4() */
                
            struct completion *vfork_done;        /* for vfork() */
                
            int __user *set_child_tid;        /* CLONE_CHILD_SETTID */
                
            int __user *clear_child_tid;        /* CLONE_CHILD_CLEARTID */

                unsigned 
            long rt_priority;
                unsigned 
            long it_real_value, it_prof_value, it_virt_value;
                unsigned 
            long it_real_incr, it_prof_incr, it_virt_incr;
                
            struct timer_list real_timer;
                unsigned 
            long utime, stime;
                unsigned 
            long nvcsw, nivcsw; /* context switch counts */
                
            struct timespec start_time;
            /* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
                unsigned 
            long min_flt, maj_flt;
            /* process credentials */
                uid_t uid,euid,suid,fsuid;
                gid_t gid,egid,sgid,fsgid;
                
            struct group_info *group_info;
                kernel_cap_t   cap_effective, cap_inheritable, cap_permitted;
                unsigned keep_capabilities:
            1;
                
            struct user_struct *user;
            #ifdef CONFIG_KEYS
                
            struct key *session_keyring;    /* keyring inherited over fork */
                
            struct key *process_keyring;    /* keyring private to this process (CLONE_THREAD) */
                
            struct key *thread_keyring;    /* keyring private to this thread */
            #endif
                unsigned 
            short used_math;
                
            char comm[16];
            /* file system info */
                
            int link_count, total_link_count;
            /* ipc stuff */
                
            struct sysv_sem sysvsem;
            /* CPU-specific state of this task */
                
            struct thread_struct thread;
            /* filesystem information */
                
            struct fs_struct *fs;
            /* open file information */
                
            struct files_struct *files;
            /* namespace */
                
            struct namespace *namespace;
            /* signal handlers */
                
            struct signal_struct *signal;
                
            struct sighand_struct *sighand;

                sigset_t blocked, real_blocked;
                
            struct sigpending pending;

                unsigned 
            long sas_ss_sp;
                size_t sas_ss_size;
                
            int (*notifier)(void *priv);
                
            void *notifier_data;
                sigset_t 
            *notifier_mask;
                
                
            void *security;
                
            struct audit_context *audit_context;

            /* Thread group tracking */
                   u32 parent_exec_id;
                   u32 self_exec_id;
            /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */
                spinlock_t alloc_lock;
            /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
                spinlock_t proc_lock;
            /* context-switch lock */
                spinlock_t switch_lock;

            /* journalling filesystem info */
                
            void *journal_info;

            /* VM state */
                
            struct reclaim_state *reclaim_state;

                
            struct dentry *proc_dentry;
                
            struct backing_dev_info *backing_dev_info;

                
            struct io_context *io_context;

                unsigned 
            long ptrace_message;
                siginfo_t 
            *last_siginfo; /* For ptrace use.  */
            /*
             * current io wait handle: wait queue entry to use for io waits
             * If this thread is processing aio, this points at the waitqueue
             * inside the currently handled kiocb. It may be NULL (i.e. default
             * to a stack based synchronous wait) if its doing sync IO.
             
            */
                wait_queue_t 
            *io_wait;
            #ifdef CONFIG_NUMA
                  
            struct mempolicy *mempolicy;
                  
            short il_next;        /* could be shared with used_math */
            #endif
            };

            posted on 2010-05-16 21:38 小默 閱讀(364) 評論(0)  編輯 收藏 引用 所屬分類: Linux

            導航

            統計

            留言簿(13)

            隨筆分類(287)

            隨筆檔案(289)

            漏洞

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            精品免费久久久久国产一区| jizzjizz国产精品久久| 久久亚洲精品无码观看不卡| 久久久这里有精品中文字幕| 久久精品国产乱子伦| 久久国产精品成人片免费| 久久免费视频观看| 久久久噜噜噜久久| 久久久久久午夜成人影院| 国产99久久久国产精免费| 久久99这里只有精品国产| 久久精品一区二区| 久久婷婷人人澡人人爽人人爱| 狠狠色丁香婷婷综合久久来 | 噜噜噜色噜噜噜久久| 久久久久无码精品国产| 久久频这里精品99香蕉久| 久久99精品国产麻豆宅宅| 中文字幕久久久久人妻| 久久精品?ⅴ无码中文字幕| 久久久久久九九99精品| 欧美亚洲国产精品久久久久| 国产激情久久久久影院小草 | 97久久久精品综合88久久| 少妇被又大又粗又爽毛片久久黑人 | 国产麻豆精品久久一二三| 欧美午夜A∨大片久久 | jizzjizz国产精品久久| 色天使久久综合网天天| 婷婷久久精品国产| 久久久久久亚洲精品无码| 国产精品久久久久久影院| 亚洲午夜久久久久妓女影院 | 久久综合色老色| 青青热久久国产久精品| 久久久网中文字幕| 国内精品久久久久影院网站| 国产视频久久| 久久精品三级视频| 久久强奷乱码老熟女| 久久噜噜久久久精品66|