Re: [PATCH 1/1] GCD: add binary GCD algorithm

From: Andrew Morton
Date: Fri Aug 22 2014 - 17:31:25 EST


On Fri, 15 Aug 2014 20:49:16 +0800 Zhaoxiu Zeng <zhaoxiu.zeng@xxxxxxxxx> wrote:

> Because some architectures (alpha, armv6, etc.) don't provide hardware division,
> the mod operation is slow! Binary GCD algorithm uses simple arithmetic operations,
> it replaces division with arithmetic shifts, comparisons, and subtraction.

I had a look around and it seems that most (all?) gcd() and lcd()
callers are on initialization-time slowpaths.

Do you know of a workload which will significantly benefit from this
change? If so, by how much?

Otherwise I don't think we can justify the additional maintenance
cost/risk, sorry.

And if we *do* decide to proceed with this patch, we should include a
patch which enables it on as many architectures as possible, so it gets
runtime tested.

--
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/