Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164423
b: refs/heads/master
c: 35451be
h: refs/heads/master
i:
  164421: cafccca
  164419: b3db432
  164415: 2100486
v: v3
  • Loading branch information
Hugh Dickins authored and Linus Torvalds committed Sep 22, 2009
1 parent ceb1c62 commit 9839abf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: a913e182ab9484308e870af37a14d372742d53b0
refs/heads/master: 35451beecbd7c86ce3249d543594517a5fe9a0cd
2 changes: 1 addition & 1 deletion trunk/include/linux/sched.h
Original file line number Diff line number Diff line change
Expand Up @@ -1720,7 +1720,7 @@ extern cputime_t task_gtime(struct task_struct *p);
#define PF_FROZEN 0x00010000 /* frozen for system suspend */
#define PF_FSTRANS 0x00020000 /* inside a filesystem transaction */
#define PF_KSWAPD 0x00040000 /* I am kswapd */
#define PF_SWAPOFF 0x00080000 /* I am in swapoff */
#define PF_OOM_ORIGIN 0x00080000 /* Allocating much memory to others */
#define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */
#define PF_KTHREAD 0x00200000 /* I am a kernel thread */
#define PF_RANDOMIZE 0x00400000 /* randomize virtual address space */
Expand Down
2 changes: 2 additions & 0 deletions trunk/mm/ksm.c
Original file line number Diff line number Diff line change
Expand Up @@ -1557,7 +1557,9 @@ static ssize_t run_store(struct kobject *kobj, struct kobj_attribute *attr,
if (ksm_run != flags) {
ksm_run = flags;
if (flags & KSM_RUN_UNMERGE) {
current->flags |= PF_OOM_ORIGIN;
err = unmerge_and_remove_all_rmap_items();
current->flags &= ~PF_OOM_ORIGIN;
if (err) {
ksm_run = KSM_RUN_STOP;
count = err;
Expand Down
2 changes: 1 addition & 1 deletion trunk/mm/oom_kill.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ unsigned long badness(struct task_struct *p, unsigned long uptime)
/*
* swapoff can easily use up all memory, so kill those first.
*/
if (p->flags & PF_SWAPOFF)
if (p->flags & PF_OOM_ORIGIN)
return ULONG_MAX;

/*
Expand Down
4 changes: 2 additions & 2 deletions trunk/mm/swapfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -1575,9 +1575,9 @@ SYSCALL_DEFINE1(swapoff, const char __user *, specialfile)
p->flags &= ~SWP_WRITEOK;
spin_unlock(&swap_lock);

current->flags |= PF_SWAPOFF;
current->flags |= PF_OOM_ORIGIN;
err = try_to_unuse(type);
current->flags &= ~PF_SWAPOFF;
current->flags &= ~PF_OOM_ORIGIN;

if (err) {
/* re-insert swap space back into swap_list */
Expand Down

0 comments on commit 9839abf

Please sign in to comment.