code, right?+ unsigned long long ret;This code doesn't make sense to me. What you really want is following
+
+ if (total_size >= GBYTES(4) && total_size < GBYTES(12))
+ ret = MBYTES(256);
+ else if (total_size >= GBYTES(12) && total_size < GBYTES(128))
+ ret = MBYTES(512);
+ else if (total_size >= GBYTES(128) && total_size < GBYTES(256))
+ ret = MBYTES(768);
+ else if (total_size >= GBYTES(256) && total_size < GBYTES(378))
+ ret = MBYTES(1024);
+ else if (total_size >= GBYTES(318) && total_size < GBYTES(512))
+ ret = MBYTES(1536);
+ else if (total_size >= GBYTES(512) && total_size < GBYTES(768))
+ ret = MBYTES(2048);
+ else
+ ret = MBYTES(3072);
+ if (!ia64_platform_is("sn2") && !ia64_platform_is("uv"))
+ if (ret > GBYTES(4))
+ ret = ret / GBYTES(4) * MBYTES(256);
+ if (total_size > GBYTES(4))Nope. Check check_crashkernel_memory().
+ ret = total_size / GBYTES(4) * MBYTEST(256)
This statement will be ALWAYS false:
+ if (ret > GBYTES(4))
since ret's max value is 3GB after the above total_size checks.
So the code doesn't make sense. Did I miss something?