SRU request for LP#86778 (6.0.6 LTS)

Colin Ian King colin.king at canonical.com
Thu Sep 4 13:30:12 UTC 2008


https://bugs.launchpad.net/ubuntu/dapper/+source/linux-source-2.6.15/+bug/86778

SRU Justification:

Impact: The mm zone page calculations are being miscalculated because of
a previous commit.

Fix: Add parentheses around >> operators in setup_per_zone_pages_min()
to correct the calculation. Elaboration here:

originally the calculation was:

zone->pages_low = zone->pages_min + tmp / 4;
zone->pages_high = zone->pages_min + tmp / 2;

commit 622f7b4c920a9362d506400c0da02e3e06442b27 changed it to:

zone->pages_low = zone->pages_min + tmp >> 2;
zone->pages_high = zone->pages_min + tmp >> 1;

unfortunately the + operator has higher precedence than >> hence the
bug.

it should be:

zone->pages_low = zone->pages_min + (tmp >> 2);
zone->pages_high = zone->pages_min + (tmp >> 1);

Testcase: One can see the zonelist from /proc/zoneinfo: The low and high
water marks should be different between the buggy and fixed versions.

Testing:

1. Install 6.0.6 LTS i386 Server in VirtualBox and
recording /proc/zoneinfo from /etc/rc.local to capture the zoneline low
and high settings at boot time. 
2. Booted up 3 times to see if the figures differ per boot (they
don't). 
3. Installed the fixed kernel and repeated the 3 boot test
4. Compare the buggy and fixed /proc/zoneinfo logs, e.g:

	Buggy	Fixed
low      15	38
high     31	46


Attached: Patch, zoneinfo_buggy.log (buggy zoneinfo) and
zoneinfo_fixed.log (fixed version).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-UBUNTU-mm-fix-zone-pages-min-max-calculations.patch
Type: application/mbox
Size: 1305 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20080904/a45d0cdf/attachment.mbox>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zoneinfo_buggy.log
Type: text/x-log
Size: 2891 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20080904/a45d0cdf/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: zoneinfo_fixed.log
Type: text/x-log
Size: 2891 bytes
Desc: not available
URL: <https://lists.ubuntu.com/archives/kernel-team/attachments/20080904/a45d0cdf/attachment-0001.bin>


More information about the kernel-team mailing list