Re: [PATCH v5 08/12] zsmalloc: introduce zspage structure

From
Sergey Senozhatsky <hidden>
Date
2016-05-17 01:27:26
Also in
lkml
Reply to
Minchan Kim, 2016-05-17
On (05/17/16 10:14), Minchan Kim wrote:
[..]
quoted
can we also switch create_cache() to errnos? I just like a bit
better
		return -ENOMEM;
	else
		return 0;

than

		return 1;
	else
		return 0;
Hmm, of course, I can do it easily.
But zs_create_pool returns NULL without error propagation from sub
functions so I don't see any gain from returning errno from
create_cache. I don't mean I hate it but just need a justificaion
to persuade grumpy me.
:) not married to those errnos. can skip it.
quoted
quoted
+static struct zspage *isolate_zspage(struct size_class *class, bool source)
 {
+	struct zspage *zspage;
+	enum fullness_group fg[2] = {ZS_ALMOST_EMPTY, ZS_ALMOST_FULL};
+	if (!source) {
+		fg[0] = ZS_ALMOST_FULL;
+		fg[1] = ZS_ALMOST_EMPTY;
+	}
+
+	for (i = 0; i < 2; i++) {
sorry, why not "for (i = ZS_ALMOST_EMPTY; i <= ZS_ALMOST_FULL ..." ?
For source zspage, the policy is to find a fragment object from ZS_ALMOST_EMPTY.
For target zspage, the policy is to find a fragment object from ZS_ALMOST_FULL.

Do I misunderstand your question?
ahhh... sorry, it's just me being silly. I got it now.

	-ss

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
Thread (28 messages) 28 messages, 3 authors, last reply 2016-05-17
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help