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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On (05/17/16 10:14), Minchan Kim wrote:
[..]
> > 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.

> > > +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@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]