Re: [PATCH 2/2] vmscan: don't subtraction of unsined

From: Christoph Lameter
Date: Tue Jun 29 2010 - 11:15:38 EST


On Mon, 28 Jun 2010, KOSAKI Motohiro wrote:

> It's unsigned. negative mean very big value. so
>
> "zone_page_state(zone, NR_SLAB_RECLAIMABLE) > slab_reclaimable - nr_pages)" will
> be evaluated false.

There were some suggestions on how to address this later in the patch.

> ok, your mysterious 'order' parameter (as pointed [1/2]) almostly prevent this case.
> because passing 'order' makes very heavy slab pressure and it avoid negative occur.
>
> but unnaturall coding style can make confusing to reviewers. ya, it's not
> big issue. but I also don't find no fixing reason.

This is not a coding issue but one of logic. The order parameter is
mysterious to me too. So is the lru_pages logic.

> > The comparison could be a problem here. So
> >
> > zone_page_state(zone, NR_SLAB_RECLAIMABLE) + nr_pages >
> > slab_reclaimable
> >
> > ?
>
> My patch take the same thing. but It avoided two line comparision.
> Do you mean you like this style? (personally, I don't). If so, I'll
> repost this patch.

Yes. I also do not like long cryptic names for local variables.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/