From: Caspar Z. <ca...@ca...> - 2011-12-22 13:35:30
|
On 10/18/2011 07:02 PM, Caspar Zhang wrote: > > swapping01 - first time swap use results in heavy swapping > > This case is used for testing upstream commit: > 50a15981a1fac7e019ff7c3cba87531fb580f065 > > The upstream commit fixed a issue on s390 platform that heavy > swapping might occur in some condition, however since the patch > was quite general, this testcase will be run on all supported > platform to ensure no regression been introduced. > > Details of the upstream fix: > On x86 a page without a mapper is by definition not referenced / old. > The s390 architecture keeps the reference bit in the storage key and > the current code will check the storage key for page without a mapper. > This leads to an interesting effect: the first time an s390 system > needs to write pages to swap it only finds referenced pages. This > causes a lot of pages to get added and written to the swap device. > To avoid this behaviour change page_referenced to query the storage > key only if there is a mapper of the page. > > Test Strategy: > Try to allocate memory which size is slightly larger than current > available memory. After allocation done, continue loop for a while > and calculate the used swap size. The used swap size should be small > enough, else it indicates that heavy swapping is occured unexpectedly. > > Test Prerequisites: > Free swap sapce should be > COE_SLIGHT_OVER, else an oom-killer > will be triggered. > > Signed-off-by: Caspar Zhang <ca...@ca...> > --- > runtest/mm | 2 + > testcases/kernel/mem/swapping/Makefile | 24 ++++ > testcases/kernel/mem/swapping/swapping01.c | 200 ++++++++++++++++++++++++++++ > 3 files changed, 226 insertions(+), 0 deletions(-) > create mode 100644 testcases/kernel/mem/swapping/Makefile > create mode 100644 testcases/kernel/mem/swapping/swapping01.c > Hi Cyril, please review this test, thanks. Caspar |