OSC-binpaste

From SOFTICE

Jump to: navigation, search


Contents

Alessio's OSC binpaste

Memory Management

  • display memory information map for given process, for kernel
  • focus on kernel API to allocate memory for process (sbreak) and for kernel (pages at a time)
  731:         struct mm_struct *mm, *active_mm;
  732: 
  838: 
  839: /* VM state */
  840:         struct reclaim_state *reclaim_state;
  841: 
  842:         struct dentry *proc_dentry;
  843:         struct backing_dev_info *backing_dev_info;
  844: 
  845:         struct io_context *io_context;
  846: 
  847:         unsigned long ptrace_message;
  848:         siginfo_t *last_siginfo; /* For ptrace use.  */
  863: #ifdef CONFIG_NUMA
  864:         struct mempolicy *mempolicy;
  865:         short il_next;
  866: #endif

struct task_struct stuff

the following is part of struct task_struct but not necessarily relevant to introduce in Osc:lab-02.

  695:         atomic_t usage;
  696:         unsigned long flags;   /* per process flags, defined below */
  697:         unsigned long ptrace;
  698: 
  699:         int lock_depth;                /* BKL lock depth */
  700: 
  738:         /* ??? */
  739:         unsigned long personality;
  740:         unsigned did_exec:1;
  761:         struct completion *vfork_done;         /* for vfork() */
  762:         int __user *set_child_tid;             /* CLONE_CHILD_SETTID */
  763:         int __user *clear_child_tid;           /* CLONE_CHILD_CLEARTID */
  764: 
  819:         void *security;
  820:         struct audit_context *audit_context;
  821:         seccomp_t seccomp;
  822: 
  823: /* Thread group tracking */
  824:         u32 parent_exec_id;
  825:         u32 self_exec_id;
  867: #ifdef CONFIG_CPUSETS
  868:         struct cpuset *cpuset;
  869:         nodemask_t mems_allowed;
  870:         int cpuset_mems_generation;
  871: #endif
  872:         atomic_t fs_excl;      /* holding fs exclusive resources */
  873:         struct rcu_head rcu;
  874: };


I/O

  849: /*
  850:  * current io wait handle: wait queue entry to use for io waits
  851:  * If this thread is processing aio, this points at the waitqueue
  852:  * inside the currently handled kiocb. It may be NULL (i.e. default
  853:  * to a stack based synchronous wait) if its doing sync IO.
  854:  */
  855:         wait_queue_t *io_wait;
  856: /* i/o counters(bytes read/written, #syscalls */
  857:         u64 rchar, wchar, syscr, syscw;
  858: #if defined(CONFIG_BSD_PROCESS_ACCT)
  859:         u64 acct_rss_mem1;     /* accumulated rss usage */
  860:         u64 acct_vm_mem1;      /* accumulated virtual memory usage */
  861:         clock_t acct_stimexpd; /* clock_t-converted stime since last update */
  862: #endif


Synchronisation

  826: /* Protection of (de-)allocation: mm, files, fs, tty, keyrings */
  827:         spinlock_t alloc_lock;
  828: /* Protection of proc_dentry: nesting proc_lock, dcache_lock, write_lock_irq(&tasklist_lock); */
  829:         spinlock_t proc_lock;
  830: 
  831: #ifdef CONFIG_DEBUG_MUTEXES
  832:         /* mutex deadlock detection */
  833:         struct mutex_waiter *blocked_on;
  834: #endif
  835: 


IPCs & Signals

  795: /* ipc stuff */
  796:         struct sysv_sem sysvsem;
  805: /* signal handlers */
  806:         struct signal_struct *signal;
  807:         struct sighand_struct *sighand;
  808: 
  809:         sigset_t blocked, real_blocked;
  810:         sigset_t saved_sigmask;                /* To be restored with TIF_RESTORE_SIGMASK */
  811:         struct sigpending pending;
  812: 
  813:         unsigned long sas_ss_sp;
  814:         size_t sas_ss_size;
  815:         int (*notifier)(void *priv);
  816:         void *notifier_data;
  817:         sigset_t *notifier_mask;
  818:         


credentials keys

  783: #ifdef CONFIG_KEYS
  784:         struct key *request_key_auth;  /* assumed request_key authority */
  785:         struct key *thread_keyring;    /* keyring private to this thread */
  786:         unsigned char jit_keyring;     /* default keyring to attach requested keys to */
  787: #endif
  788:         int oomkilladj; /* OOM kill score adjustment (bit shift). */
  789:         char comm[TASK_COMM_LEN]; /* executable name excluding path
  790:                                      - access with [gs]et_task_comm (which lock
  791:                                        it with task_lock())
  792:                                      - initialized normally by flush_old_exec */