• <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)

            漏洞

            搜索

            積分與排名

            最新評論

            閱讀排行榜

            久久久噜噜噜久久中文字幕色伊伊 | 久久久WWW免费人成精品| 91久久九九无码成人网站| 国产色综合久久无码有码| 久久精品国产亚洲av日韩| 久久精品成人免费看| 狠狠色综合久久久久尤物| 久久99久国产麻精品66| 一本大道加勒比久久综合| 亚洲愉拍99热成人精品热久久| 久久国产乱子伦精品免费强| 亚洲国产精品无码久久九九| 久久婷婷综合中文字幕| 狠狠色丁香久久婷婷综合蜜芽五月| 久久国产精品无码HDAV| 亚洲欧美一区二区三区久久| 日本免费一区二区久久人人澡| 国产偷久久久精品专区 | 无码乱码观看精品久久| 国产精品99久久精品| 久久国产精品久久精品国产| 久久亚洲中文字幕精品一区| 久久综合久久鬼色| 青青草国产成人久久91网| 国产成人久久AV免费| 亚洲AV无码成人网站久久精品大| 欧洲性大片xxxxx久久久| 青青草国产成人久久91网| 粉嫩小泬无遮挡久久久久久| 久久无码专区国产精品发布| 亚洲国产精品狼友中文久久久 | 久久精品国产亚洲网站| 久久久噜噜噜www成人网| 中文精品久久久久人妻不卡| 三级三级久久三级久久| 午夜精品久久久久9999高清| 色99久久久久高潮综合影院| 久久久无码精品亚洲日韩软件| 久久精品国产亚洲5555| 国产综合成人久久大片91| 久久精品国产亚洲5555|