Skip to contentSkip to conversation

LMK: Optimize lowmem_shrink

PATCH In review Leon Ma 3 participants 3 messages Aug 21, 2013 – Aug 23, 2013 Staging

lore
Share & tools
lore

Leon Ma

author
#0 lore raw

PATCH 1/1 LMK: Optimize lowmem_shrink

From: Leon Ma <[email protected]>
Date: Mon, 19 Aug 2013 14:22:38 +0800
Subject: [PATCH] LMK: Optimize lowmem_shrink.

By comparing with selected_oom_score_adj instead of min_score_adj, we may do less calculation.

---
 drivers/staging/android/lowmemorykiller.c |   12 ++++--------
 1 files changed, 4 insertions(+), 8 deletions(-)
drivers/staging/android/lowmemorykiller.c +4 -8
index f6c05c9..cb944c5 100644
@@ -126,7 +126,7 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
 			return 0;
 		}
 		oom_score_adj = p->signal->oom_score_adj;
-		if (oom_score_adj < min_score_adj) {
+		if (oom_score_adj < selected_oom_score_adj) {
 			task_unlock(p);
 			continue;
 		}
@@ -134,13 +134,9 @@ static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)
 		task_unlock(p);
 		if (tasksize <= 0)
 			continue;
-		if (selected) {
-			if (oom_score_adj < selected_oom_score_adj)
-				continue;
-			if (oom_score_adj == selected_oom_score_adj &&
-			    tasksize <= selected_tasksize)
-				continue;
-		}
+		if (selected && oom_score_adj == selected_oom_score_adj &&
+			tasksize <= selected_tasksize)
+			continue;
 		selected = p;
 		selected_tasksize = tasksize;
 		selected_oom_score_adj = oom_score_adj;
Signature · 1 line
1.7.4.1
maintainer
#1 lore raw
Quoted 3 lines · Leon Ma

From: Leon Ma <[email protected]>
Date: Mon, 19 Aug 2013 14:22:38 +0800
Subject: [PATCH] LMK: Optimize lowmem_shrink.

Why is all of this in the patch body?

And what does "LMK:" stand for?

Quoted 2 lines

By comparing with selected_oom_score_adj instead of min_score_adj, we may do less calculation.

What does this change? Does it fix a problem?

thanks,

greg k-h

#2 lore raw
Quoted 8 lines · Greg KH

Subject: Re: [PATCH] LMK: Optimize lowmem_shrink
User-Agent: Mutt/1.5.21 (2010-09-15)

Quoted 3 lines · Leon Ma

From: Leon Ma <[email protected]>
Date: Mon, 19 Aug 2013 14:22:38 +0800
Subject: [PATCH] LMK: Optimize lowmem_shrink.

Quoted 8 lines

Why is all of this in the patch body?

And what does "LMK:" stand for?

Quoted 2 lines

By comparing with selected_oom_score_adj instead of min_score_adj, we may do less calculation.

What does this change? Does it fix a problem?

Hello,

linux-next since

	c95dd63d4cc3647643ff502d70c4c1b52947c770
	Author: Dave Chinner <[email protected]>
	Date:   Fri Aug 16 09:39:54 2013 +1000

	drivers: convert shrinkers to new count/scan API

does not contain lowmem_shrink(), but lowmem_scan() instead. plus at lest one more patch on top of it (e2bfaf75e763396b7baa7c1effa4053d7f19e6d3):

[..]
-static int lowmem_shrink(struct shrinker *s, struct shrink_control *sc)

+static long lowmem_scan(struct shrinker *s, struct shrink_control *sc) [..]

wouldn't it be better to have the patch against -next in this case (in case it fixes anything)?

thanks,

	-ss
Quoted 8 lines

thanks,

greg k-h
_______________________________________________
devel mailing list
[email protected]
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel