Page MenuHomeFreeBSD

D46117.id141341.diff
No OneTemporary

D46117.id141341.diff

diff --git a/sys/ddb/db_command.c b/sys/ddb/db_command.c
--- a/sys/ddb/db_command.c
+++ b/sys/ddb/db_command.c
@@ -871,10 +871,7 @@
else
pid = -1;
db_printf("Tracing pid %d tid %ld td %p\n", pid, (long)td->td_tid, td);
- if (td->td_proc != NULL && (td->td_proc->p_flag & P_INMEM) == 0)
- db_printf("--- swapped out\n");
- else
- db_trace_thread(td, count);
+ db_trace_thread(td, count);
}
static void
@@ -898,10 +895,7 @@
db_printf("\nTracing command %s pid %d"
" tid %ld td %p\n", td->td_proc->p_comm,
td->td_proc->p_pid, (long)td->td_tid, td);
- if (td->td_proc->p_flag & P_INMEM)
- db_trace_thread(td, -1);
- else
- db_printf("--- swapped out\n");
+ db_trace_thread(td, -1);
if (db_pager_quit) {
kdb_jmpbuf(prev_jb);
return;
diff --git a/sys/ddb/db_ps.c b/sys/ddb/db_ps.c
--- a/sys/ddb/db_ps.c
+++ b/sys/ddb/db_ps.c
@@ -215,8 +215,6 @@
state[1] = '\0';
/* Additional process state flags. */
- if (!(p->p_flag & P_INMEM))
- strlcat(state, "W", sizeof(state));
if (p->p_flag & P_TRACED)
strlcat(state, "X", sizeof(state));
if (p->p_flag & P_WEXIT && p->p_state != PRS_ZOMBIE)
diff --git a/sys/ddb/db_thread.c b/sys/ddb/db_thread.c
--- a/sys/ddb/db_thread.c
+++ b/sys/ddb/db_thread.c
@@ -87,11 +87,8 @@
(void *)thr->td_kstack);
prev_jb = kdb_jmpbuf(jb);
if (setjmp(jb) == 0) {
- if (thr->td_proc->p_flag & P_INMEM) {
- if (db_trace_thread(thr, 1) != 0)
- db_printf("***\n");
- } else
- db_printf("*** swapped out\n");
+ if (db_trace_thread(thr, 1) != 0)
+ db_printf("***\n");
}
kdb_jmpbuf(prev_jb);
thr = kdb_thr_next(thr);
diff --git a/sys/fs/procfs/procfs_status.c b/sys/fs/procfs/procfs_status.c
--- a/sys/fs/procfs/procfs_status.c
+++ b/sys/fs/procfs/procfs_status.c
@@ -121,7 +121,7 @@
wmesg = "nochan";
thread_unlock(tdfirst);
- if (p->p_flag & P_INMEM) {
+ {
struct timeval start, ut, st;
PROC_STATLOCK(p);
@@ -134,8 +134,7 @@
(intmax_t)start.tv_sec, start.tv_usec,
(intmax_t)ut.tv_sec, ut.tv_usec,
(intmax_t)st.tv_sec, st.tv_usec);
- } else
- sbuf_printf(sb, " -1,-1 -1,-1 -1,-1");
+ }
sbuf_printf(sb, " %s", wmesg);
diff --git a/sys/i386/linux/linux_ptrace_machdep.c b/sys/i386/linux/linux_ptrace_machdep.c
--- a/sys/i386/linux/linux_ptrace_machdep.c
+++ b/sys/i386/linux/linux_ptrace_machdep.c
@@ -213,7 +213,7 @@
{
PROC_LOCK_ASSERT(td->td_proc, MA_OWNED);
- if (cpu_fxsr == 0 || (td->td_proc->p_flag & P_INMEM) == 0)
+ if (cpu_fxsr == 0)
return (EIO);
bcopy(&get_pcb_user_save_td(td)->sv_xmm, fpxregs, sizeof(*fpxregs));
return (0);
@@ -224,7 +224,7 @@
{
PROC_LOCK_ASSERT(td->td_proc, MA_OWNED);
- if (cpu_fxsr == 0 || (td->td_proc->p_flag & P_INMEM) == 0)
+ if (cpu_fxsr == 0)
return (EIO);
bcopy(fpxregs, &get_pcb_user_save_td(td)->sv_xmm, sizeof(*fpxregs));
return (0);
diff --git a/sys/kern/kern_proc.c b/sys/kern/kern_proc.c
--- a/sys/kern/kern_proc.c
+++ b/sys/kern/kern_proc.c
@@ -1148,10 +1148,7 @@
kp->ki_ssize = vm->vm_ssize;
} else if (p->p_state == PRS_ZOMBIE)
kp->ki_stat = SZOMB;
- if (kp->ki_flag & P_INMEM)
- kp->ki_sflag = PS_INMEM;
- else
- kp->ki_sflag = 0;
+ kp->ki_sflag = PS_INMEM;
/* Calculate legacy swtime as seconds since 'swtick'. */
kp->ki_swtime = (ticks - p->p_swtick) / hz;
kp->ki_pid = p->p_pid;
diff --git a/sys/kern/kern_racct.c b/sys/kern/kern_racct.c
--- a/sys/kern/kern_racct.c
+++ b/sys/kern/kern_racct.c
@@ -332,12 +332,6 @@
ASSERT_RACCT_ENABLED();
- /*
- * If the process is swapped out, we count its %cpu usage as zero.
- * This behaviour is consistent with the userland ps(1) tool.
- */
- if ((p->p_flag & P_INMEM) == 0)
- return (0);
swtime = (ticks - p->p_swtick) / hz;
/*
diff --git a/sys/kern/sys_process.c b/sys/kern/sys_process.c
--- a/sys/kern/sys_process.c
+++ b/sys/kern/sys_process.c
@@ -97,14 +97,8 @@
*/
#define PROC_ACTION(action) do { \
- int error; \
- \
PROC_LOCK_ASSERT(td->td_proc, MA_OWNED); \
- if ((td->td_proc->p_flag & P_INMEM) == 0) \
- error = EIO; \
- else \
- error = (action); \
- return (error); \
+ return (action); \
} while (0)
int
diff --git a/sys/sys/proc.h b/sys/sys/proc.h
--- a/sys/sys/proc.h
+++ b/sys/sys/proc.h
@@ -835,7 +835,7 @@
#define P_TOTAL_STOP 0x02000000 /* Stopped in stop_all_proc. */
#define P_INEXEC 0x04000000 /* Process is in execve(). */
#define P_STATCHILD 0x08000000 /* Child process stopped or exited. */
-#define P_INMEM 0x10000000 /* Loaded into memory. */
+#define P_INMEM 0x10000000 /* Loaded into memory, always set. */
#define P_UNUSED1 0x20000000 /* --available-- */
#define P_UNUSED2 0x40000000 /* --available-- */
#define P_PPTRACE 0x80000000 /* PT_TRACEME by vforked child. */
diff --git a/sys/sys/user.h b/sys/sys/user.h
--- a/sys/sys/user.h
+++ b/sys/sys/user.h
@@ -225,7 +225,7 @@
* Legacy PS_ flag. This moved to p_flag but is maintained for
* compatibility.
*/
-#define PS_INMEM 0x00001 /* Loaded into memory. */
+#define PS_INMEM 0x00001 /* Loaded into memory, always true. */
/* ki_sessflag values */
#define KI_CTTY 0x00000001 /* controlling tty vnode active */
diff --git a/sys/vm/vm_swapout.c b/sys/vm/vm_swapout.c
--- a/sys/vm/vm_swapout.c
+++ b/sys/vm/vm_swapout.c
@@ -389,13 +389,6 @@
limit = OFF_TO_IDX(
qmin(rsslim.rlim_cur, rsslim.rlim_max));
- /*
- * let processes that are swapped out really be
- * swapped out set the limit to nothing (will force a
- * swap-out.)
- */
- if ((p->p_flag & P_INMEM) == 0)
- limit = 0; /* XXX */
vm = vmspace_acquire_ref(p);
_PHOLD(p);
PROC_UNLOCK(p);

File Metadata

Mime Type
text/plain
Expires
Wed, Apr 29, 12:55 AM (10 h, 19 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
32315809
Default Alt Text
D46117.id141341.diff (5 KB)

Event Timeline